What is the Replace-by-Fee (RBF) policy?
The Bitcoin network’s Replace-by-Fee (RBF) policy allows users to replace outstanding (unconfirmed) transactions with new ones with higher transaction fees.
The RBF policy was proposed in BIP 125 and introduced as a feature in the Bitcoin protocol with the release of Bitcoin Core version 0.12.0, which was released in February 2016. This feature provides flexibility to users who want to speed up or change their transactions the compensation in response to network restrictions.
On November 23, 2023, a Bitcoin user made a transaction at 9:59 UTC, paying an exceptionally high transaction fee of $3.1 million to transfer 139.42 Bitcoin (BTC). This exorbitant fee set a record as the eighth highest in Bitcoin history. To put it into perspective, the user overpaid the usual transaction fee by 119,980 times. There are a number of factors at play here:
High selection transaction costs
The sender may have deliberately chosen high transaction fees in an attempt to get confirmation faster or because they miscalculated the fees.
RBF policy
Users can replace a transaction with an unconfirmed transaction at a higher fee under the fee replacement policy. This means that, to ensure faster confirmation, the sender may have chosen to replace the original transaction, which may have had a high fee, with a new one with an even higher fee.
Ignorance of the sender
The sender may not have paid close attention to network conditions or is not fully aware of the consequences of their actions. They may not have expected that the RBF would lead to a significant increase in transaction costs.
Which blockchain networks support RBF?
The RBF capability is useful when Bitcoin users want to speed up transaction confirmation or adjust fees in response to changing network conditions.
Replace-by-fee is a transaction policy embedded in the Bitcoin network protocol and supported by Bitcoin Core, the reference implementation of the protocol. As mentioned, the RBF policy allows users to exchange an unconfirmed Bitcoin transaction for a new one with higher transaction fees.
It is crucial to remember that different wallets and services within the Bitcoin ecosystem can embrace RBF in different ways. For example, although RBF is supported by Bitcoin Core, not all wallets may adopt or offer this feature. To ensure that their wallet or service is compatible with the fee replacement policy, users must confirm the platform’s specifics and guidelines.
Other RBF rules include that the new transaction must keep the same outputs as the previous one and have a higher sequence number for each input to use RBF. Furthermore, RBF only applies to transactions that have not yet been confirmed; Once a transaction has been approved, it cannot be undone. However, because not all nodes and miners can support or recognize RBF transactions, their effectiveness depends on network conditions and miners’ willingness to prioritize higher-fee transactions.
Additionally, specific wallets, such as Trezor, allow users to charge fees for pending, unconfirmed transactions. Additionally, Crypto.com users can use advanced transaction settings to send Ether (ETH) or other ERC-20 tokens, allowing adjustment of the nonce value, gas price, or gas limit. This feature, available in-app version 1.8.2 and above, allows advanced users to adjust transaction parameters.
Users can navigate to the advanced settings via the shipping confirmation screen, adjust values, view expected network charges, and proceed with the transaction. The process involves confirming the customized settings and authorizing the transaction with a passcode and a 2FA code, if enabled.
How does the Reimbursement Replacement Policy work?
Bitcoin users can speed up transaction confirmation by creating a new transaction with a higher fee, signaled by a unique “sequence number,” which, when broadcast, can be prioritized by miners and replaces the original transaction.
The state of the network, miners’ rules, and the level of support from participating nodes and wallets all influence the effectiveness of RBF policies. Here is a detailed explanation of how RBF works:
First transaction confirmation
A Bitcoin transaction is initiated by a user and shared with the network. The transaction is in the mempool waiting to be included in a block by a miner.
Adjustment for transaction costs
The user can start a new transaction with higher fees if he wants to speed up the confirmation process or finds the fees too low.
Replace with reimbursement flag
The new transaction contains a unique “sequence number” in the transaction entry, indicating that it is intended to replace a previous transaction. This sequence number is higher than that of the original transaction.
In the context of Bitcoin, the nSequence field, originally designed for ‘sequence number replacement’ or ‘time locking’, serves two primary purposes. First, to qualify for a charge replacement, a transaction must make its replaceability clear at the time of initial shipment. This is achieved by setting the nSequence field (a component within each transaction) to a value less than 0xffffffe.
In hexadecimal notation, 0xffffffe represents a 32-bit unsigned integer with all bits set to 1 except the least significant bit. In decimal, this value is equal to 4294967294. Second, the nSequence field enables relative lock times for transaction entries, allowing transactions to be updated after broadcast, providing flexibility for adjustments and facilitating RBF.
Broadcasting the replacement transaction for the miners’ consideration
The user broadcasts the replacement transaction to the Bitcoin network. Miners who select transactions for block withdrawal can see the replacement transaction with the higher fee. They may decide to include the replacement transaction in a block because they have an incentive to include transactions with higher fees.
Transaction confirmation
The original transaction is replaced when the replacement transaction is included in the block. The replacement transaction is not validated and is essentially “kicked” out of the mempool.
How can I enable and disable RBF?
To enable RBF in a Bitcoin wallet, users need to verify support, access settings, enable RBF option and adjust fees, while disabling RBF involves accessing settings, disable RBF option and ensure that it is not activated by default.
Enable RBF
Users must ensure that their selected wallet supports RBF before enabling this feature. The wallet settings can usually be accessed from the Advanced or Transaction Preferences section.
The user must look in the settings for an RBF option, usually “Replace for a fee” or a similar term, and enable it. Users can then broadcast the transaction to the network and change the transaction fee if there are problems confirming the transaction.
Version 21.2.2 of the Trezor Suite provides on-device support for the Trezor Model T (firmware 2.3.5 and higher) and the Trezor Model One (firmware 1.9.4 and higher). Users can use RBF to complete the transaction or increase the fee.
RBF due to production reduction in Trezor
Through output reduction, RBF deducts the additional fees from the transfer amount instead of from the account balance when sending the maximum amount of Bitcoin from one account.
RBF with Trezor devices in Electrum
Users can use RBF with Trezor devices in Electrum, replacing the original transaction. However, this replacement is only possible if the initial transaction was performed using Electrum with the “Replace for Fee” option enabled, accessible via Tools > Preferences > Replace for Fee.
Disable RBF
On the other hand, the user must access the wallet settings to disable RBF. Disabling RBF should be possible via the advanced options or transaction preferences. This option may be titled ‘Replace for a fee’ or something similar.
To ensure that this functionality is not activated by default on newly executed transactions in the wallet, the user must disable the enabled option. Please refer to the documentation or support resources for the respective wallet to obtain current and accurate information on how to enable or disable RBF.
Disadvantages of the fee-for-service replacement policy
The RBF policy in Bitcoin allows post-transaction rate adjustments, but raises concerns about double spending, user confusion and network congestion.
RBF is concerned about possible double spending, as users can replace an unconfirmed transaction with a new one with higher fees. This risk makes it difficult for sellers or recipients of transactions to decide which transactions are legitimate, which can lead to fraud and misunderstandings.
RBF can complicate the user experience because people who are unaware of its operation can inadvertently replace transactions or experience delays. Additionally, this feature makes it more difficult for companies to accurately predict confirmation times, as it reduces the reliability and predictability of transactions.
The efficiency of the network as a whole can also be affected by users routinely replacing transactions with high fees, which can also cause congestion. Furthermore, RBF’s vulnerability to abuse, which could allow unscrupulous parties to abuse the system for financial gain, highlights the need for careful use and user education.