Ethereum Foundation researcher Justin Drake and bloXroute Labs CEO Uri Klarman recently discussed Maximum Extractable Value (MEV) on Laura Shin’s podcast. They focused on MEV’s impact on Ethereum users.
Once called ‘Miner Extracted Value,’ modern MEV in Ethereum’s new proof-of-stake (PoS) involves sophisticated participants prioritizing and reordering advantageous transactions in new blocks. In Ethereum’s case, validators can use decentralized exchanges (DEX) to increase their earnings.
Unlike Bitcoin mining pool operators who are typically the only parties who select and order transactions within a block, there are many parties who select and order transactions within an Ethereum block.
Ethereum users broadcast transactions into Mempools where they wait in pending status. Searchers then scan Mempools and identify MEV opportunities using these pending orders.
These searchers then assemble their most advantageous transactions into a Bundle and send these to Builders who use it — along with other data — to construct a formal Ethereum block that meets validation requirements.
Next, builders send their final block to proposers, proposers send their final block to relayers, and the relayers transmit the blocks to validators.
Validators validate the block and if it follows consensus rules, attestors verify that the validators signed appropriately.
MEV front-running, back-running, and sandwiching
Justin Drake and Uri Klarman covered the idea that validators could exploit DEXs through ‘front-running.’ This involves using special information, such as an expected large trade, to place orders ‘ahead’ of other investors’ trades. Similarly, if an order is placed immediately after other investors’ trades, this is ‘back-running.’
Brokers can conduct front-running by buying assets before they execute their clients’ trades, for example.
Validators can profit from front-running by confirming trade transactions from bots that bid a slightly higher gas price before validating other traders’ transactions. These bots can sniff out submitted trades before they are validated and ‘front-run’ them.
An extreme version of profiting from bots that can front-run by placing higher bids became known as the time bandit attack. This attack could retroactively reorganize blocks to extract higher value, often leaving honest users out in the cold when previously confirmed transactions get thrown back into the mempool.
Before the Merge activated, an unlikely yet theoretical coalition of miners that made up at least 40% of Ethereum’s hash rate had a fair chance of causing confusion by submitting competing blocks and splitting the chain.
Unchained host Laura Shin said a group called MEV Blocker detected that validators used front-running to exploit DEX users for $1.3 billion in value. MEV Blocker promises protection against front-running and sandwich attacks. Users can add an RPC endpoint to their Ethereum wallet to stop front-running and get paid by parties searching for their transactions.
Bots may also conduct a so-called ‘sandwich attack’ in which they buy an asset immediately before someone else executes a trade and then sell it immediately after the trade is complete. A developer called ‘CodeForcer’ proposed a way to counter sandwich attacks with a smart contract called Salmonella and a UniSwap pool.
This smart contract used a ‘poisoned’ token that could drain known sandwich attackers’ assets if they targeted the contract’s trades. Eventually, the bots began to adapt to Salmonella like an immune system adapting to a new virus — but not before CodeForcer drained off more than 100 ETH from bots that targeted it. CodeForcer’s methodology became known as the salmonella attack.
Attempts to reduce MEV exploitation of users
Attempts to solve the front-running bot problem include MEV protection by Flashbots. As the largest MEV protocol on Ethereum, it allows users to submit transactions directly to validators without making them visible in the mempool (where MEV-seeking searchers will bundle their transactions for builders). Theoretically, a bot could not front-run or ‘sandwich’ a trade it couldn’t see.
Another non-custodial wallet called BlockWallet integrated a feature called Flashbots Protection.
Ethereum Research has also proposed a method for MEV Smoothing, which would make validators’ MEV earnings more uniform. This method suggests that committees could confirm new blocks of transactions and equally split the rewards. It also requires that the block Proposer be placed on an equal footing with committee members.
However, Ethereum Research acknowledged one weakness: Combating censorship would require altruistic proposers if the market became centralized.
In July 2021, then-Gnosis COO Friederike Ernst proposed a batch auction model to combat fee-based front-running and the extreme time bandit attack. Batch auctions could force validators to confirm all transactions made in a specified time period at the same time, regardless of fees. This model takes away miners’ ability to reorganize blocks or select transactions based on which ones offer the highest fees derived from MEV.
Finally, a developer called ‘Pmcgoohan’ has introduced another solution for fee-based front-running with a decentralized content layer protocol. Pmcgoohan proposed a system by which miners (or validators) could not consider which transactions had higher fees when deciding which data to include in a block.
The system need only decide whether that content follows existing rules. A check on whether the sender has the right to send that content need not depend on how much that sender can afford to pay in fees.
Even with these proposed solutions, MEV remains an issue for traders whose trades might get front-run, back-run, sandwiched, or otherwise exploited by MEV searchers.