Bitget App
Trade smarter
Buy cryptoMarketsTradeFuturesCopyBotsEarn

Decoding Bitcoin MEV: Another World Outside the Dark Forest of Ethereum

BlockBeatsBlockBeats2024/08/29 13:00
By:BlockBeats

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

Original translation: Decoding Bitcoin MEV: Insights and Implications
Original author: Jeffrey Hu, Jinming NEO, HashKey Capital; George ZHANG, Flashbots
Original translation: TechFlow


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 increasing complexity of MEV on Bitcoin and assess its impact on the broader ecosystem.


Why is there increasing attention to Bitcoin MEV?


Before 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 fell, miner profitability suffered, prompting miners to focus on maximizing transaction fees, which may explain the rise in MEV activity.


The figure 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 more than 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 an increasing number of BTCFi applications and developments, transforming Bitcoin from being just a digital gold/payment network to a rapidly growing ecosystem with ever-expanding utility. This could lead to more MEV opportunities for Bitcoin.


How Bitcoin and Ethereum MEV Differ


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


Architectural 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, allowing searchers to easily 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 adopts 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 confirmed transaction 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 the UTXO.


Altcoins on Bitcoin


In addition to the fundamental differences in design mentioned above, the introduction of valuable assets other than BTC also brings 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 a variety of 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.


Minting


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.


In addition, the concept of rare bitcoins (satoshis) introduced by Ordinals has even raised concerns that miners may trigger block reorganizations during halvings to compete for high-value rare bitcoins.


Staking


In addition to minting, staking protocols like Babylon also set a cap on the assets that can be staked at each staking stage. Even if a user exceeds the cap, they can still construct and transfer bitcoins 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 launch of the Babylon mainnet, the staking cap for the first phase reached 1,000 BTC, resulting in an overflow of about 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 manipulate the block creation process to extract maximum profits. We can roughly categorize them 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 have their transactions prioritized. Traders can also pay miners higher fees through mechanisms such as RBF (Fee Replacement) and CPFP (Child Transactions Pay for Parent Transactions) to prioritize transactions and achieve faster confirmation times. Low-fee transactions typically face longer confirmation times because profit-driven miners 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 are also subject to 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 tends to favor 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".


Examples of Bitcoin MEV


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, with a size limit of 100 kvB. 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, the block contains an inscribed transaction of size 849.93 kvB. The engraving is a 1 minute MP4 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, which generated 0.75 BTC in fees for the miner.


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


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 a 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 transaction submission service that allows customers to submit complex and non-standard transactions.


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:


1. By excluding other honest miners' commitments, the rewards ultimately delivered to Stackers will be reduced.


2. If large miners continue to abuse their computing power and exclude honest miners' commitments, it may lead to centralization risks, allowing a small number of miners to monopolize all Stacks rewards.


However, this problem will be solved by Stacks' Nakamoto upgrade, 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) technology to reduce the profitability of MEV mining. Miners are expected to participate continuously in the last 10 blocks to be eligible for the lottery. Miners who fail to mine in at least 5 of the last 10 blocks will lose the qualification 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 on Alternative Asset Transactions


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


· Mining Pools Extracting 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 include transactions associated with these alternative assets in blocks.


For mining pools, the initial success of Runes has resulted in an additional source 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 competing to have 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 release 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 memory pool (mempool), this allows 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 asset for sale, buyers can bid and use RBF to increase their transaction fees when there is competition, hoping that their transaction will be confirmed.


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


Source: Mempool.space


Another example involves 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 existence of PSBT and Bitcoin's 10-minute block generation interval allow any potential buyer to compete for the same transaction by introducing different addresses, signatures, and simply by paying a higher fee. This resulted in some whitelisted users being unable to mint due to interference from front-running robots. (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 memory pools (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 seen 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 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 explorer.


Block 836361 (Color of pixels 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 (e.g., through RPC endpoints) to miners or mining pools, 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 transaction acceleration services, users can also choose to accelerate their transactions through RBF and CPFP.


RBF and CPFP


Replace-by-Pay (RBF) and Child-Pays-Parent (CPFP) are common methods used by users to increase the priority of a transaction.


RBF (Replace-by-Pay) 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 that uses the UTXO of the pending transaction and pays 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 being included in a block despite having a higher fee rate at some point; these transactions are likely using CPFP (because subsequent transactions pay the fee).


Transactions using CPFP to confirm a parent transaction with a lower fee (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 child 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 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 payment to accelerate 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. In the case of paid services, 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 (e.g., through a website, credit card payment, etc.), it is called external fee payment.


Although external fee payment provides a remedy for transactions that cannot use RBF or CPFP, long-term widespread use may have an impact on Bitcoin's censorship resistance.


Pool Protocol


In the previous discussion, we regarded the mining pool and miners as a whole, but in fact, they need to divide the work and cooperate with each other. 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 to coordinate.


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, that can visualize Stratum information from various mining pools.


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


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


· Miner: Takes on some of the responsibilities of the proposer (performs hash calculations).


· Mining pool: Acts as both a builder, using the hash calculated by the miner, and a proposer of the block.


What will happen in the future?


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


New protocols


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 risks 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.


Impact of Reducing Mining Rewards


The reduction of mining rewards is an important challenge. As block rewards are further reduced in the future, there may be multiple impacts on the network.


Some issues were recognized and discussed by Bitcoin developers early on, such as fee sniping, where mining pools may deliberately re-mine previous blocks to obtain fees. Bitcoin Core has implemented some measures to deal with fee sniping, but current methods still need improvement.


In addition to native transaction fees, alternative assets may also become a continuous source of income 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.


In any case, MEV on Bitcoin has similarities with 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.


Original link

0

Disclaimer: The content of this article solely reflects the author's opinion and does not represent the platform in any capacity. This article is not intended to serve as a reference for making investment decisions.

PoolX: Stake to earn
CEC, QTLX, GDV and other popular new coins are in hot progress!
Stake now!