Now that your Ethereum node is running (or nearly ready), we can begin preparations for using Flashbots.
For anyone who has not heard of Flashbots, please visit their documentation page and read through their introduction.
Their documentation accurately describes the goal and services provided by Flashbots, but (common to the genre of technical writing) does not truly express the importance of the systems they have built.
What is Flashbots?
MEV is a zero-sum game, which means that there is some (largely theoretical) amount of “leftover” value present in each new block as a result of smart contract interactions and on-chain asset movements. A group called “searchers” systematically analyze the state of the blockchain in an effort to identify and extract this value by executing transactions that manipulate the blockchain state in a way that benefits themselves.
The maximum leftover value can only be extracted once, so searchers compete with each other to capture it. This competition leads to higher gas fees as users compete with bots to secure limited blockspace. This is a net negative, and it degrades user experience across the ecosystem.
Enter Flashbots! They have created a network of miners who agree to run a custom version of Ethereum client software called mev-geth. Mev-geth allows miners to participate in a special system known as the Flashbots auction.
Flashbots Auction
The Flashbots auction is unique because it occurs completely off-chain. Miners running mev-geth evaluate “bundles” from searchers. These bundles contain one or more proposed transactions, as well as a proposed direct payment which is transferred directly to the miner. The miners evaluate all pools, order them in the way that provides the greatest possible profit to them, and then attempt to propose and confirm the block on the greater Ethereum network. All other proposed bundles eventually expire and are discarded by the pool.
There are several advantages to this approach:
Searchers can propose bundles without any up-front payment. This means that proposing a bundle that is not selected is “free”, other than the energy used to find and propose it.
Bundles do not enter the public mempool, so they are immune from front-running and manipulation.
Searchers can compete based on adjusting their “bribe” to the miners, instead of competing in a priority gas auction.
All bundles are guaranteed to be executed at the “top” of the block, which means that they have priority access to the block state of the preceding block.
Getting Started
Please refer to the Flashbots Quick Start guide. Keep it open or bookmarked.
The Flashbots guide assumes a lot of technical knowledge, but it’s very similar to the skills we developed using the Snowsight service. If you’ve not read through that series, I encourage you to review it — especially the lesson covering the transaction propagator.
Flashbots operates similarly to Snowsight, with some nuances that we will discover and explore soon.
A bundle is a list of proposed transactions, plus a unique signed message that verifies the identity of the searcher.
From Flashbots —
Let's begin with the private key Flashbots uses for identity. When you send bundles to Flashbots you will sign them with a private key so that we can establish identity for searchers and establish reputation for them over time. This private key does not store funds and is not the primary private key you use for executing transactions. Again, it is only used for identity, and it can be any private key.
Generating an Identity
Given the information above, we know that Flashbots expects a signed message from a private key, but this private key does not have to match the address executing the particular bundles.
So let’s make a brand new identity for Flashbots.