A user connects their wallet to a decentralized exchange, intends to swap 10 tokens for another, and approves the transaction. The signature goes through. Moments later, the wallet has lost the 10 tokens but received nothing in return. The exploit succeeded because the approval was valid—the wallet owner did authorize a transaction—but what was actually moved was not what the user thought they were approving. Traditional wallet security has long relied on protecting private keys and preventing unauthorized signatures. That approach leaves a gap: a correctly signed transaction can still execute the wrong operation if the user does not understand what they are signing.
The Rabby wallet extension addresses this gap through transaction simulation, a technique that executes transactions off-chain before they reach the blockchain, showing the user exactly what will happen in plain language rather than waiting for them to decode contract bytecode or function selectors. This is not the same as preventing approvals or blocking transactions outright. Simulation is a reading mechanism; approval controls are a writing mechanism. The distinction matters because it changes which exploits the wallet can catch and when it must rely on user judgment instead.
Why traditional approvals do not capture the full exploit surface
Approval-based security typically works by examining a transaction’s target address, method signature, or recipient. If a wallet sees an approval to spend tokens, it may warn the user or block it entirely if the spender address is not on a whitelist. This protects against a specific attack vector: a malicious contract that the user did not intend to approve spending authority for. However, it does not address the scenario where the user correctly approves a legitimate contract, but that contract is then exploited, manipulated, or instructed to do something the user did not intend.
Consider a router contract for token swaps. A legitimate router may have been approved by thousands of users. An attacker cannot forge a new approval from a user’s wallet—the private key is required. Instead, the attacker might craft a malicious call to the router with falsified parameters: swap 10 of Token A, but configure the function to actually transfer 100 of Token B to the attacker’s address. The approval itself remains unchanged and valid. A wallet checking only whether an approval exists will see no red flag. The transaction passes because it is going to an approved address. But the function parameters—the actual instructions—are the problem.
This is where transaction simulation diverges from approval-based defenses. Rather than asking “Is this spender approved?” a simulation asks “If this transaction executes, what will the user’s balance sheet actually look like?” The wallet replays the transaction against a real or simulated state of the blockchain, invokes the contract methods, and returns the result without broadcasting anything. The Rabby wallet extension then displays that result in human-readable form: “You will send 10 USDC and receive 9.5 DAI” or “Warning: You will lose 100 tokens and receive 0.”
How simulation detects exploits that approvals cannot
Simulation catches several exploit categories that approval-based mechanisms are structurally unable to prevent. The first is parameter manipulation. An attacker could deploy a website that looks like a legitimate dApp, copies the UI from the real service, but calls the contract with modified parameters. A user might see the interface display “swap 10 USDC for DAI” but the actual signed transaction could include “transfer all USDC in the wallet to attacker.” Traditional approval checking does not examine function parameters; it only verifies that the target contract is known. Transaction simulation, by contrast, executes the function call and shows the outcome.
The second category is reentrancy and state-dependent behavior. Some contracts change behavior based on the wallet’s current token balance, the time of the call, or the state of external price feeds. An approval is static; the user approves a contract once, and that approval remains valid regardless of state changes. But simulation executes the transaction in the current state and can reveal if the contract is attempting to exploit a flash loan, arbitrage opportunity, or time-sensitive condition. If a contract suddenly behaves differently because prices moved in the last block, simulation can show that.
A third category is hidden transaction chains. Some exploits involve multiple internal transactions. The user signs what appears to be a simple swap, but the contract internally calls other contracts, which call others, creating a chain. Approval-based filtering cannot traverse this chain because it only sees the top-level transaction. Simulation, however, follows every internal call and aggregates the outcome. If a call to a “swap router” actually triggers 15 internal transfers to attacker wallets, the simulation will show that in the final balance change.
The technical architecture of transaction simulation in Rabby
Rabby’s implementation leverages EVM execution environments to replay transactions without broadcasting. When a user initiates a transaction and the extension receives it, Rabby does not immediately request the user’s signature. Instead, it submits the unsigned transaction data to a public RPC endpoint or a Rabby-operated simulator, which executes the contract code against a fork of the current blockchain state. This fork is temporary; no state changes are persisted.
The simulator returns not just a success or failure but a detailed log of state changes: which tokens moved where, which addresses received value, what the balance deltas are. Rabby’s interface then translates these state changes into a plain-language summary. Instead of showing the user raw contract calldata like “0xa9059cbb000000000000000000000000…” followed by a hex string, the extension displays “Transfer 10 USDC to 0x1234…” This translation layer is what makes simulation useful to non-expert users. The cryptographic verification still depends on the user’s private key and the actual signature; simulation is purely informational.
A critical limitation is that simulation is only as accurate as the state it operates on. If the RPC endpoint provides stale state data, the simulation result may not match what actually happens when the transaction is mined. This is why Rabby also implements scam protection through comparison: if the simulated outcome differs dramatically from what the user interface claimed would happen, the wallet flags it. For example, if a dApp interface shows “receive 10 tokens” but the simulation shows “receive 0 tokens,” the discrepancy itself is a warning sign.
When simulation is not sufficient without additional safeguards
Simulation is a powerful reading mechanism, but it cannot be the entire security model. A sophisticated attacker could construct a contract that behaves honestly during simulation but executes an exploit when actually mined. This would require exploiting differences between the simulated state and the real state at block time—for instance, if a price feed has moved, or if front-running has changed the order of transactions. Rabby mitigates this by providing scam protection through risk labeling: if a transaction’s simulated outcome differs from the interface display by more than a threshold, or if it involves addresses flagged as likely scams, the wallet surfaces a warning rather than silently approving.
Address whitelisting offers a separate control that simulation does not replace. Even if simulation shows the correct outcome, if the recipient address is unfamiliar or newly created, the user might be vulnerable to social engineering. Rabby allows users to maintain a whitelist of trusted addresses. A transaction to a non-whitelisted address, even if the simulation looks clean, can trigger an additional confirmation step. This combines simulation (what will happen) with explicit user intent (who am I willing to send to).
Hardware wallet integration is another layer. A secure wallet that uses a hardware device like Ledger or Trezor benefits from simulation on the software side but still requires the hardware to physically approve the signature. This creates two independent gates: software simulation shows what will happen, and hardware approval is the final veto. An exploit would need to compromise both the user’s software trust and their hardware security, which significantly raises the barrier.
The most important safeguard that simulation cannot replace is user education. If a user is deceived into believing that an interface is legitimate when it is not, or if they misread the simulation output, simulation cannot save them. A transaction that correctly swaps 10 tokens for nothing might still be approved if the user is in a hurry or fails to read the warning. Rabby’s human-readable previews reduce this risk by making the outcome explicit, but they do not eliminate it.
How Rabby wallet extension compares to other transaction safety approaches
Some wallets rely on allowlist-based filtering: they maintain a list of known safe contracts and block transactions to anything else. This is high-confidence but low-flexibility; a user cannot interact with new or small protocols without explicitly overriding the filter. Rabby takes a different approach by using simulation and risk scoring rather than a hard allowlist. This allows new protocols to be interacted with safely if their behavior is as advertised, while still flagging suspicious patterns.
Other wallets use on-chain monitoring: they check the user’s address for suspicious activity after a transaction and alert them if large balances move unexpectedly. This catches exploits but only after they have already happened. Rabby’s pre-execution simulation prevents the exploitation in the first place by showing the user the outcome before they sign and broadcast.
Some solutions use external reputation systems: they query a third-party service to ask “Is this contract good or bad?” These systems can be gamed through Sybil attacks or lag behind new exploits. Rabby’s simulation is deterministic and does not rely on external reputation; the outcome is computed directly from the contract code and current state. This makes it harder to bypass through social engineering or network timing.
The most comparable approach is gas estimation combined with warnings, which some wallets already perform. Gas estimation does require contract execution, but it is typically used only to predict costs, not to surface the full transaction outcome to the user. Rabby elevates this to a primary security feature by making simulation results highly visible and human-readable, integrating it into the main approval flow rather than hiding it in advanced settings. Users accessing Rabby’s rabby wallet extension through the browser will see transaction previews automatically on supported networks without additional configuration.
Practical examples of what simulation reveals
A user attempts to swap 1 ETH for a token that appeared in their feed. The dApp interface shows “You will receive approximately 50,000 NewToken.” The user clicks approve and opens Rabby. The simulation shows “You will send 1 ETH and receive 0 NewToken, but pay 0.1 ETH in gas.” The simulation is working correctly; the “50,000” figure was marketing copy, not a guaranteed outcome. The token may be illiquid, or the contract may have a flaw that causes the output calculation to return zero. Rabby’s simulation caught this before the user paid gas on a failed transaction.
Another scenario: a user clicks a link from an email claiming to be from a DeFi protocol, connects their wallet, and is prompted to “approve unlimited spending.” The interface does not display any token movements. Rabby’s simulation shows “You will approve unlimited spending of your USDC to address 0xabcd…” The simulation correctly reflects what the transaction will do. However, Rabby also checks whether the email sender address is known, whether the domain matches the official protocol, and whether unlimited approvals are the normal pattern for that protocol. If multiple risk signals are present, Rabby flags it as suspicious. The user can override the warning, but they have been forced to consciously choose to proceed.
A third example involves a complex transaction. The user is participating in a liquidity pool on a DEX and receives a transaction to harvest rewards. The transaction internally swaps reward tokens for ETH, bridges ETH to another chain, and stakes it in a yield farm. The interface shows only “Harvest rewards.” A traditional approval check would see the target contract is known and approve. Rabby’s simulation follows all internal calls and reports “You will send 100 Reward Token, lose 50 in slippage, receive 0.5 ETH on Arbitrum, and stake it in contract 0xefgh.” The user now sees the full chain of consequences, not just the headline action.
Limitations and false confidence risks
Simulation provides significant protection, but users should understand what it does not do. If a contract is designed to exploit the user’s trust—for example, a legitimate-looking farming contract that will rug pull after collecting enough funds—simulation cannot prevent it. The contract will execute correctly and transfer funds as designed; the design itself is the problem. Simulation would show “You will approve contract 0x1234 to spend your tokens,” which is accurate and honest.
Another limitation is that simulation depends on the accuracy of external data. If a price feed is manipulated, or if another contract’s state is corrupted, the simulation might show an incorrect outcome. Rabby monitors for these scenarios through additional checks, but perfect accuracy is not guaranteed. Users should be skeptical of transactions that show suspiciously favorable outcomes.
A related risk is that simulation output can create false confidence. A user might see “You will receive 100 tokens” and assume this is absolutely guaranteed. In reality, by the time the transaction is mined, market conditions or contract state might have changed, and the actual outcome could differ. This is why Rabby also shows slippage warnings and time-sensitive transaction expiry settings: the simulation is accurate as of the moment it was run, not as of mining time.
The final and most important limitation is that transaction simulation is only useful if the user actually reads and understands the preview. If a user has trained themselves to see the Rabby preview, click “Confirm” without reading, and move on, they have negated the entire benefit. Security by design is strongest when it combines technical controls (simulation), user interface (clear previews), and user behavior (actually reading the previews). All three must be present for the system to work.
Frequently asked questions
Does the Rabby wallet extension block all malicious transactions automatically?
No. Transaction simulation shows the user what will happen, and scam protection flags suspicious patterns, but the wallet does not block all risky transactions. Users can override warnings. The goal is to make the outcome clear and visible so users can make informed decisions, not to impose automatic restrictions that would prevent legitimate but unusual transactions.
Can I rely on Rabby’s simulation to guarantee a specific price or token amount?
The simulation is accurate as of the moment it is run, but blockchain state can change before the transaction is mined. Market prices, liquidity, and contract behavior can shift. Rabby shows slippage settings and expiry times to address this, but users should always verify that the preview matches their expectations before approving. A secure wallet requires user attention, not just tool reliability.
How does Rabby wallet extension’s simulation compare to approval-based blocking?
Approval-based blocking prevents interactions with unapproved contracts but cannot detect parameter manipulation or contract exploits that occur within approved interactions. Simulation executes the transaction off-chain and shows the actual outcome, catching more exploit vectors. However, simulation is a reading mechanism; it works alongside other security features like hardware wallet integration and address whitelisting, not as a replacement for user judgment.
Leave A Comment