Original author: Jeffrey Hu

Original translation: TechFlow

This article was co-authored by: Jeffrey HU, Jinming NEO from HashKey Capital, and George ZHANG from Flashbots.

introduction

The concept of Bitcoin MEV (Miner Extractable Value) emerged as early as 2013. Although still relatively new compared to Ethereum’s MEV, the thriving Bitcoin ecosystem promises to bring more programmability, expressiveness, and MEV opportunities in the future with the introduction of meta-protocols such as BRC-20, Ordinals, and Runes.

This report will analyze the increase in MEV complexity on Bitcoin and assess its impact on the broader ecosystem.

Why is there increasing attention on Bitcoin MEV?

Prior to the introduction of Ordinals, MEV on Bitcoin was not widely recognized and was not important, with the focus mainly on the Lightning Network and sidechain mining attacks. However, the Taproot upgrade brought more expressiveness and programmability to Bitcoin, facilitating the launch of meta-protocols such as Ordinals and Runes, which brought the issue of MEV to the surface. Bitcoin’s 10-minute block time also exacerbated the problem, making inexperienced users more vulnerable to various MEV attacks, such as fee grabbing when bidding on the inscription market. As block rewards decline, miner profitability suffers, prompting miners to focus on maximizing transaction fees, which may explain the rise in MEV activity.

The chart below shows the rise in fees relative to block rewards around the launch of the much-anticipated Ordinals and Runes, which at one point accounted for over 60% of total Bitcoin mining revenue.

Source: Dune analytics (@data_always), Transaction fees as a percentage of mining rewards, as of July 22, 2024.

To date, we have seen more and more BTCFi applications and development, transforming Bitcoin from being just a digital gold/payment network to a fast-growing ecosystem with ever-expanding utility. This could lead to more MEV opportunities for Bitcoin.

Differences between Bitcoin and Ethereum MEV

There is less discussion about Bitcoin MEV, which can be attributed to the completely different architectural designs between Bitcoin and Ethereum.

Architecture Design

Ethereum runs on the Ethereum Virtual Machine (EVM), executes smart contracts, and achieves programmability by maintaining a global state machine.

Ethereum uses an account-based model that runs transactions by managing the order of their transaction numbers. This means that the order of transactions affects their results, making it easy for searchers to identify MEV opportunities and add their transactions directly before or after a user's transaction. For example, if Alice and Bob both submit transactions to Uniswap to exchange 1 ETH for USDT, the transaction that executes first in the block will receive more USDT.

In contrast, the scripting language used by Bitcoin is not stateful like Ethereum, and uses a UTXO model. With standard Bitcoin transfers, only the intended recipient can spend Bitcoin with a valid signature, which does not lead to other users competing to use these funds. However, on Bitcoin, it is also possible to create UTXOs that can be unlocked by multiple parties using scripts or SIGHASH. The first transaction confirmed is the transaction that can spend the UTXO. Nevertheless, since the unlocking conditions of each UTXO are only related to the UTXO itself and do not depend on other UTXOs, the competition is limited to that UTXO.

Altcoins on Bitcoin

In addition to the fundamental differences in design mentioned above, the introduction of valuable assets other than BTC also creates incentives for miner extractable value (MEV). The MEV generated in these scenarios is essentially the order in which protocol designers specify asset ownership and on-chain behavior validity when trying to build new asset classes and on-chain behaviors using scripts + UTXO (a data structure unique to Bitcoin). Since events are defined based on order, there is a motivation to compete for order, which generates MEV.

If other assets are not considered, rational miners will only package legitimate transactions based on transaction fees and charge according to the size of the transaction. However, if Bitcoin transactions are not limited to standard transfers, such as minting new valuable assets (such as Runes, etc.), miners can adopt multiple strategies instead of just considering Bitcoin transaction fees: 1) censor transactions and replace them with their own minting transactions; 2) ask users for higher fees (on-chain, off-chain or sidechain payments); 3) let multiple users bid against each other, resulting in fee wars.

Casting

A direct example is the minting process of assets such as Runes or BRC 20, where a maximum limit on the minted asset is usually set. The first confirmed minting transaction is considered successful, while other transactions are considered invalid. Therefore, in this case, the order of transactions becomes very important and brings MEV opportunities through transaction ordering.

Furthermore, the concept of scarce bitcoins (satoshis) introduced by Ordinals has even sparked concerns that miners could trigger block reorganizations during halvings in order to compete for high-value scarce bitcoins.

Staking

In addition to minting, staking protocols like Babylon also set a cap on the amount of assets that can be staked at each staking stage. Even if a user exceeds the cap, they can still construct and transfer Bitcoin to the staking lock script, but this will no longer be considered a successful stake and will not be eligible for future rewards. In other words, the ordering of staking transactions is equally critical.

For example, shortly after the Babylon mainnet was launched, the staking cap for the first phase reached 1, 000 BTC, resulting in an overflow of approximately 300 BTC that needed to be unbound.

At the launch of the Babylon mainnet, the fee rate rose to 1, 000 sats/vBytes. Source: Mempool.space

In addition to on-chain minting/imprinting assets and staking, certain activities on sidechains or rollup chains are also affected by MEV. We will provide more examples in the “MEV Events on Bitcoin” section.

What is considered Bitcoin MEV?

So, what counts as MEV on Bitcoin? After all, the definition of MEV changes in different contexts.

Generally speaking, MEV on Bitcoin refers to the way miners manipulate the block creation process to extract maximum profits. We can roughly categorize it as follows:

  • Users pay extra fees: Users who want to speed up their transactions usually do so through off-chain transaction acceleration services, which are often expensive because users need to pay higher fees to prioritize their transactions. Traders can also pay higher fees to miners through mechanisms such as RBF (replacement by fee) and CPFP (child transaction pays for parent transaction) to prioritize transactions and achieve faster confirmation times. Low-fee transactions usually face longer confirmation times because profit-driven miners will prioritize more profitable transactions for block packaging.

  • Collusion between users and miners: Users collude with miners to censor and include certain transactions of particular importance. For example, malicious users and miners collude to censor and exclude penalty transactions on the Lightning Network to illegally obtain assets in the channel. Other new systems such as BitVM and its penalty transactions also face similar risks.

  • Bitcoin miners mining on sidechains/L2: This includes various early merged mining schemes, where miners use Bitcoin's computing power to secure another network. Through merged mining, it may lead to miner centralization, because large miners may use their computing power on the main chain to influence block production, sorting, etc. on L2, thereby obtaining excessive L2 mining rewards and potentially affecting the security of the L2 network.

A fee bidding method that leans toward the public market (such as RBF) plays a relatively positive role in the overall economic system and promotes a free market economy. However, when users make out-of-band payments with mining pools, this undoubtedly poses a threat to the decentralization and censorship resistance of the network, which is often referred to as "MEVil".

Bitcoin MEV Example

Based on the above classification, we can see several cases of MEV.

Non-standard transactions

The Bitcoin Core software only allows nodes to process standard transactions, which are limited to 100 kvB in size. However, mining pools still include high-fee non-standard transactions in blocks, often excluding other low-fee transactions.

Some typical cases include:

  • Block 776, 884 : Mined by Terra Pool, this block contains one inscribed transaction of size 849.93 kvB. The inscription is a 1-minute MP 4 video of a frog holding a drink, which generated 0.5 BTC in fees for the miner.

  • Block 777, 945 : Contains a 4000 x 5999 pixel WEBP image of size 975.44 kvB, generating 0.75 BTC in fees for the miner.

  • Block 786,501, which generated about 0.5 BTC in fees for miners for engraving a JPEG image of Julian Assange on the cover of Bitcoin Magazine, is 992.44 kvB in size.

By default, Bitcoin Core nodes are only allowed to forward standard transactions. Therefore, non-standard transactions must be sent directly to the mining pool through the private memory pool. Private memory pools allow mining pools to accept non-standard transactions and prioritize user transactions. While this can speed up transaction processing, more transactions moving to private memory pools may lead to increased centralization and censorship risk for mining pools. Apparently, some mining pools are already taking advantage of the profitability of private memory pools.

For example, Marathon Digital launched “Slipstream,” a direct deal submission service that allows clients to submit complex and non-standard deals.

MEV events on sidechains/L2

The Stacks sidechain uses a unique consensus mechanism, Proof of Transfer (PoX), which allows Bitcoin miners to mine Stacks blocks and settle transactions on the Bitcoin blockchain while receiving STX rewards.

In the past, Stacks adopted a simple miner election mechanism, in which Bitcoin miners with high computing power are more likely to mine Stacks blocks, review other miners' commitment transactions, and monopolize all rewards. If more miners adopt this strategy, future Stackers may face reduced returns.

Impact on the Ecosystem:

  • By excluding commitments from other honest miners, the rewards ultimately passed to Stacker will be reduced.

  • If large miners continue to abuse their computing power and exclude the commitment of honest miners, it may lead to the risk of centralization, allowing a small number of miners to monopolize all Stacks rewards.

However, this issue will be addressed with the Nakamoto upgrade to Stacks, which will make this strategy unprofitable. The upgrade will move from simple miner election to a sortition algorithm and adopt the Assumed Total Commitment with Carryforward (ATC-C) technique to reduce the profitability of MEV mining. Miners are expected to participate continuously in the last 10 blocks to qualify for the sortition. Miners who fail to mine in at least 5 of the last 10 blocks will lose eligibility for Stacks rewards. With ATC-C, the probability of a miner winning a Stacks block is now equal to the ratio of the miner's BTC expenditure to the median total BTC commitment of the last 10 blocks. This reduces the possibility of miners gaining disproportionate benefits by excluding other miners' block commitments.

Bidding for alternative asset transactions

MEV associated with alternative assets such as Ordinals and Runes can be divided into the two types mentioned previously:

  • Mining pools extract additional value: Mining pools can extract additional value by including assets such as Bitcoin Ordinals or Rare Satoshis in blocks and transactions.

  • Fee-grabbing transactions: Traders may bid to have transactions related to these alternative assets included in blocks.

For mining pools, Runes’ initial success has led to additional sources of profit. For example, during the halving event, the highly anticipated launch of Runes led to new highs in network transaction volume and fees, with many users scrambling to get their transactions included in the historic Bitcoin halving blocks. Transaction fees rose to over 1,500 sats/vByte after the halving (from less than 100 sats/vByte before the halving). ViaBTC took advantage of this surge and mined the halving block that coincided with the launch of Runes, earning a profit of 40.75 BTC, of ​​which 37.6 BTC came from Runes-related transaction fees. With the block reward now halved, Runes’ transaction fees have become a profitable source for miners.

Source: Mempool.space

Source: Mempool.space

For traders, Bitcoin transactions using Runes and Ordinals use SIGHASH_SINGLE|SIGHASH_ANYONECANPAY as partially signed transactions (PSBTs), which allows only one signed input to correspond to one output. Combined with the transparency of the mempool, this enables many buyers to discover potentially profitable transactions. As a result, traders often use RBF and CPFP, leading to competitive fee wars that enable miners to capture MEV from this demand. For example, when a seller lists their assets for sale, buyers can bid and use RBF to increase their transaction fees when there are competitors, hoping that their transactions will be confirmed.

A typical example of competition between traders is the transaction with transaction ID 2ffed299689951801a68b5791f261225b24c8249586ba65a738ec403ba811f0d. After the seller listed his asset, the transaction was replaced several times using RBF with fee rates of 238, 280, 298, and 355 sat/vB.

Source: Mempool.space

Another example involved the OrdiBots minting process on the Magic Eden platform. Multiple users fell victim to a pool front-running attack. OrdiBots minting inscriptions on Magic Eden used PSBTs. The presence of PSBTs and Bitcoin’s 10-minute block generation interval allowed any potential buyer to compete for the same transaction by introducing different addresses, signatures, and simply paying a higher fee. This resulted in some whitelisted users being unable to mint due to front-running bot interference. (The team later apologized and promised to compensate affected users with customized OrdiBots.)

However, not all MEV-related technologies or events are harmful to users. In some cases, MEV technology can also protect user assets from loss. For example, without RBF, erroneous transactions cannot be saved, and unconfirmed transactions may remain unconfirmed for a long time, resulting in opportunity costs. In addition, running RBF contributes to the security of the Bitcoin network. As block subsidies are expected to decrease relative to transaction fees in the future, transaction fees will play a vital role in incentivizing miners to continue participating in the Bitcoin network. Bitcoin developer Peter Todd has also actively advocated the benefits of RBF and recommends that miners run full RBF.

Key technical components supporting MEV on Bitcoin

So what are the key technical components or methods on Bitcoin that support these MEV opportunities? Commonly involved technical areas include mempools, RBF (replacement fee), CPFP (child transaction pays parent transaction), mining pool acceleration services and mining pool protocols.

Memory Pool

Similar to Ethereum and other typical blockchain networks, Bitcoin also has a transaction pool structure for storing transactions that have been received by P2P nodes but not included in the block. The transparent and decentralized nature of the memory pool creates an environment conducive to MEV opportunities, enabling all transactions to be propagated to miners.

However, unlike Ethereum’s gas mechanism, Bitcoin’s fees are only related to the size of the transaction. Therefore, Bitcoin’s transaction pool can be viewed as a more direct block space auction market, where you can see which users are bidding for the next block and their bids.

Since different nodes receive different transactions from P2P propagation, each node has a different memory pool. In addition, each node can actively customize its own forwarding strategy (mempool policy), defining which transactions it wants to receive and relay. Mining pools can also choose which transactions to include in blocks based on their preferences (although from an economic point of view, they will prioritize high-fee transactions). For example, the Bitcoin Knots node filters out any Ordinals transactions, while Marathon Mining creates a pixel-style logo in the block explorer.

Block 836361 (pixel color shows fee rate), source: mempool.space

Therefore, users may consider sending transactions directly to specific miners or mining pools to speed up the inclusion of transactions, but this approach may affect two key features that the Bitcoin community highly values: privacy and censorship resistance.

Transactions propagated through P2P nodes, rather than sent directly to miners or mining pools (e.g., via an RPC endpoint), help obfuscate the origin of transactions, making it more difficult for miners and mining pools to censor transactions based on identified information.

In addition to taking advantage of the transaction acceleration service, users can also choose to accelerate their transactions through RBF and CPFP.

RBF and CPFP

Replacement of Payment (RBF) and Child Pays Parent (CPFP) are methods commonly used by users to increase transaction priority.

RBF (Replace-by-Payment) allows an unconfirmed transaction in a transaction pool to be replaced by another transaction that conflicts with it (also referencing at least one of the same inputs), but pays a higher fee rate and overall higher fees. Similar to the transaction pool strategies discussed previously, RBF can be implemented in a variety of ways. The most common implementation is opt-in RBF, designed by BIP 125, where only specially marked transactions can be replaced. Another approach is full RBF, in which transactions can be replaced regardless of whether they are marked or not.

CPFP (child transaction pays parent transaction) uses a different method to speed up transaction confirmation. Unlike RBF, which replaces transactions stuck in the memory pool, the recipient can speed up the pending parent transaction by sending a child transaction, using the UTXO of the pending transaction, and paying a higher fee rate. This may incentivize miners to package these transactions together in the next block. Therefore, sometimes you may see transactions with very low fees included in a block despite having a higher fee rate at some point; these transactions are likely using CPFP (because the subsequent transaction paid the fee).

Using CPFP to confirm transactions with low-fee parent transactions (7.01 sat/VB), source: mempool.space

The key difference between RBF and CPFP is that RBF allows the sender to replace a pending transaction with a higher fee transaction, while CPFP allows the receiver to speed up a pending transaction by sending a sub-transaction with a higher fee rate. CPFP is also useful for transactions that need to exit from the Lightning Network (e.g., anchor outputs). In terms of fees, RBF is relatively more cost-effective because it does not require additional block space.

External fee payment and mining pool acceleration services

In addition to methods such as RBF (Replacement Payment) and CPFP (Child Transaction Pays Parent Transaction), users can also choose to use external fee payments to speed up their transactions. For example, many mining pools provide free and paid transaction acceleration services to speed up the packaging of transactions by submitting their txID. If it is a paid service, users need to pay service fees to support the mining pool. Since this service involves paying fees through a system other than the Bitcoin network (for example, through a website, credit card payment, etc.), it is called external fee payment.

While external fee payments provide a remedy for transactions that cannot use RBF or CPFP, long-term widespread use could have implications for Bitcoin’s censorship resistance.

Mining Pool Protocol

In the previous discussion, we considered the mining pool and miners as a whole, but in fact, there needs to be division of labor and cooperation between them. The mining pool aggregates the computing power of miners for mining and distributes rewards according to the contribution of computing power. This cooperation process requires certain protocols for coordination.

In common mining pool protocols, such as Stratum v1, the mining pool only needs to provide a block template (including block header and coinbase transaction information) to the miner, and the miner performs hash calculations based on this template. There are also some tools, such as stratum.work, which can visualize Stratum information from various mining pools.

In this process, miners cannot choose which transactions to include; instead, the mining pool selects transactions and builds templates, assigning tasks to miners.

Therefore, in the Stratum v1 protocol, we can roughly map the roles to the Ethereum ecosystem as follows:

  • Miner: Assume some of the proposer's responsibilities (perform hash calculations).

  • Mining pools: act as both builders, using the hashes computed by miners, and proposers of blocks.

What will happen in the future?

Several promising solutions are being developed to mitigate the negative impact of MEV (miner extractable value) on Bitcoin.

New Protocol

In some new mining pool protocols, such as Stratum v2 and BraidPool, miners can independently choose the transactions to be packaged. Stratum v2 has been adopted by some mining pools (such as DEMAND) and mining firmware (such as Braiins), allowing individual miners to build their own block templates. This improves the security, decentralization, and efficiency of data transmission, while reducing the risk of transaction censorship and MEV on Bitcoin.

Therefore, following this trend, the roles of mining pools and miners in the future may not evolve in the same way as Ethereum’s PBS (proposer/builder separation) model.

In addition, new designs related to transaction pools in Bitcoin Core may bring changes, mainly including the much-discussed v3 transaction relay strategy and the enhancement of the cluster memory pool. However, the impact of these new designs on the implementation of Lightning Network channel exits and other aspects is still under discussion.

Reducing the impact of mining rewards

The reduction of mining rewards is an important challenge. As the block reward is further reduced in the future, it may have multiple impacts on the network.

Some issues were recognized and discussed by Bitcoin developers early on, such as fee sniping, where mining pools may intentionally re-mine previous blocks to obtain fees. Bitcoin Core has implemented some measures to combat fee sniping, but the current approach still needs improvement.

In addition to native transaction fees, alternative assets may also become a continuous source of revenue in the future. Therefore, some projects are trying to build infrastructure to more efficiently identify valuable transactions involving alternative assets. For example, Rebar is developing an alternative public memory pool to better identify transactions related to valuable alternative assets.

However, as discussed in the “External Fee Payments” section, the impact of these off-chain Bitcoin economic incentives on Bitcoin’s self-regulating incentive-compatible system remains to be verified.

Regardless, MEV on Bitcoin has similarities to Ethereum, but also differs due to different architectures and design philosophies. The increasing utility of Bitcoin, the gradual reduction of block subsidy rewards, and the growing BTCFi ecosystem will bring more attention to MEV-related factors.

Original link