Flashbots is an organization that wants to democratize MEV (Maximum Extractable Value) opportunities. In practice, this means that ordinary users who transact on Ethereum have ‘mempool privacy’ and pay a lower fee for their transactions. How does Flashbots work and how can you use it?
Ethereum is much more complex than Bitcoin because of all its possibilities of smart contract transactions. That is why selecting and ordering transactions into blocks has become a science (or art) that only few master. Those who do it well can extract a lot of fees by, for example, front-running trades. This requires a bit more explanation of what MEV is.
Maximal Extractable Value (MEV) is the potential profit that Ethereum validators can scoop up adding blocks to a blockchain. They can maximize the money they make from block creation by reordering transactions within blocks and even insert new ones. It’s a form of legal insider trading. Why insider trading? After all, the mempool (waiting line of transactions) is public, right? Well, theoretically, it is indeed open to anyone. But only few experts have the advanced skill set of how to interpret and benefit from these data. These experts make the profits.
As someone has to pay for these advanced traders’ profits, we can view MEV as a tax on users. The Ethereum community is working hard on a new and more fair system of MEV. Flashbots arose from this ambition. It is by far the biggest player in this new, ‘corporate’ MEV industry: it has 80% market share.
Flashbots aims to solve the following problems related to MEV:
- Unfair distribution of MEV profits to insiders only (the insiders being the people who can read and execute code)
- Clogging of the Ethereum blockchain, by all the MEV transactions
How does Flashbots Work?
What is the main invention of Flashbots? Instead of passing through the public mempool, transactions go to a relayer, where they are not visible to the public. The relayer sends candidate blocks to the validator (proposer), who can pick one. The validator can’t see the transactions; it only sees how profitable different blocks are. This process is detailed in the section below.
What are Flashbots Auctions?
Flashbots Auctions are a new way to get from candidate transactions to a new block on the Ethereum blockchain. Privacy (an invisible mempool) is key.
Architecture of Flashbots auctions (source: flashbots.net)
The searchers in this architecture are any Ethereum users that want privacy for their transactions. For example, Uniswap traders who want to be protected against frontrunning. Searchers can also be bot operators/ bots that want to do arbitrage trading.
- Searchers send their bundles (transactions) directly to block builders, meaning NOT via a publicly accessible mempool. Why are they called bundles? Because in many cases, traders want to make sure a series of transactions is executed in a specific order, in a single block.
- The builders are specialists in building blocks that are profitable.
- The relayers escrow these blocks, forwarding the profit that can be made without showing the content of the blocks. As a final step before validators (proposers) propose a block to the Ethereum blockchain, MEV-boost is the step where the most profitable blocks from each relayer are compared (see image below).
- With MEV-Boost, validators can access blocks from a marketplace of builders.
- In the final step of MEV-boost, validators can access blocks from a marketplace of builders. It is run by validators.
The path from relays to inclusion in the Ethereum blockchain (source: flashbots.net)
MEV-boost was built by Flashbots as an implementation of proposer-builder separation (PBS), the future Ethereum consensus mechanism that will isolate the building of blocks from transaction validation.
Advantages of Flashbots
Ok, let’s now get practical and highlight two benefits of Flashbots, by taking the example of NFT drops. NFT drops that are highly anticipated lead to gas wars, where normal users and bots scramble to outbid each other. How does participating in these drops through Flashbots help?
- The Flashbots architecture guarantees transaction privacy. You don’t want a bot to see your proposed gas price, and have it simply place a slightly higher bid.
- In Flashbots, there is no longer any risk of paying gas fees for transactions that don’t get through. Too often in the past, aspiring buyers of NFT drops have had to pay tons of gas (hundreds of dollars or more of ETH) without getting their hands on the desired NFT.
How to use Flashbots
Anyone can use Flashbots by adding the so-called Flashbots Protect RPC (Remote Procedure Call: a set of protocols that allow a client like MetaMask to interact with – for example – Ethereum.) to their wallet. This won’t change your transaction experience much and you can still check the status of your transaction on Etherscan. But behind the scenes, your transactions will skip the public mempool where hungry predators (searcher bots) are lurking.
Flashbots will determine for you if your transaction requires the Flashbots treatment or not. Why not, possibly? In some cases, there is no downside of sending your transaction directly to the mempool, which Flashbots will do in that case. This will save you time.
In general, you won’t need to choose a higher gas price than normal.
What is Flashbots Protect API?
Flashbots Protect API is an easy-to-use API that developers can integrate into their applications. Their users can then have their transactions sent to the Flashbots Network. The API abstracts away from the complexity and specificity that Flashbots also allows. For example, users are allowed to be very specific about their transactions: they can pick the exact block number that they want their transaction included in. The average developer or user might not want to be bothered by this.
How to Use Flashbots in MetaMask
To add Flashbots Protect RPC endpoint in MetaMask, follow these steps:
- Click on your RPC endpoint at the top of your MetaMask. By default it is set on Ethereum mainnet.
- Click “Custom RPC”
- Add https://rpc.flashbots.net with a chainID of 1 and currency of ETH.
- Click Save
(image source: flashbots.net)
You can now trade through Flashbots on any decentralized exchange. For more detailed info, go to the quick start documentation on the Flashbots website.
Problems with Flashbots
The whole point of Flashbots was that MEV would become a free market. But, for a free market, there are currently too few players and too many black boxes. In other words, as Flashbots itself admits, there are currently centralization and trust issues with the architecture. It aims to solve these.
What issues are there currently? For example, the builders. ‘Builders have full view of incoming transactions, which gives them the power to frontrun, censor, etc.’ A similar issue exists with relays. There are only a handful of relays to choose from, posing centralization risks. They too see raw transaction data and could potentially front-run and censor themselves. It’s a matter of trade-offs. The public mempool was transparent but had its issues. By shielding this mempool and allowing a few specialized players to access it, this opens up another type of problem.
Talking about censorship: the majority of relays currently (November 2022) accepts only candidate blocks that are OFAC compliant. Meaning that transactions from addresses that are blacklisted by the OFAC (a financial watchdog of the US government), are not included. They will still get through as long as there are relays that are non-OFAC compliant.
Erik started as a freelance writer around the time Satoshi was brewing on the whitepaper.
As a crypto investor, he is class of 2020. More of a holder than a trader, but never shy to experiment with new protocols.