A Transaction Ordering Dependence (TOD) Attack occurs when a malicious actor (often a miner or bot) exploits their ability to influence the order of transactions in a block to gain an unfair advantage — typically by front-running or sandwiching a user’s transaction.
This is possible because:
Attackers use this window to see pending transactions and insert their own transaction before or after to profit.
| Concept | Explanation |
|---|---|
| Mempool | A pool of unconfirmed transactions waiting to be included in a block. All transactions here are visible to everyone. |
| Transaction Fees (Gas) | Users pay gas to get their transaction mined. Higher fees = faster inclusion. |
| Miner Extractable Value (MEV) | The profit miners (or bots) can make by reordering, including, or censoring transactions. |
👉 Because all transactions are visible in the mempool before they’re confirmed, attackers can:
Let’s say you want to buy a large amount of a new token $XYZ on a decentralized exchange like Uniswap.