Transaction Replacement

Transaction replacement swaps an unconfirmed crypto transaction for a new version, usually with a higher fee. Covers RBF signaling, full-RBF policy, and pinning risks.

4 min read
miningmempoolfee-marketRBF

Definition

Transaction replacement swaps an unconfirmed cryptocurrency transaction for a different version before it is mined into a block. In Bitcoin-style networks, the replacement usually spends the same input coins but pays a higher transaction fee. Once a transaction is confirmed, it is part of the blockchain and can no longer be replaced.

How It Works

When a user broadcasts a transaction, network nodes check it and hold it in the mempool. If the transaction pays too little, it may sit behind higher-fee transactions. Replacement gives the sender a way to update that pending transaction instead of waiting for fees to fall.

The most common form is Replace-by-Fee (RBF). The sender creates a new transaction that spends at least one of the same inputs as the old transaction. Because both transactions try to spend the same coin, only one can confirm. Nodes that allow replacement remove the lower-fee version and relay the higher-fee version.

Replacement is not the same as editing a transaction in place. A transaction is signed data, so changing the fee, outputs, or other details creates a new transaction ID. Nodes then decide whether to accept the new version according to local policy. Common policies require a higher total fee and a higher fee rate (more fee per unit of block space).

Opt-In RBF (BIP125)

Bitcoin Core 0.12 introduced opt-in RBF via BIP125. A transaction signals replaceability by setting a sequence number below 0xfffffffe in at least one input. Transactions that do not set this signal are protected from replacement by default BIP125-compliant nodes, giving merchants a way to gauge risk for zero-confirmation payments.

Full-RBF

A long-running policy debate centers on whether nodes should allow replacement of any unconfirmed transaction, regardless of the opt-in signal — a stance called full-RBF. Proponents argue that replacement is a natural part of the fee market and that opt-in signaling adds complexity without meaningfully protecting merchants. Opponents warn that full-RBF makes zero-confirmation payments unreliable for all users, including those who never intended to replace. As of 2025, Bitcoin Core still defaults to opt-in behavior, though some alternative node implementations and mining pools accept full-RBF transactions.

Pinning Attacks

Transaction replacement also introduces attack vectors. In a pinning attack, an attacker crafts a large or low-feerate child transaction that is technically valid but makes replacing a parent uneconomical. Because BIP125 checks both absolute fee and feerate, a pinned transaction can force the honest user to pay an exorbitant fee to outbid the pin. Related techniques like RBF fee-bumping in the presence of Child Pays For Parent chains add further complexity to mempool policy.

Why It Matters

For miners, transaction replacement helps the fee market work efficiently. When users compete for limited block space, replacements can raise fees in a miner’s next block template. A pool that tracks replacements quickly can avoid mining stale, lower-fee versions.

Replacement also affects risk. Merchants and services that accept zero-confirmation payments must understand that an unconfirmed payment may be replaced before it is mined. The opt-in BIP125 signal provides a partial mitigation, but wallets must parse sequence numbers correctly to assess replacement risk. Miners, wallets, and nodes need accurate mempool handling so transaction selection reflects the best valid transactions available.