Decoding Bitcoin MEV: Another World Outside the Dark Forest of Ethereum
Original author: Jeffrey Hu
Original translation: TechFlow
This article was co-authored by: Jeffrey HU from HashKey Capital, Jinming NEO , 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 is affected, 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 bring more MEV opportunities to 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 user transactions. For example, if Alice and Bob both submit transactions to Uniswap to exchange 1 ETH for USDT, the transaction that is executed 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. If it is just a standard Bitcoin transfer, only the intended recipient can spend Bitcoin with a valid signature, which will not cause other users to compete for the use of 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 miners to extract 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) Review 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, which usually sets a maximum limit on the minted assets. 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 pledge 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 limit 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 situations.
Generally speaking, MEV on Bitcoin refers to the way miners extract maximum profits by manipulating the block creation process. We can roughly categorize it as follows:
-
Users pay extra fees : Users who want to speed up transactions usually do so through off-chain transaction acceleration services, which are usually 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 Bitcoins 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 the Terra mining pool, this block contains an inscription transaction of size 849.93 kvB. The inscription is a 1 minute MP4 video of a frog holding a drink, which brought the miner 0.5 BTC in fees.
-
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 sidechain/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 centralization risk, 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 lottery 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 lottery. 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 miners 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 Satoshi in blocks and transactions.
-
Fee-grabbing transactions : Traders may bid to have transactions related to these alternative assets included in blocks.
For mining pools, the initial success of Runes 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 transaction pool front-running attack. OrdiBots used PSBTs for minting inscriptions on Magic Eden. 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 for this 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 (memory pool policy), defining which transactions it wants to receive and relay. Mining pools can also choose which transactions to include in the block according to 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 browser.
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 utilizing the transaction acceleration service, users can also choose to accelerate their transactions through RBF and CPFP.
RBF and CPFP
Replacement for Payment (RBF) and Child Transaction Pays Parent (CPFP) are methods commonly used by users to increase transaction priority.
RBF (Replacement Payment) allows an unconfirmed transaction in a transaction pool to be replaced by another transaction that conflicts with it (also references 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 a higher fee rate at some point; these transactions are likely to use CPFP (because subsequent transactions pay 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 transaction with a higher fee rate, 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 (for example, 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 offer 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 an impact on 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 miners with a block template (including block header and coinbase transaction information), and miners perform hash calculations based on this template. There are also some tools, such as stratum.work , that 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 proposers responsibilities (perform hash calculations).
-
Mining pools : act as both builders, using the hashes computed by miners, and proposers of blocks.
What does the future hold?
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 aspects such as the implementation of Lightning Network channel exits 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 evolving BTCFi ecosystem will bring more attention to MEV-related factors.
This article is sourced from the internet: Decoding Bitcoin MEV: Another World Outside the Dark Forest of Ethereum
DWF Labs officially launched Cloudbreaks $20 million crypto-native fund on July 4, 2024. The fund focuses on supporting top Web3 projects in the Chinese-speaking region, covering key areas such as GameFi, SocialFi, Memes, DeFi, L1/L2 infrastructure, and AI. In just four weeks, the fund attracted a lot of attention from project parties and received applications from more than 90 projects, fully demonstrating DWF Labs determination and influence to promote innovative growth and ecological development of projects in the Chinese-speaking region. Andrei Grachev, Managing Partner of DWF Labs, expressed his sincere gratitude for this achievement. He said: “I am very grateful for the strong support of the community. The participation of so many projects makes us more convinced that DWF Labs is on the right track and grows and innovates with…