By Daniel Luca

To understand Proposer-Builder Separation, we must first explore how we arrived at this concept. As with most complex topics, understanding the complete history and thinking process requires delving into the early days of Ethereum itself.

The Evolution of Front-running

To grasp the mechanics of transactions on Ethereum, let's first examine the process of initiating an action on the blockchain. When you decide to act, you generate a transaction. This transaction details the intended action, the originating account, any amount of ether being transferred, the contracts you're engaging with, and so forth.

Once this transaction is assembled, it's sent to the network. This broadcast means that the transaction doesn't only become known to the Miner but also becomes visible to a majority of network participants.

Upon receiving the transactions, the Miners must validate them since other Miners will not accept an invalid transaction. However, their main concern is to choose the most profitable transaction since the Miner gets to keep the associated fee. The transaction fee is determined by the person creating the transaction, and they have the option to choose the fee amount. Suppose the user wishes to prioritize their transaction and ensure it is included in the next block. In that case, they need to pay a competitive fee, which should be on par with the fee associated with other competing transactions yet to be mined.

This inherent blockchain mechanic allows Miners (and almost any other participant in the network) to gain a comprehensive preview of the ongoing activities on the blockchain.

Because of this transparent and decentralized nature of blockchains in general, we have an emerging behavior such as front-running.

Like in the early days of my blockchain experience, I went to Investopedia to get some information. They define front-running as:

Front-running is trading stock or any other financial asset by a broker who has inside knowledge of a future transaction that is about to affect its price substantially. A broker may also front-run based on insider knowledge that their firm is about to issue a buy or sell recommendation to clients that will almost certainly affect the price of an asset.

Thus, Front-running is not new in the financial world, but it is a new development in blockchains. Granted, everything was new at the beginning of the blockchain era.

How Miners Work

In the blockchain domain, Miners hold significant power, as they have the discretion to decide not only which transactions get included in the next block but also the order of these transactions. The implications here go beyond just leapfrogging in a queue—it's about strategically positioning transactions for financial gain.

For example, if you notice a transaction poised to purchase a large amount of ether, placing your own buy order right before theirs could drive up the price. Then, by placing a sell order right after their purchase executes, you capitalize on the resulting price movement. The Miner's authority to sequence transactions within a block opens opportunities for such profitable maneuvers.

Thus, we’re left with Miners that receive all transactions that the network contains but not yet mined, they being the final judge that decides what is included in the next block and in what order. In blockchain terminology, these transactions are part of the mempool, ones that are in the network but not yet included in a block.

But let’s cut Miners some slack, as they are not the only ones who can see transactions in the mempool. In fact, any user can run the same software and access the entire list of mempool transactions. This means that Miners are not special in this regard.

It's important to note that Miners don't manually select transactions. Instead, they rely on specific rules in the software to pick the best ones. The rule is simple: transactions in the mempool are sorted by the associated fee in descending order, and Miners pick as many as they can fit in a block.

Knowing this allows any user, not only the Miners, to exploit opportunities using the front-running technique.

I have to admit I know a few things about Front-running because I built an exploitation framework that uses symbolic execution and front-running to exploit hackers on the Ethereum mainnet. Both tools are currently deprecated, but it’s fun to know they are inspired by Die Hard characters (Karl and Theo). Below, you can watch the Defcon 27 presentation alongside Bernhard Mueller, the inventor of Mythril (symbolic execution engine).

https://youtu.be/Qd9ubry-c_M