Bitcoin Package RBF and Transaction Pinning: Replacement Security for Fee Bumps
Replace-by-fee (RBF) allows a node to consider replacing one or more unconfirmed mempool transactions with conflicting transactions that pay sufficient fees under the node's policy. Package RBF extends the reasoning to related transactions submitted together. These are mempool-policy decisions: they cannot replace transactions already confirmed in a valid block.
Conflicts are more than matching transaction IDs
Two different transactions conflict when they spend at least one of the same inputs. A replacement may also evict descendants of the original mempool transaction, so the node must account for more than a single transaction's fee. Replacement rules can consider the total fees of evicted transactions, the additional relay fee, and constraints on the new package's structure.
An attractive feerate alone does not guarantee acceptance. The package can fail due to topology, resource limits, policy restrictions, conflicting descendants, or an insufficient total replacement fee. The exact requirements depend on node implementation and release.
How pinning complicates fee bumps
An adversary can sometimes attach descendants, construct conflicting transactions, or exploit a policy limit to prevent an honest participant's replacement from propagating. These are pinning attacks. They are especially important in shared-transaction protocols where one participant controls an output or signature needed for the next step.
Package-aware replacement and limited-topology policies can reduce some pinning opportunities, but no generic claim of pinning immunity follows from using RBF. Protocol designers need adversarial tests with realistic transaction graphs and fee conditions.
A safer replacement workflow
First identify the exact outpoints being spent and all relevant unconfirmed ancestors. Then estimate the fees and virtual sizes of the proposed replacement package. Test acceptance on a node matching production software, submit using the supported RPC or relay mechanism, and observe whether the old transaction disappears locally. Track the new transaction's propagation and eventual confirmation separately.
Never equate a successful RPC response with irreversible payment settlement. A peer can have a different mempool view; another conflicting transaction may reach miners; and confirmed blocks, not mempool replacement policy, determine chain history.
Security boundaries
Wallets should not trust unconfirmed incoming payments solely because they are marked non-replaceable. Nor should a wallet allow an external actor to choose arbitrary fee-paying inputs without explicit authorization. For automated systems, enforce spending budgets and maximum fees outside the consensus engine, record replacement chains, and require an independent confirmation policy before final settlement.
Primary references
Bitcoin Core policy documentation: https://bitcoincore.org/en/doc/
Bitcoin Core source, policy and mempool validation: https://github.com/bitcoin/bitcoin/tree/master/src/policy
Bitcoin Core source, validation: https://github.com/bitcoin/bitcoin/blob/master/src/validation.cpp
