ChainLinkGod Podcast - Exploring Miner Extractable Value (MEV) with Pmcgoohan
Primer: ChainLinkGod and Crypto Oracle interviews Pmcgoohan, who first raised up the issue of Miner Extractable Value (MEV) in year 2014. In this episode, they discuss what is MEV, its examples, its negative impact on Ethereum users, and some possible solutions to the problem.
Pmcgoohan's Background
Analyst Coder
Worked for various scientific bodies, corporations, and financial firms
Doing algorithmic trading by writing his own code. Done it for 20 years in highly adversarial market environments
Predicted MEV would occur way back in 2014. Called it miner frontrunning back then
Bringing The Topic Of MEV Up In 2014
A mixture of opinions
Some understood it straight away
Others said that it will get sorted out later
How Did He Know MEV Will Become An Issue
Heard about Ethereum before its launch. Looked at the draft documents and realized that block creation was largely borrowed from Bitcoin
For Bitcoin, transaction order does not matter because people are not accessing a shared resource. Therefore, Satoshi did not have to solve fair ordering
In Ethereum, there is a competition for accessing a shared resource with other participants. Most smart contracts are shared resources. This opens it up to exploits and attacks
Definition Of MEV
"MEV is the profit to be made from reordering and censoring transactions." - P Mcgoohan
Content of each block is chosen by just one miner. This gives them the freedom to frontrun and exploit transactions
What MEV is not:
Making money through block rewards
Making money through gas fees
Latency arbitrage
Cross-chain arbitrage
Examples Of MEV
Frontrunning: Attacker sees a victim's transaction, inserts their transaction in front of it, and profits
Sandwich Attack: Attacker frontrun to open a trade, and then the victim's transaction in the middle, and the attacker back around to close out
Arbitrage: Profiting from the price difference of the same asset across different markets
Liquidations: A kind of application-specific frontrunning or backrunning
When Miners Replace The Arbitrage With Their Own Transaction, Is It MEV Or Arbitrage?
Have to carefully distinguish between arbitrage and MEV
At this moment, replacing arbitrage transactions with the miner's own transaction is done as a form of MEV
Frontrunning Liquidity Provisioning On Uniswap V3
ChainLinkGod shares about an interesting case he has observed
Person saw an incoming trade on Uniswap V3
Before the trade, they added liquidity at a particular price range of the incoming trade
Trade occurs and the person got all of the fees
Withdrew liquidity afterwards
Are There Good And Bad Forms Of MEV?
No, they are all bad
Both frontrunning and backrunning are equally bad
He would argue that MEV potentially reduces market efficiency because the victim is forced to overpay
"You know, even the greatest MEV apologists sort of agree that there's no price discovery going on, there's no greater market efficiency that comes out of it [MEV]. Value is taken without concern from the victim transaction, and no information is transferred to the market in return." - P Mcgoohan
Wrote his own code to analyze Ethereum and found that ~43% of all MEV includes frontrunning, backrunning, and sandwich attacks
Some argue that latency arbitrage is a good form of MEV. In TradFi, there could be the same asset trading at different prices across two different exchanges (e.g. NASDAQ and London Stock Exchange). In such cases, arbitrage aids in price discovery
However, in Ethereum, you cannot do latency arbitrage. Miners do not order transactions by time, but by their self-interest. They could rearrange transactions if it benefits them
"Miners are in control of time on Ethereum. They warp time to their advantage. It's a way that you can put it they control time, they're time lords." - P Mcgoohan
Relevant to liquidations as well. A user could try to add collateral to avoid liquidation but an attacker could censor that transaction in order to liquidate the victim and take the reward
Can only have good MEV if all transactions are fair. However, at that point, it is no longer called MEV but latency arbitrage
MEV And The Long-Term Success Of Ethereum
Extrapolating from the ratio of trade volume and global adoption of Ethereum, MEV would cost around $2 trillion per annum. Nobody would tolerate this cost
As Ethereum use cases expands, the attack vectors for MEV increases
Example of MEV in an open marketplace:
Send shopping list as transaction to the blockchain
Local grocery store can offer you the best price
Megacorp pays the MEV auction winner and censors everyone's transactions but their own
Local grocery store closes down
"I think that the thought experiment of a megacorp stepping in and using MEV to enact their monopolistic policies is like the anti-thesis of what a blockchain was supposed to be in the first place." - ChainLinkGod
Have to fix MEV at the base layer
MEV Auctions
Solves the transaction bloat that comes from gas price auctions
MEV auctions are not a solution to MEV extraction. They actually maximize the extraction of MEV
Did research and found that people with the most money/resources win MEV auctions
If MEV is solved, there is no use for MEV auctions anymore
Best Way To Get Your Transaction Included Quickly?
Some examples of getting your transaction included quickly:
Put a high gas price to bribe the miner
Put a minimal gas price in and hope that the MEV value of your transaction is enough to bribe the miner
Create a flashbots bundle and bid directly
Use an aggregator to bid directly
Possible Solutions For MEV
In a decentralized network, blocks are validated and propagated by consensus
However, at that last critical millisecond, the network gives all the power to one miner to choose transactions for that block. During this exact point, Ethereum is centralized
Instead of allowing only one miner to choose what the content of that block should be, he suggests that block creation should be decentralized
Proposes content layer solutions: chunk up pending transactions as they arrive at the mempool. If this is done quickly enough, transactions end up being batched together and ordered by time. This is the 1st step to fair ordering
Content layer solutions reduces MEV. It does not eliminate it
L2s, Oracle Networks, And MEV
L2s
L2s need to have fair ordering of transactions as well
Important to have their own validators to prevent censorship by an attacking MEV auction winner
Users could send encrypted transactions to the mempool and a timelock encryption mechanism could be set to decrypt transactions once they have chunked up. This allows transaction order to be fixed and solves MEV
One threat to fair ordering is collusion. Some nodes could be bribed to send a certain transaction order
Oracle Networks
There will be a lag (because previous transactions are already batched together), but oracle updates will be processed in the correct time order
Transactions that were submitted before an oracle update will be processed before the oracle update; transactions submitted after an oracle update will be processed after
"In the Ethereum miner/validator community, you know, you don't kind of go, oh, I trust blocks from this miner. That doesn't really happen. So if you've got a mechanism [Chainlink Oracle Network] that works for allowing reputation to be used in that way, that I think that can be really powerful." - P Mcgoohan
Oracles do not just deliver data. They are generalized off-chain agents who can be hired to do hybrid tasks involving off-chain systems like the mempool
EIP-1559 And MEV
Could consider not burning all the base fee and give some of the base fee to the miner to recompensate them
For Eth 2, there's no need to pay validators as much as they are not doing as much work as miners in proof of work
EIP-1559 benefits the content layer solution he proposes. It would work on the base fee for EIP-1559
Visibility Of MEV To The Community
MEV Explorer does a good job in visualizing MEV
Could be improved to display the different types of attacks
Need more visibility so that people realize how much they are losing from MEV and treat it as a priority
Community Response To MEV
Fatalistic response of MEV is inevitable and there's nothing that can be done about it. He does not see any academic or theoretical basis for this position
The double spending problem used to be thought of as unsolvable, but was eventually solved using the blockchain. MEV could be similarly solved as well
Devs are currently focused on solving scalability. MEV will most probably be the next issue they tackle after solving scaling
Last Words To Listeners
"Take MEV seriously. Left unfixed, it is an existential threat to Ethereum but don't be paralyzed by fear and fatalism. You know, at the end of the day, MEV is just a vulnerability. And we're developers, and we fix vulnerabilities in our software. It's what we do." - P Mcgoohan
All information presented above is for educational purposes only and should not be taken as investment advice. Summaries are prepared by The Reading Ape. While reasonable efforts are made to provide accurate content, any errors in interpreting and summarizing the source material are ours alone. We disclaim any liability associated with the use of our content.