River Intelligence

Sign up for our curated weekly newsletter delivering exclusive market insights to your inbox.

Invest in Bitcoin.

green checkmark

Human Support

green checkmark

Track Performance

green checkmark

Recurring Buys

BIP 125 (Replace-by-Fee)


Bitcoin Improvement Proposal (BIP) 125 introduces Replace-by-Fee (RBF) to Bitcoin. This soft fork enables users to replace an unconfirmed transaction with a similar transaction paying a larger fee. Some Bitcoin wallets, such as Electrum, now allow users to use RBF.

When a transaction is broadcast, it pays a defined fee to the miner of that transaction. If the fee is too low, miners will defer mining that transaction in favor of other transactions which paid higher fees.

In order to speed up a transaction’s confirmation, a user can take advantage of RBF to increase the fee of their transaction. Nodes following BIP 125 will accept the new transaction and remove the older version from their mempool.

Before BIP 125, Bitcoin nodes would automatically reject a transaction which attempted to spend UTXOs already spent in a different transaction in their mempool. BIP 125 created a caveat to that rule. However, a transaction must opt into RBF in its first version to make RBF possible. This is done using the sequence, a previously unused field of a transaction input.

A transaction whose input sequences are all 0xFFFFFFFE or greater is not eligible for RBF. If at least one input sequence is less than 0xFFFFFFFE, the transaction may be replaced by fee.
A transaction whose input sequences are all 0xFFFFFFFE or greater is not eligible for RBF. If at least one input sequence is less than 0xFFFFFFFE, the transaction may be replaced by fee.