Halborn Logo

// Blog

Blockchain Security

Understanding Miner Extractable Value (MEV)


profile

Rob Behnke

April 8th, 2022


Blockchains are designed to be decentralized systems.  There is no organization that owns the servers that do all of the work of storing and maintaining the blockchain like there are in traditional systems like Google, Facebook, etc.

Instead, a network of blockchain nodes is responsible for building blocks from sets of transactions, storing a copy of the ledger, verifying that transactions are valid (no spending money you don’t have, etc.), and, in the case of smart contract platforms, running the code.

However, these nodes don’t do this for free.  Whichever node is selected to create the next block in the blockchain is paid for their work, and the amount of this reward can vary.  Miner Extractable Value – also known as Maximal Extractable Value or MEV for short – refers to the ability of block miners and validators to maximize their profits by taking full advantage of their power.

Extracting Value From Block Creation

In blockchain, the miner/validator that creates a given block has full control over the contents of that block.  A block producer can choose to include (or exclude) any valid transaction in a block and can choose how those transactions are organized within the block.

This is significant because, in some cases, the order of transactions matters.  The most common case is for buys/sells on a DeFi project where the order of transactions affects the price at which an order is performed.  Whichever of two transactions is processed first can gain favorable terms, buying lower or selling higher, providing a profit for the user.

Since blockchain transactions are not “first come first served,” there needs to be a mechanism to determine the ordering of transactions within a block.  While every transaction carries a minimum transaction fee to pay for the block producer’s efforts, transaction creators can pay extra for priority.  In some cases, such as a favorable trade, paying more gas can make sense if a user can generate an even higher profit.

This produces the opportunity for block producers to make a profit beyond the minimum for a block full of transactions.  By organizing the transactions within their blocks to include the most valuable transactions first, block producers maximize the profits that they extract from their block.

How MEV Affects the Blockchain

The ability to influence transaction ordering for profit has resulted in numerous MEV bots scanning the blockchain for opportunities to exploit.  These bots may have positive impacts, such as correcting price differentials between different DEXs, quickly liquidating bad loans, and, in some cases, mitigating the effects of hacks.

However, MEV and its exploitation also have their downsides.  Fights between bots over MEV opportunities can add to congestion and drive up the price of performing transactions.  Some MEV exploitation opportunities also directly harm the user experience by decreasing the value of trades.

As long as transactions are ordered within blocks based on transaction fees, MEV and its exploitation will remain.  This can be profitable for miners and bot operators, harmful for users, and a mix of good and bad for the blockchain.