Maximal Extractable Value (MEV) on Ethereum 2.0
Ethereum’s successful Merge between its mainnet on the now obsolete proof-of-work chain and the Beacon Chain of its new proof-of-stake Consensus layer (Ethereum 2.0) marked the first significant step of a series of upgrades intended to improve the network in terms of scalability and decentralization.
The main goal of the Merge was to transition Ethereum from the energy-intensive proof-of-work (PoW) algorithm to the less energy-demanding proof-of-stake (PoS). As a result, miners who were once the backbone of Ethereum were replaced by validators who are now responsible for storing data, processing transactions and adding new blocks to the chain.
Just Like Ethereum Miners on PoW, Validators Can Still Implement MEV.
Through the proof-of-stake algorithm, Ethereum validators stake a minimum of 32 ETH into a smart contract to participate in the network by adding new blocks to the chain. The validators are incentivized through rewards for good behavior and penalties for downtime or malicious behavior.
Running Ethereum on a proof-of-stake algorithm still allows validators to carry out a profitable practice commonly used by proof-of-work miners known as Maximal Extractable Value (MEV).
What is the Maximal Extractable Value (MEV)
Maximal Extractable Value (MEV) refers to the maximum value or profits that can be extracted by those mining or producing blocks in a blockchain network. MEV is achieved by including, censoring, or reordering transactions to earn as much from block production as possible.
Ideally, miners should process transactions based on the amount of fees paid. Source, blog,chain.link
MEV was initially known as ‘Miner Extractable Value’ since it was first identified in the proof-of-work environment where miners would rearrange transactions in the mempool to extract benefits and as much gas fees at the expense of users. But it has since been renamed ‘Maximal Extractable Value’ as validators are now responsible for block production on the Ethereum network and can still carry out MEV.
MEV On Ethereum 2.0 Can Lead to Validator Centralization
However, the 32 ETH minimum requirement to operate an Ethereum validator is a hurdle for individual retail investors who have since opted to join staking pools. The large staking pools have more resources and have likely invested heavily in resources to increase their MEV-extraction methods.
Consequently, solo stakers with the minimum 32 ETH cannot profit from MEV opportunities, thus creating a loop whereby they also opt to join the major mining pools, further centralizing the functioning of the network to entities with more resources, such as crypto exchanges.
MEV on ETH2.0 is Not Limited to Validators
In theory, current Ethereum validators should get the full MEV because they are the gatekeepers of block production on the network. But research and observation have shown that a large portion of MEV on Ethereum 2.0 is carried out by independent network participants known as ‘searchers.’
Searchers achieve this by running complex algorithms on the publicly available blockchain data in mempools to figure out profitable MEV opportunities and have bots automatically submit profitable transactions to the network.
Validators still get to process these transactions submitted by the bots and get a portion of the MEV since the searchers are willing to pay high gas fees to increase the chances of their transactions being included in a block.
Examples of MEV by Searchers
The type of MEV by searchers is a potential problem to the smooth operations of the Ethereum network as it puts regular users, who simply want fairness in transaction processing, at a disadvantage. The practice can inconvenience traders and users of the network in the following ways.
Frontrunning attacks: Searchers can utilize their bots to scan the publicly available mempools for profitable transactions. Once detected, the bot will replicate the target transaction, replace the address and propose a higher gas fee over the other, thus frontrunning the original transaction.
Gas golfing: Transactions can be programmed to use the least amount of gas, giving searchers a competitive advantage. Common gas golfing techniques include using addresses starting with a long string of zeros (since they take less space and gas) and leaving small ERC20 balances in contracts (since it costs more gas to initialize a storage slot than to update it).
Sandwich attacks: This type of malicious frontrunning is aimed at manipulating the price of cryptocurrencies. A searcher usually scans a mempool of a decentralized exchange for a large transaction that can potentially move the price of a token. Once identified, a buy order is swiftly placed before it, followed by a quick sell order after the large trade, thus selling it at a significantly higher price and profit in a very short period.
Liquidations: Lending protocols such as Maker and Aave require users to deposit collateral which is then lent out to other users. Cryptocurrencies are prone to market fluctuations, and the value of the collateral is affected by market volatility. If the collateral value drops below a certain threshold, it results in a liquidation that instantly pays off the lenders, like margin calls in regular trading.
A liquidation usually requires the borrower to pay a hefty fee to the liquidator. Searchers benefit from the event by searching blockchain data to find which borrowers can be liquidated quickly and submit a liquidation transaction to collect the hefty fee.
DEX Arbitrage: Arbitrage is the process of buying and selling digital assets in different markets to take advantage of the different prices for the same assets. Arbitraging is common on Decentralized Exchanges (DEX), and MEV bots can pull it off more efficiently.
Effects and Benefits of MEV
The examples highlighted above shine a spotlight on the harmful effects of MEV on regular blockchain users who simply want to have their transactions processed without the inconveniences of frontrunning, sandwich attacks, paying excess gas fees to get ahead of searchers, and always keeping an eye out for searchers looking to liquidate them on lending protocols.
But MEV has some benefits in ensuring DEX users get the best and most accurate price when trading. Many DeFi protocols and DEXs rely on rational searchers seeking arbitraging opportunities. Their activities ensure minimal price deviations between the different platforms and enhance liquidity.
Some Solutions to MEV
MEV on Ethereum 2.0 has led to discussions on possible ways of mitigating it, particularly in instances of frontrunning and sandwich attacks.
One such method is the use of permissioned or private mempools, which prevent bots from accessing the critical information needed to get ahead of traders. The OMNIA protocol provides such access to private mempools on app.omniatech.io.
Another solution for MEV is a technique called proposer-builder separation (PBS), spearheaded by the team at Flashbots. PBS aims to reduce the impact of MEV at the consensus layer through the separation of the block producer and block proposer rules. Validators will still be responsible for proposing and voting blocks, but the tasks of ordering transactions and building blocks will be left to a new class of entities known as block builders.
Block builders will be responsible for creating transaction bundles and placing bids for their inclusion in a block by validators, who will now have the option of choosing the bundle with the highest fee. PBS basically creates an auction market and separates validators from the function of influencing MEV extraction, which the block builders will handle.
Implementation of PBS is taking shape through Flashbots’ recently released middleware known as Mev-Boost. It allows validators to sell their blockspace to more builders.
Mev-boost is built in collaboration with the Ethereum Foundation and client teams and is being developed as neutral infrastructure and possibly have PBS embedded in the Ethereum protocol in the near future.