How ‘the Merge’ Will Change the Weird World of Ethereum Mempools

Maximal extracted value (MEV) is an expensive problem caused by Ethereum’s trustless architecture. It might even happen after the Merge turns off mining.

By Nathan ThompsonLayer 2
AccessTimeIconAug 19, 2022 at 5:56 p.m. UTCUpdated Aug 19, 2022 at 9:07 p.m. UTC
By Nathan ThompsonLayer 2
AccessTimeIconAug 19, 2022 at 5:56 p.m. UTCUpdated Aug 19, 2022 at 9:07 p.m. UTC

Nathan Thompson is the lead tech writer for Bybit, a cryptocurrency exchange.

Next month, years of research and development will culminate in the Merge, when the Ethereum blockchain will transition to the proof-of-stake consensus mechanism. There are many reasons to be excited about the end of mining ether (ETH), an energy-intensive process.

Perhaps above all, the Merge may have effects on a perennial issue facing the Ethereum blockchain: maximal (formerly miner) extractable value. More commonly known as MEV, this process forms the basis of a secretive industry built on extracting value from block production, and has generated over half a billion dollars since 2020.

To begin, we must dive into the mysterious world of the memory pool, or “mempool” for short.

Nathan Thompson is lead tech writer at crypto exchange Bybit.

When you make a transaction on the Ethereum blockchain, it will join all the other transactions in the mempool, which is like a doctor’s waiting room. They sit there until a miner includes them in the next block. When a block is full, it’s committed to the chain and you get a message saying your transaction was successful.

So far so good. Well, it turns out that the mempool isn’t what you would call “a safe space.” Because, lurking therein lie sophisticated bots looking to capitalize on arbitrage opportunities and leave you footing the bill.

Explaining MEV

One of the most devilish tactics deployed by the bots is called “the sandwich attack.” This is where a bot spots a large trade, duplicates the transaction and pays the miner a small tip to include their transaction ahead of the target.

Let’s take a hypothetical. You have 10 ETH and would like to buy 2,000 tokens of exampleCoin (EC). So you go to your favorite decentralized exchange (DEX) and make the trade.

Your trade goes into the mempool and is spotted by a bot. It copies your trade exactly and pays the miner a “priority fee” (read: bribe) to get their trade processed first. So the bot buys 2,000 EC for a price of 200 EC per ETH.

Now it’s your turn. You were expecting to get 200 EC per ETH, but the bot has front-run the transaction, causing the price to shift so you only get 199 EC per ETH. So you receive 1,990 EC for your 10 ETH.

Once your transaction goes through, the price of exampleCoin will shift again. This time one ETH will buy you 198 EC. That means the bot can sell its 2,000 EC for 10.1 ETH, making 0.1 ETH profit in a matter of minutes.

This might not sound like a lot, but these bots are running constantly and over time front-running transactions can become very lucrative.

There are many other strategies mempool-roaming bots use that are even more sophisticated. Collectively these actions are called maximum extractable value, many of which are as laborious as the front-running example.

MEV has become a major problem for actual Ethereum users, with no obvious solutions. These algorithms are easy to code and very lucrative. Indeed, MEV-explore has a dashboard following this action, and it shows that these exploits have netted nearly $700 million since records began on Jan. 1, 2020.

It’s very difficult to police this situation because doing so would require a centralized agency, which is against the decentralized ethos of Ethereum. However, third parties have found ways to protect users from these shenanigans.

Flashbots Protect, for instance, offers something called a remote procedure call (RPC) that you can send transactions via a private server to avoid the public mempool. Similarly, The Eden Network allows stakers using their service access to a network where their transactions are processed privately.

Proof-of-stake

Once the Merge is complete, the nature of MEV will shift. Ethereum’s coming proof-of-stake system introduces a new actor into the mix: the block builder. It is them who order transactions and send them to the block producer for final approval.

In the proof-of-work (PoW) system, miners decided how to order transactions coming out of the memepool.

As each block is made of transactions, and each transaction will come with different fees and bribes paid, the value of each block will vary depending on the transactions included therein. Therefore, block builders are incentivized to construct the most lucrative blocks because they will be prioritized by block producers and confirmed first.

There are already several protocols looking to claim their share of the new block building market, and this may become a very lucrative industry. Then there's MEV Boost, which is meant to make MEV extraction more accessible and equitable.

Without going into the granular details, if a protocol can create the most lucrative blocks, then block producers will finalize their blocks first. This might attract more users to their service, which gives them a larger private pool of transactions to choose from and the ability to create even better blocks. A virtuous circle ensues.

It’s strange to think that the solution to bots exploiting Ethereum’s open and trustless system is to be found in professional teams exploiting the system better than anyone else and returning the benefits to users, Robin Hood style. It’s hardly Occam’s razor, but it just might work.

DISCLOSURE

Please note that our privacy policy, terms of use, cookies, and do not sell my personal information has been updated.

The leader in news and information on cryptocurrency, digital assets and the future of money, CoinDesk is a media outlet that strives for the highest journalistic standards and abides by a strict set of editorial policies. CoinDesk is an independent operating subsidiary of Digital Currency Group, which invests in cryptocurrencies and blockchain startups. As part of their compensation, certain CoinDesk employees, including editorial employees, may receive exposure to DCG equity in the form of stock appreciation rights, which vest over a multi-year period. CoinDesk journalists are not allowed to purchase stock outright in DCG.

CoinDesk - Unknown

Nathan Thompson is the lead tech writer for Bybit, a cryptocurrency exchange.