20.09.2022
in-depthEthereumTechnical Basics

in-depthEthereumTechnical Basics
Main
- Maximum Extractable Value (MEV) is a way for miners or validators to earn extra profit by reordering transactions before a new block is approved on the network.
- MEV is used to increase network fees at the expense of additional user costs, often associated with transactions in decentralized applications. In particular, miners or validators try to get into an arbitrage position in such a way that the user pays an additional fee unaccounted for before sending the transaction. MEV is considered bad practice.
- Initially, MEV appeared in Ethereum and EVM-compatible networks. Flash bots have become one of the effective solutions to combat this problem.
- According to experts, the transition to Proof-of-Stake (PoS) will not rid Ethereum of MEV, but will lead to the division of validators into professional categories, the emergence of different types of blocks and the creation of long-term strategies based on MEV.
How MEV works
As you know, the blocks recorded in the blockchain are immutable information and cannot be rewritten. However, miners or validators can include, exclude, and reorder transactions in a future block at their discretion before they are confirmed.
Every unconfirmed transaction first goes into the public mempool. Next, the miners choose which transactions they will add to the block from the mempool. This is how miners form the most profitable combination of user transactions for themselves.
This leads to abuse. Miners (and after the transition of Ethereum to PoS – validators) prefer transactions of the largest size, building priority from largest to smallest, and add them to the future block, which will be recorded on the blockchain.
This feature led to the creation of a mechanism for extracting benefits by substituting transactions in the right order. This practice is called maximum recoverable value, or MEV.
MEV’s strategy is for validators to look for speculative transactions based on existing unconfirmed transactions and increase the actual fees for their execution.
Let’s look at an example where an Ethereum user decided to exchange 10,000 USDC for ETH at a price of $2,000 per coin for DEX in the USDC/ETH liquidity pool. Here’s what happens after you place a trade request:
- The mempool runs special bots that monitor unconfirmed transactions and collect various data from DeFi applications, including price and liquidity volumes.
- Upon noticing the user’s intent to buy ETH, the bots will initiate an operation that will increase the price right before the user’s transaction is executed. For example, a bot can add more USDC to the USDC/ETH liquidity pool to increase the price of ETH.
- Thus, the expected price of $2,000 per ETH coin, which the user was counting on, will change to the conditional $2,500 per ETH coin. The transaction will be completed: instead of 5 ETH, the user will receive only 4 ETH. The profit of the initiator of this MEV operation will be 1 ETH minus the cost of commissions.
Because MEV results in higher fees for the user, it is also referred to as an “invisible tax”, which is not unique to Ethereum.
When the “invisible tax” MEV appeared
For the first time, the problem of “substitution” of user transactions, called MEV today, was raised by on reddit algorithmic trader and analyst at Pmcgoohan in 2014, before the launch of the Ethereum mainnet. He suggested that miners, without violating any consensus rules, can manipulate users’ transactions for their own selfish purposes.
The term MEV was only put forward in 2019 in a paper Flash Boys 2.0which was the first public publication to investigate the severity of the problem described by Pmcgoohan.
The scale and severity of the problem were only discussed in 2020 in articles such as “Ethereum is a dark forest” And “Escape the Dark Forest”written by Dan Robinson, Georgios Constantopoulos and crypto investor Samczsun. These posts were aimed at informing Ethereum users about the “invisible tax” being collected from users.
Varieties of MEVs
The development of the decentralized finance (DeFi) sector and individual elements of the Ethereum ecosystem, in particular price oracles, liquid tokens and cross-chain bridges, has led to the emergence of various MEV strategies.
Frontrunning
The most common strategy is to try to put the MEV transaction before the original transaction. Special bots can track potentially profitable transactions by simply copying user transactions, acting proactively.
Backscreening
Issuing a transaction due to some event. For example, immediately after the appearance of a new pool on Uniswap, the exploiter can buy back a significant part of the tokens and take the first place in the queue, emptying the pool. After that, he allows the rest of the participants to sell and sells himself at a better price.
sandwich attack
Combination of the two previous schemes. If the bot finds a large buy order in the mempool, it places its order in front of it in order to purchase tokens at a lower price using front-running. A large order is executed, moving the price up. Then, using backscreening, the coins are sold at a profit before other users.
liquidation
A strategy aimed at making a profit for the validator by buying back the collateral position in the lending protocol immediately after its liquidation. The user sees that the position can be liquidated in the next block and sends a transaction to redeem the collateral.
“Uncle bandit attack” (Uncle bandit attack)
A complex kind of MEV strategy based on a speculative chain of transactions found in a competing block. There are times when miners find two blocks at the same time. At this point, miners can use the data from the “neighboring” block to their advantage.
Time bandit attack
It involves the process of reorganization of previous blocks, where miners specifically offer competing blocks containing other transactions. Causes transactions to disappear and be included in a completely different block.
Methods of protection against MEV and flash bots (Flashbots)
MEV is not unique to Ethereum. As the DeFi application sector matures and competition intensifies, bots have moved to EVM-compatible blockchains such as Polygon and BNB Chain. However, it was Ethereum that became the most advanced network in terms of dealing with this problem.
According to 2021 data, Ethereum miners earned $730 million in rewards for extracting MEVs – 4.3% of the total annual revenue. This indicates the growth of “dishonest markets” and leads to a deterioration in user experience due to the growth of commissions and the lack of predictability in the process of executing transactions.
As a solution, a centralized system appeared in 2020 Flashbotsfunded by venture capital firm Paradigm. It does not seek to eliminate the problem, but rather to bring it under control by creating an open market through the development of a public auction of ETH transactions.
The solution quickly gained popularity. By information research division of the BitMEX crypto exchange, in May 2022, more than 90% of the miners on the Ethereum network were connected to the Flashbots server. The researchers noted that 63% of the rewards for MEV transactions went to operators, while the remaining 37% went to miners.
What will change after the transition of Ethereum to PoS
Experts believe that changing the consensus algorithm in Ethereum will not change the basic principles of creating blocks on the network. As in the case of mining, validators are left with the ability to “assemble” blocks from transactions at their discretion.
At the same time, according to the company block native, many non-professional node operators will appear in Ethereum. This could lead to the emergence of a separate category of participants from among the validators in Ethereum called “Block Builders”. They will provide the service of the most profitable grouping of blocks, helping to maximize profits and optimize the network.
As a result, different types of blocks will appear in Ethereum depending on the needs of validators:
- Blocks with the maximum number of MEV transactions;
- Blocks with MEV are for charitable purposes only;
- Blocks with certain gas prices;
- Blocks sorted by time;
- Blocks put up for auction;
- Blocks with censorship;
- Blocks without censorship.
It is also expected that due to the specifics of the “epoch” (the procedure for selecting validators and creating a new block), MEV operators will know in advance which validators will propose the next block. This can lead to the creation of completely new, long-term MEV strategies.
Developer Elias Simos, who studied the first 24,500 blocks after The Merge, concluded that 18% of them were mined using a modified mechanism called MEV Boost. As a result, PoS validators were able to get 122% more profit, and the blocks they formed contained 41.4% more transactions.
Despite the results of using MEV by validators, it is still difficult to assess the economic and other possible consequences of using MEV strategies on ordinary users.
Found a mistake in the text? Select it and press CTRL+ENTER
Cryplogger Newsletters: Keep your finger on the pulse of the bitcoin industry!
20.09.2022
in-depthEthereumTechnical Basics

in-depthEthereumTechnical Basics
Main
- Maximum Extractable Value (MEV) is a way for miners or validators to earn extra profit by reordering transactions before a new block is approved on the network.
- MEV is used to increase network fees at the expense of additional user costs, often associated with transactions in decentralized applications. In particular, miners or validators try to get into an arbitrage position in such a way that the user pays an additional fee unaccounted for before sending the transaction. MEV is considered bad practice.
- Initially, MEV appeared in Ethereum and EVM-compatible networks. Flash bots have become one of the effective solutions to combat this problem.
- According to experts, the transition to Proof-of-Stake (PoS) will not rid Ethereum of MEV, but will lead to the division of validators into professional categories, the emergence of different types of blocks and the creation of long-term strategies based on MEV.
How MEV works
As you know, the blocks recorded in the blockchain are immutable information and cannot be rewritten. However, miners or validators can include, exclude, and reorder transactions in a future block at their discretion before they are confirmed.
Every unconfirmed transaction first goes into the public mempool. Next, the miners choose which transactions they will add to the block from the mempool. This is how miners form the most profitable combination of user transactions for themselves.
This leads to abuse. Miners (and after the transition of Ethereum to PoS – validators) prefer transactions of the largest size, building priority from largest to smallest, and add them to the future block, which will be recorded on the blockchain.
This feature led to the creation of a mechanism for extracting benefits by substituting transactions in the right order. This practice is called maximum recoverable value, or MEV.
MEV’s strategy is for validators to look for speculative transactions based on existing unconfirmed transactions and increase the actual fees for their execution.
Let’s look at an example where an Ethereum user decided to exchange 10,000 USDC for ETH at a price of $2,000 per coin for DEX in the USDC/ETH liquidity pool. Here’s what happens after you place a trade request:
- The mempool runs special bots that monitor unconfirmed transactions and collect various data from DeFi applications, including price and liquidity volumes.
- Upon noticing the user’s intent to buy ETH, the bots will initiate an operation that will increase the price right before the user’s transaction is executed. For example, a bot can add more USDC to the USDC/ETH liquidity pool to increase the price of ETH.
- Thus, the expected price of $2,000 per ETH coin, which the user was counting on, will change to the conditional $2,500 per ETH coin. The transaction will be completed: instead of 5 ETH, the user will receive only 4 ETH. The profit of the initiator of this MEV operation will be 1 ETH minus the cost of commissions.
Because MEV results in higher fees for the user, it is also referred to as an “invisible tax”, which is not unique to Ethereum.
When the “invisible tax” MEV appeared
For the first time, the problem of “substitution” of user transactions, called MEV today, was raised by on reddit algorithmic trader and analyst at Pmcgoohan in 2014, before the launch of the Ethereum mainnet. He suggested that miners, without violating any consensus rules, can manipulate users’ transactions for their own selfish purposes.
The term MEV was only put forward in 2019 in a paper Flash Boys 2.0which was the first public publication to investigate the severity of the problem described by Pmcgoohan.
The scale and severity of the problem were only discussed in 2020 in articles such as “Ethereum is a dark forest” And “Escape the Dark Forest”written by Dan Robinson, Georgios Constantopoulos and crypto investor Samczsun. These posts were aimed at informing Ethereum users about the “invisible tax” being collected from users.
Varieties of MEVs
The development of the decentralized finance (DeFi) sector and individual elements of the Ethereum ecosystem, in particular price oracles, liquid tokens and cross-chain bridges, has led to the emergence of various MEV strategies.
Frontrunning
The most common strategy is to try to put the MEV transaction before the original transaction. Special bots can track potentially profitable transactions by simply copying user transactions, acting proactively.
Backscreening
Issuing a transaction due to some event. For example, immediately after the appearance of a new pool on Uniswap, the exploiter can buy back a significant part of the tokens and take the first place in the queue, emptying the pool. After that, he allows the rest of the participants to sell and sells himself at a better price.
sandwich attack
Combination of the two previous schemes. If the bot finds a large buy order in the mempool, it places its order in front of it in order to purchase tokens at a lower price using front-running. A large order is executed, moving the price up. Then, using backscreening, the coins are sold at a profit before other users.
liquidation
A strategy aimed at making a profit for the validator by buying back the collateral position in the lending protocol immediately after its liquidation. The user sees that the position can be liquidated in the next block and sends a transaction to redeem the collateral.
“Uncle bandit attack” (Uncle bandit attack)
A complex kind of MEV strategy based on a speculative chain of transactions found in a competing block. There are times when miners find two blocks at the same time. At this point, miners can use the data from the “neighboring” block to their advantage.
Time bandit attack
It involves the process of reorganization of previous blocks, where miners specifically offer competing blocks containing other transactions. Causes transactions to disappear and be included in a completely different block.
Methods of protection against MEV and flash bots (Flashbots)
MEV is not unique to Ethereum. As the DeFi application sector matures and competition intensifies, bots have moved to EVM-compatible blockchains such as Polygon and BNB Chain. However, it was Ethereum that became the most advanced network in terms of dealing with this problem.
According to 2021 data, Ethereum miners earned $730 million in rewards for extracting MEVs – 4.3% of the total annual revenue. This indicates the growth of “dishonest markets” and leads to a deterioration in user experience due to the growth of commissions and the lack of predictability in the process of executing transactions.
As a solution, a centralized system appeared in 2020 Flashbotsfunded by venture capital firm Paradigm. It does not seek to eliminate the problem, but rather to bring it under control by creating an open market through the development of a public auction of ETH transactions.
The solution quickly gained popularity. By information research division of the BitMEX crypto exchange, in May 2022, more than 90% of the miners on the Ethereum network were connected to the Flashbots server. The researchers noted that 63% of the rewards for MEV transactions went to operators, while the remaining 37% went to miners.
What will change after the transition of Ethereum to PoS
Experts believe that changing the consensus algorithm in Ethereum will not change the basic principles of creating blocks on the network. As in the case of mining, validators are left with the ability to “assemble” blocks from transactions at their discretion.
At the same time, according to the company block native, many non-professional node operators will appear in Ethereum. This could lead to the emergence of a separate category of participants from among the validators in Ethereum called “Block Builders”. They will provide the service of the most profitable grouping of blocks, helping to maximize profits and optimize the network.
As a result, different types of blocks will appear in Ethereum depending on the needs of validators:
- Blocks with the maximum number of MEV transactions;
- Blocks with MEV are for charitable purposes only;
- Blocks with certain gas prices;
- Blocks sorted by time;
- Blocks put up for auction;
- Blocks with censorship;
- Blocks without censorship.
It is also expected that due to the specifics of the “epoch” (the procedure for selecting validators and creating a new block), MEV operators will know in advance which validators will propose the next block. This can lead to the creation of completely new, long-term MEV strategies.
Developer Elias Simos, who studied the first 24,500 blocks after The Merge, concluded that 18% of them were mined using a modified mechanism called MEV Boost. As a result, PoS validators were able to get 122% more profit, and the blocks they formed contained 41.4% more transactions.
Despite the results of using MEV by validators, it is still difficult to assess the economic and other possible consequences of using MEV strategies on ordinary users.
Found a mistake in the text? Select it and press CTRL+ENTER
Cryplogger Newsletters: Keep your finger on the pulse of the bitcoin industry!