
Source: Geek Web3
The concept of MEV in the Bitcoin network began to attract attention around 2013.Although MEV issues are more often associated with Ethereum, Bitcoin is not without mev issues.Bitcoin’s design model is very different from Ethereum, which makes MEVs in its own ecosystem not attract much attention.But with the development of Ordinals, Runes and various L2s, MEV is becoming more and more prominent in Bitcoin.
In this report, we willDiscuss the increasingly complex MEVs on Bitcoin and study their impact on ecosystems.
Why do we need to pay attention to Bitcoin MEV now
Before Ordinals was popular, MEV activity on Bitcoin was not well known, mainly concentrated in attacks such as Lightning Network and sidechain mining.The Taproot upgrade brings more programmability, which has promoted the launch of protocols such as Ordinals and Runes, which has made the MEV issue the focus.
Bitcoin’s 10-minute block time further exacerbates this problem because it will increase the waiting time of transactions in mempool, leaving more observation space for MEV players.For example, traders can provide miners with additional fees and other MEV methods to obtain greater benefits; as block rewards decrease, miners can also find benefits through other monetization channels such as inscriptions and runes, which has led to more and more commonMEV activities.
The following picture showsDuring the highly anticipated Ordinals and Runes releases, transaction fees surged relative to block rewards, sometimes even accounting for more than 60% of the total Bitcoin mining revenue.
(Source:Dune analytics, transaction fee share % of mining reward, data as of 22 July 2024)
In addition, in 2024, we are also seeing more and more BTCfi applications and protocols.In the future, we may see Bitcoin’s MEV development reaching a higher scale.
The difference between MEV on Bitcoin and Ethereum
There is little discussion about Bitcoin MEV, and the important reason is that there is an essential difference between Bitcoin’s architecture and Ethereum.
Bitcoin’s UTXO model
Ethereum executes smart contracts through EVM, achieves programmability, and achieves this goal by maintaining a global state.Ethereum adopts an account model to execute transactions through the nonce order of managing transactions.This means that the order of transactions affects execution results, resulting in searchers being able to easily identify MEV opportunities and insert a transaction directly before or after the user’s transaction.This is similar to the racing condition problem when multiple users write data to the database at the same time.
For example, Alice and Bob send the same transaction to Uniswap at the same time: exchange 1ETH for USDT, but the transaction executed first in the block will get more USDT.
Bitcoin adopts script + UTXO, without state.If it is just a typical transaction for transfer, only the receiver can unlock it through his own signature, and there will be no problem of competing with other people’s reading and writing.
However, it can also be constructed in Bitcoin with scripts or SIGHASH to unlock UTXOs that can be unlocked by multiple people. At this time, the transaction confirmed first will get the money.However, because the unlocking conditions of each UTXO are only related to itself and will not rely on other UTXOs, the competition is only limited to this UTXO.
Introduced assets outside BTC
In addition to the essential differences in the above design, the introduction of valuable assets other than BTC also triggers the conditions for the generation of MEV.The MEVs generated by these scenarios are essentially the order when the protocol designer tries to build new asset classes and on-chain actions with scripts + UTXO on BTC, and determines the income of the asset and the legality of the action.With an event defined based on order, there is an incentive of the competition order, and there is a MEV.
Without considering other assets, rational miners will only package legal transactions at transaction rates and charge corresponding fees based on the size of transaction data;If a transaction represents a meaning no longer an ordinary transfer, but instead mints a valuable asset (such as Runes, etc.), miners can have multiple strategies:
1) Reject this transaction and mint the inscription assets yourself;
2) Ask users for higher handling fees;
3) Let multiple users who issue transactions at the same time bid
Mint
The most direct example is that in the mint process of assets such as Runes, BRC20, etc., the upper limit of asset mint is generally agreed.A mint transaction confirmed first will be considered successful, otherwise it will be considered invalid.Then the order of transactions will be crucial in this scenario, which provides an opportunity to sort MEV transactions.In addition, the concept of rare conjunction introduced by ordinals even makes some people worry that miners will trigger block reorganization in order to compete for high-value rare conjunction when the halving is reduced.
Staking
In addition to mint, staking protocols such as Babylon will also specify the upper limit of assets that users can take at each stage.Although after reaching the upper limit, users can still construct and send Bitcoins to the staking lock script, it can no longer be considered a successful stake and can receive rewards in the future.In other words, the order of staking transactions is also crucial.
For example,After the Babylon main network was launched, it soon reached the upper limit of 1,000 BTC for phase-1, causing the following about 300 BTCs to exceed the limit and require users to unlock it manually.
(When Babylon main network was launched, the rate soared to more than 1k sats/vBytes, Source: Mempool.space)
In addition to the etching/etching assets and staking on the main chain, some activities on the sidechain or rollup will also be affected.We will list more examples in “Events of MEV on Bitcoin”.
Which MEVs are counted as Bitcoin
So which ones can be considered MEV, or more strictly speaking, MEVs on Bitcoin?After all, the definition of MEV is not very consistent in various contexts.
Generally speaking, MEV, a miner can extract value or maximum extractable value, refers to different ways in which miners manipulate the block creation process to extract maximum profits.Such activities can be presented in a variety of ways.We can roughly divide it into the following categories according to its participants and revenue destinations:
-
Users pay extra fees:For example, out-of-band transaction acceleration services, private transaction pools, etc.Traders can also use RBF, CPFP and other means to give miners higher fees to confirm transactions with MEV value.
-
Users and miners conspire: Users and miners conspire to review or package some transactions with specific meanings.For example, evil users conspired with miners to review the punishment transactions of Lightning Network to avoid packaging and illegally obtaining assets in the channel.Other new contract-based agreements, including the penalty transactions of BitVM2, will also face similar problems.
-
Miners’ mining of L2:Including the earliest various merger mining solutions, miners use the calculation results to other sidechains or L2 networks while providing computing power to Bitcoin.Miners may use the computing power on the main chain to affect the block production, sorting, etc. of L2, thereby obtaining excess L2 mining income and even affecting L2’s network security.
It can be seen that if it is a bidding method that favors open market means (RBF, etc.), it still plays a relatively good positive incentive for the entire economic system; but whether the user directly sends transactions to the mining pool, or the mining pool passes the screening.Transactions to make profits will undoubtedly challenge the decentralization and censorship resistance that the Bitcoin community cherishes most, so it is also called “MEVil”.
Typical Cases of Bitcoin MEV
According to the above classification, we can see many related cases.
Non-standard transactions
Bitcoin Core software only allows nodes to process standard transactions not exceeding 100kvB.However, mining pools still include non-standard transactions that offer high transaction fees in the block, which is usually at the expense of excluding other low-cost transactions.
Some of these relatively typical examples include:
-
Block 776,884 was dug by Terra mining pool and contains a 1-minute mp4 video of 3.38MB in size, showing a frog holding a drink, earning 0.5BTC for miners.This transaction accounts for 849.93 kvB.
-
Block 777,945 contains a 4000 x 5999 pixel WEBP image, accounting for 975.44 kvB, earning 0.75 BTC for miners.
-
Another block 786,501, received a fee of about 0.5BTC to burn a JPEG image of the cover of Julian Assange’s Bitcoin magazine.
The default Bitcoin Core node is only allowed to forward standard transactions.Therefore, non-standard transactions must directly contact the mining pool through private transaction pools.Private transaction pools allow the mining pool to accept non-standard transactions and provide guarantees included in the transaction.While this can speed up transaction processing, as more transactions move to private transaction pools, this can lead to centralization of the mining pool and increased risk of scrutiny.Obviously, some mining pools are already taking advantage of the profit opportunities of operating private transaction pools.
For example, Marathon Digital introduced “Slipstream”, which facilitated private transaction pools.This allows Marathon to provide customers with the ability to submit complex and non-standard transactions to the network.
MEV events on sidechain or L2
Stacks sidechain previously adopted a relatively special consensus method: Proof of Transfer (PoX) allows Bitcoin miners to mine Stacks blocks and settle their transactions on the Bitcoin chain.
Stacks participants make block commitments in Bitcoin chain transfers to obtain the opportunity to obtain block output rights and corresponding rewards on Stacks.Through weighted random functions, the victorious miner can mine blocks on the Stacks network.This leads toBig miners review transactions from other Stacks participants and only package their own block commits to get a large amount of STX rewards alone.
As more miners adopt this strategy, it is unlikely that other Stacks participants will receive rewards.
What impact does this behavior have on the ecology?
1) By excluding commitments from other honest miners, this reduces the rewards that are ultimately passed to stackers
2) If large miners continue to abuse their computing power and eliminate the promises of honest miners, it may also lead to centralization problems, leaving a few miners completely exclusive.
However, this problem is now alleviated with the Stacks Nakamoto upgrade, which makes this strategy unprofitable again.The upgrade will shift from a simple miner election to using sorting algorithms, Assumed Total Commitment with Carryforward (ATC-C) skills, reducing the profitability of MEV mining.Thanks to using ATC-C, the probability of miners winning sort is now equal to miners’ BTC spending divided by the median total BTC commitment in the last 10 blocks.
In addition, miners who have not mined in at least 5 of the last 10 blocks will be disqualified from receiving any Stacks rewards.This reduces the motivation for miners to gain disproportionate benefits by excluding block commitments from other miners.
Bidding for alternative asset transactions
For the MEV of alternative assets such as Ordinals and Runes, it can also be attributed to the above two categories:
-
Mining pools acquire additional value or rare assets such as Ordinals through packaging blocks and transactions
-
Traders bid for these alternative assets transactions
For mining pools, Runes’ outstanding performance at the beginning provides an additional source of profit for mining pools.For example, the highly anticipated Runes launch drove online transactions to record highs in the number and fees of online transactions as many users scramble to incorporate their transactions into the historic Bitcoin halving block.Post-halving transaction fees have exceeded 1,500sats/vByte (less than 100sats/vByte before the halving).
ViaBTC successfully capitalized on this craze, tapping into the halving block that occurred simultaneously with Runes’ launch, earning 40.75 BTC in block 840,000, of which 37.6 BTC came from the transaction fees associated with Runes.
Source: Mempool.space
For traders, Runes and Ordinals transactions on Bitcoin use special opcodes to allow signature inputs and outputs to be combined, and the transparency of the transaction pool also allows many buyers to discover potentially profitable transactions.
Therefore, for the trading opportunities that arise, traders will frequently use RBF (fee replacement) and CPFP (child is parent) to bid, so that miners can also use this requirement to capture MEVs.For example, when sellers list 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.
The following figure shows the competition between such traders:
2ffed299689951801a68b5791f261225b24c8249586ba65a738ec403ba811f0d
This deal is very typical.It can be seen that after the seller puts an order, the transaction transaction is replaced by RBF many times with the rates of 238, 280, 298, and 355 sat/vB.
Source: Mempool.space
Another example is the OrdiBots casting process on the Magic Eden platform.Several users became victims of the trading pool’s first attack.OrdiBots’ minted inscriptions use PSBT (partially signed bitcoin transactions) on Magic Eden.
The PSBT and 10-minute block interval allow any potential buyer to compete for the same transaction by introducing different addresses, signing and paying higher fees.This resulted in several whitelisted users being unable to cast due to interference from preemptive bots (the team has apologized afterwards and promised to compensate affected users with customized OrdiBots).
But not all MEV-related technologies or events will be detrimental to users.MEV’s technology will also protect user assets from losses in some cases.If RBF is not enabled, the wrong order cannot be rescued, and the stuck transaction will remain stuck for a long time.Therefore, Peter Todd and others also recommend that the full RBF option be enabled for the full node to forward transactions without the RBF mark.
Important technical components or means of MEV on Bitcoin
So what technical means are these MEVs supported by?Common technical fields currently involved include transaction pools, RBF, CPFP, mining pool acceleration services, mining pool protocols, etc.
Transaction pool (mempool)
Similar to Ethereum and other typical blockchain networks, Bitcoin also has a transaction pool structure to save transactions received by P2P nodes but have not yet confirmed in the block.Similar to Ethereum, transaction pools can also play a very important role in Bitcoin’s MEV, which can be used to view and estimate which transactions will be packaged.
But what is different from the Ethereum gas mechanism is that the transaction fee (fee) of Bitcoin is only related to the transaction volume, so the transaction pool of Bitcoin can be regarded as a more direct block space auction market, which users can be seen,At what price is bidding for the next block.
Because the P2P propagation transactions received by different nodes are different, there is no unique transaction pool in the Bitcoin network.Moreover, each node can also actively customize its mempool policy to define the transactions it wants to receive and forward;
The mining pool can also choose which transactions to package according to your preferences(Although economically rationally preferential transactions with high fees).For example, the Bitcoin Knots node does not accept and forward transactions of ordinals, and the Marathon mining pool also builds a pixel-style logo in the browser.
(Show block 836361 in the browser (pixel color indicates the transaction rate), Source: mempool.space)
So users may consider sending transactions directly to miners or pools in anticipation of faster packaging, but this will harm two characteristics that the Bitcoin community values very much: privacy and censorship resistance.
Transactions are propagated through P2P nodes rather than being sent directly (for example through an RPC endpoint) to miners or mining pools, which helps confuse the entity information behind the transaction, making it impossible for miners and mining pools to review transactions through these identified identities.
But sometimes when we do want to get confirmation faster, or when the transaction fee set before is too low and it is difficult to be packaged into a block, we still have some tools to use, namely RBF and CPFP.
RBF, CPFP
Replacement of handling fee (RBF) and the son are the father (CPFP) is a method that users can usually use to increase transaction priorities.
RBF (Replace-By-Fee) allows unconfirmed transactions in the transaction pool to be replaced with another conflict with it (also referenced to at least one of the same inputs) and pays higher handling rates and higher overall handling fees.trade.
Like the transaction pool strategy discussed above, RBF can actually have various implementation rules, but the most commonly used implementation is optional RBF (opt-in RBF) designed according to BIP125, that is, it can be replaced by specially marked transactions; anotherThis type is full RBF (full RBF), and the transaction can be replaced regardless of whether it is marked or not.
CPFP (Child Pays For Parent) adopts another idea of additional handling fees.Although the user first sent a low-rate transaction that was not confirmed, a higher handling rate can be paid in subsequent (using the output of the previous transaction as input) transactions to incentivize miners to convert both transactions.Pack.
Therefore, it can sometimes be seen in the browser that although the fee rate is very high at a certain moment, there are still extremely low-rate transactions packaged into the block. These transactions are likely to use CPFP (because it is followed by subsequent transactions).Paid).
(This transaction uses CPFP to enable the low-rate (7.01 sat/VB) parent transaction to be packaged and confirmed Source: mempool.space)
The main difference between CPFP and RBF is that RBF increases the handling fee rate by the payer, while CPFP allows the receiver to increase the handling fee rate to speed up transaction confirmation, and is useful for pre-signed transactions that need to be withdrawn in the Lightning Network (such as anchors).point output).But RBF also has cost advantages because there is no need for additional block space.
Additional charges and mining pool acceleration services
Another possibility that ultra-low rate transactions are packaged is the use of additional payment methods.
In addition to the methods of adding on-chain fees for direct transactions such as RBF and CPFP, users can also choose to use an out of band fee payment to accelerate their transactions.
For example, many mining pools provide free and paid transaction acceleration services to accelerate packaging for users to submit txid transactions.If it is a paid service, the user needs to pay a fee to the mining pool to make up for the difference in the handling fee.Because this type of service pays for handling fees in systems outside the Bitcoin network (such as website recharge, credit card payment, etc.), it is called an additional fee.
Although out-of-band payments provide a remedy for transactions that cannot use RBF or CPFP, long-term use will affect Bitcoin’s censorship resistance.
Mining pool agreement
Our above discussion basically discusses mining pools and miners as a group, but in fact they also need division of labor and collaboration.The mining pool concentrates the miner’s computing power to mine, and distributes rewards based on the size of the computing power contribution.This collaboration process requires some protocols to cooperate.
In the current common mining pool protocol, such as Stratum v1, the mining pool only needs to distribute a block template (including block header and coinbase transaction information) to the miner, and the miner performs hashing operations based on this template.Currently, there are some tools, such as stratum.work, which can visually see Stratum information of each mining pool.It can be seen that in this process, the miner cannot choose which transactions to package, but the mining pool selects the transactions and builds a template to issue tasks to the miner.
So in the Stratum v1 protocol, we can also roughly benchmark the Ethereum ecosystem: mining pool
-
Miner: assumes part of the responsibility of the proposer (calculate hash)
-
Mining pool: It is both a builder and also uses the hash calculated by the miner, and the final proposal block
How is the future
Some promising solutions have been developed or are underway to reduce the negative impact of MEV on Bitcoin.
New protocols and implementations
In some new mining pool protocols, such as Stratum v2, BraidPool, etc., miners can also choose the transactions to be packaged independently.Currently, some mining pools (such as DEMAND) and mining machines (such as Braiins) have been adopted by Stratum v2, allowing individual miners to build their own block templates, improving the security, decentralization and efficiency of data transmission, while alleviating transaction reviewBitcoin MEV risks brought by it.
Therefore, according to this trend, the role division of mining pools and miners may not evolve in the future according to the Ethereum PBS division of labor.
In addition, Bitcoin Core’s new design in trading pools may also bring new changes, mainly including the most discussed v3 transaction relay strategy and cluster mempool.However, the impact of these new designs, such as the exit implementation of the current Lightning Network channel, is still under discussion.
The impact of mining reward reduction
The reduction in mining rewards cannot be ignored.As block rewards are further reduced in the future, various impacts may have on the network.
Some issues have been paid attention to and discussed earlier by Bitcoin developers, such as the issue of fee sniping, and the mining pool may deliberately re-diggle previous blocks to obtain transaction fees.Bitcoin Core has implemented some anti-process fee sniping, but the current method is not yet perfect.
In addition to native handling fees, alternative assets may also be a channel for future subsidies to mining rewards.Therefore, there are also some projects trying to build some infrastructure, such as Rebar building an alternative public mempool to better identify alternative asset transactions with value.
However, as discussed in the “Out-band Payment” section, the impact of these non-Bitcoin-native economic incentives on Bitcoin’s self-consistent incentive compatibility system remains to be further observed in the future.
anyway,MEVs on Bitcoin may be borrowed from Ethereum, but they will also vary greatly due to factors such as architecture and design philosophy.Bitcoin’s growing practicality, declining block subsidy rewards, and the growing BTCFi ecosystem will focus on MEV factors in the future.
Special thanks
Thank you Jian for your review and suggestions on this article!