Understanding the Full Picture of MEV

by Harper Li, Jinbin Xie

Preface

That’s why Sam contacted many people in the rescue operation later and fixed the contract vulnerability with the help of SparkPool. In this event, SparkPool put the executed transactions into its private mempool to prevent them from being monitored by attackers on chain. And this was also the fundamental reason that determined the distinctly different results of the two events.

These two events reveal the fact that currently blockchain is a dark forest. In fact, there are groups of arbitrage bots or attackers waiting for opportunities in this dark forest — the blockchain node network. All pending transactions waiting to be packaged are exposed to the dark forest in the mempool. Attackers can see and trace every transaction, every internal contract call, and every instruction, and perform the most common on-chain attacks, such as front-running and sandwich attacks.

We believe that the essential reason for on-chain attacks lies in the design of the blockchain.

1. The first is the design of the mempool on blockchain. All transactions that are sent out need to enter the mempool temporarily instead of being directly packaged by the miners. The mempool is full of pending transactions, and it’s public, which means anyone can monitor every transaction and every function called in the mempool. This provides the attacker with conditions to monitor transactions.

2. The second is that the blockchain block time provides execution time for attackers. According to Etherscan data, the current average block time of Ethereum is 13s.

Ethereum Average Block Time, Source: Etherscan

The concept of MEV (miner-extractable value) was first introduced in the article Flashboy 2.0 in 2019. It refers to the extra profit that miners can gain by including, reordering, inserting, or ignoring transactions. With the development of the blockchain in the past two years and the advancement of the research activities on chain, MEV has now been extended to the most extractable value.

Participants in the MEV predatory war now include miners and non-miners. Non-miners mainly refer to robots such as arbitrage/liquidation bots while miners refer to individuals who are responsible for selecting transactions and packaging them on chain. Miners enjoy privileges that are unmatched by non-miners. And we summarized the following chart to show relevant features of existing MEV predatory groups.

Summary Predatory Features, Source: Huobi Ventures

Extraction and Elimination as MEV Solutions

MEV Extraction

  • Confidential Transactions: Storing transactions in a private mempool, rather than a public mempool, to avoid being monitored by attackers.
  • FRaaS: FRaaS (Front-running as a Service) protects traders’ interests by extracting MEV from transactions and redistributing profits. At the same time, miners will abandon their attacks due to bounty rewards.
  • MEV Auction: Miners’ rights of transaction choosing and ordering are split. It means that miners still have the right to determine transaction inclusion while the third party, the winner of the auction, grants the right to reorder submitted transactions and insert their own.
Solutions of MEV Extraction, Source: Huobi Ventures

Confidential Transactions

Protocols that offer this type of services are currently Stealth Transactions of 1inch, Taichi Network, and bloXroute.

Stealth Transactions is only available in 1inch wallet for iOS client so far. And this method faces the possibility that transactions are packaged into uncle blocks and thus made public.

Created by SparkPool, Taichi Network allows users to send transactions directly to the private mempool of SparkPool through the interface it provides. Since SparkPool does not webcast this transaction, the status of this transaction sent out cannot be visible on Etherscan until the transaction is officially confirmed.

bloXroute provides a private communication function, which means transactions can be sent directly to the miners without being exposed.bloXroute’s BDN (Blockchain Distribution Network) links the blockchain nodes to the BDN through its Gateway. Gateway and the blockchain nodes first translate the information coming from the blockchain into the BDN. Then, at the second layer, they perform block compression. Reducing the block size greatly makes it more efficient to send or transmit in the Blockchain Distribution Network.

MEV Auction — — Optimism

When talking about MEVA, it is important to explain two major rights that miners have as the biggest winner in the MEV predatory war, the rights of transaction inclusion and transaction ordering. Technically, the auction is able to extract MEV from miners by separating these two rights: 1) transaction inclusion; and 2) transaction ordering. Miners retain the right to determine transaction inclusion, but they can’t order transactions. And the third party, called a “sequencer”, determines transaction ordering. Then the miner picks a single sequencer in the auction process.

MEVA Flow-Process Diagram, Source: ethresear.ch

In the Optimism L2 system, the role of miners (a validator and a sequencer) is divided into two parts: Sequencers manage the transaction sequencing and validators add it to the Optimism L2 blockchain. This solution fits Layer 2 because Sequencers already exist on the L2 architecture. The transaction is submitted to the “Sequencer”, which generates a signed receipt that guarantees the execution and sequencing.

However, there are still problems with MEVA:

  • The collusion between sequencers and sequencers’ own misbehavior can result in artificially low auction prices. The current solution to this problem is to develop open source sequencer software to increase the ease of user participation in sequencer bidding activities.
  • It is impossible to completely avoid miners to retain two rights because sequencers can set up their own mining pools.

FRaaS

Flashbots

• Flashbots Auction: a private communication channel between miners and searchers.

• Flashbots Data: detect MEV data; specific products are MEV-Explore and Dashboard. MEV-Explore crawls the Ethereum blockchain and classifies MEV transactions over 8 major DeFi protocols.

• Flashbots Research: an open, transparent and collaborative research effort to tackle short and long term research questions related to MEV.

Flashbots Auction consists of MEV-GETH, a patch on top of the go-ethereum client, along with the mev-relay, a transaction bundle relayer.

There are three main roles: searcher, relayer, and miner. The information transmitted between the three roles is the Flashbots Bundle. Each bundle transaction includes a transaction list (indicating that the sender wants to pack multiple consecutive on-chain transactions, including front-running and back-running ones), block height, min Timestamp and max Timestamp.

Searchers

The sender needs to pay certain fees to the miner when sending the transaction. Fees here are not paid by gas, but through Coinbase ETH transaction to the block producer (ie the mining pool) as a commission. It allows searchers to save money from avoiding paying gas fees for failed transactions considering its pitfalls of being attacked.

Relayers

In addition to privately transmitting bundle transactions, relayers also serve as a mitigation to DOS threat. Since searchers no longer need to pay for failed bids, it may appear that searchers can submit bundles at their own will. That is to say, it opens up the ability for them to spam the network with invalid bundles, thus creating a denial of service attack against other network participants. Since Ethereum nodes are ill-equiped to deal with overload on their own, relayers primarily serve as a mitigation to this DOS threat.

Miners

Miners can only pack one bundle per block. To maximize their own profits, miners will choose the bundle with the highest tips paid by searchers. But it is reported that Flashbots now has plans to develop the service of packaging multiple bundles in one block.

Likewise, not all miners can be trusted. After being exposed to the contents of the bundle, miners can analyze, reorder or add transactions to extract MEV.

ArcherDAO

Archer Relay

Archer Swap

ArcherDAO uses Flashbots to realize anti-MEV, but it is still different from Flashbots.

ArcherDAO’s products clarify the roles of searchers and traders. Archer Relay forwards bundle for searchers and the task of searchers here is to search for MEV extraction opportunities in each DEX. While Archer Swap is aimed at traders seeking MEV shields, who conduct transactions on Archer Swap. The differentiation of the roles of searchers and traders is reflected in the following two facts. Firstly, Archer Relay searchers cannot access transactions published through Archer Swap, and only the back-running bots inside ArcherDAO can. Secondly, they have different mining pool partners: ArcherDAO has now announced partnership with 2miners and Ezil while Flashbots’ March report stated that it has cooperated with 12 mining pools.

mistX by alchemist

mistX also uses Flashbots to protect user-initiated transactions from being sent to the public mempool. And these transactions are bundled together to enter the Flashbot system. In addition, the sandwiched.wtf developed by the team can be used to query whether a smart contract account has been subjected to sandwich attacks.

KeeperDAO

KeeperDAO also believes that swap definitely produces slippage, meaning that attackers can cause losses to traders by front-running or back-running attacks. And since the transaction is exposed in the mempool, it is easy to cause multi-party competition or “bidding” between the two parties, thus triggering a Gas War.

For these two situations, KeeperDAO believes that traders can work together with Keepers. The solution is that the trader first submits the transaction to KeeperDAO, and then the Keeper in KeeperDAO analyzes the transaction and judges whether it is profitable through front-running or back-running strategies. If it is a “Yes”, the Keeper will execute the transaction according to the transaction sequence pre-defined by the platform to obtain profits. The profits obtained need to be returned to KeeperDAO for daily profit aggregation and distribution.

For traders, they get a better price in transactions, because the traders’ trading slippage can be offset by $ROOK minted on the platform. It can be seen that the cooperation between traders and Keepers has created a “win-win” solution.

In the entire transaction system, the KeeperDAO sequence occurs once every 100 blocks, and the sequencing result determines the transaction sequence of existing Keepers. Due to the sequenced transactions, Keepers can avoid the Gas War. However, Keepers within KeeperDAO still need to compete with traders outside of KeeperDAO.

BackRunMe by bloXroute — MEV’s profit distribution

The detailed implementation is as following:

1. bloXroute sends metadata to searchers to propose backrunning transactions.

2. Searchers create and send bundles based on the transactions, and bloXroute examines the searchers’ replies.

3. bloXroute sends the first valid and most profitable “backrunning” MEV bundle to pools via private communication for execution.

4. Of course, if searchers find that there is no opportunity for backrunning, the transaction will become an ordinary private transaction and be sent to the miners.

Others

MiningDAO

As shown in the figure below, the protocol regards competing for the next block as the order market DEX, and each user can submit a block for packaging, and it is the order object, which constitutes the block order market DEX. The cost paid by users is the reward attached to each block order, and miners select the block order with the highest reward from this market. Once transactions are completed, miners will package the block order provided by the user on the chain, and get the reward paid by users.

BackBone Cabal

The Advantages and Disadvantages of MEV Extraction

MEV Elimination

How to minimize or organize MEV? The so-called MEV refers to a measure of the profit a miner (or validator, sequencer, etc.) can make through their ability to arbitrarily include, exclude, or re-order transactions within the blocks they produce. Therefore, the anti-MEV protocols on the market try to take measures when the transaction is submitted to the mining pool. Currently, the following four methods have been summarized:

  • On-chain operation
  • Off-chain operation
  • Encryption
  • A new transaction mode

On-Chain Operation

Chainlink

LibSubmarine

Veedo

Off-Chain Operation

Automata

Arbitrum

Vega Protocol

Encryption

Sikka

Shutter Network

A New Transaction Mode

Comparison About MEV Elimination Schemes/Protocols

The Advantages and Disadvantages of MEV Elimination

1. Use the third-party notary organization of L2 to publicize and mark the determined transaction sequence on the entire network. The greater the degree of publicity, the harder it is to be tampered with. However, different DeFi protocols are required to support the notarization result.

2. Hide the transactions that are easy to be arbitraged in the dark forest by encrypting them, thus making it impossible for arbitrageurs to track them. However, the resource consumption caused by the encryption and decryption of transactions leads to the loss of transaction experience, which is also a factor that needs to be considered.

3. The Paradigm shift arises in the new transaction mode, but the mode still needs to be tested by the market to see if it can be successful.

Conclusion

At present, the MEV captured by Flashbots only covers 8 protocols, and the MEV identified on each protocol is also limited to the types that can be extracted by front-running/back-running/sandwiching. Flashbots’ study of MEV has deepened users’ understanding of blockchain. Users begin to understand the risk-return structure corresponding to their actions on the blockchain. In turn, they develop and improve protocols to make the blockchain more valuable in use.

This article shallowly summarizes various solutions available on the market for MEV, and splits them into two camps. First of all, MEV extraction doves aim to realize the fair distribution of rights, but it is difficult to avoid the situation that “he who fights with a monster willeventually become a monster.” Then MEV elimination hawks tell another story. It is better to use encryption to realize the cross-dimensional compression of power rent-seeking rather than to sneak into the dark forest and retransfer rights.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Huobi Ventures

Focus on Huobi’s venture investment portfolio and supporting innovative blockchain projects through long-term strategies. Twitter:@HuobiVentures