MSTR Cat

Blockchain/Level II · Mechanics/2.2 Transactions/Lesson 6

Replace-by-fee and child-pays-for-parent

Bumping fees and the pinning attack

MaterialsA block explorer that shows transaction ancestry (e.g. mempool.space)A wallet that supports fee bumping

Wonder

  1. What can a sender do when a transaction is stuck at too low a fee?
  2. How can a recipient pay for a payment they have not yet received?
  3. What happens when a counterparty deliberately holds your funds hostage in the mempool?

Explore

  1. A transaction broadcast with too low a fee rate can sit unconfirmed for days, or drop out of mempools altogether, while higher-paying transactions confirm around it. Two techniques raise the effective fee after broadcast: the sender can replace the transaction with a better-paying version, or a recipient can spend one of its outputs with a generous fee so that miners take both together.
  2. Replace-by-Fee (RBF) allows the sender to correct an underestimated fee. BIP125 introduced signaling for replaceability via the nSequence field of inputs. Under Bitcoin Core’s replacement rules, a replacement must pay at least the total fees of everything it displaces plus an extra relay fee for its own size, and a higher fee rate than the transactions it directly conflicts with. Bitcoin Core version 24 added ‘full RBF’ acceptance, treating transactions as replaceable even without explicit signaling, which became the default in version 28.
  3. Child-Pays-For-Parent (CPFP) serves recipients who cannot modify an incoming payment. The recipient creates a new transaction spending the unconfirmed output of the stuck parent, attaching a high fee to this child. Miners evaluate the combined package by ancestor fee rate; including the child forces inclusion of the parent, because the child is valid only if its parent is confirmed in the same block or earlier.
  4. The economic logic relies on aggregate value. If a parent pays 1 sat/vB and a large child pays 50 sat/vB, the combined package presents a profitable opportunity for miners to confirm both simultaneously. This allows a recipient to effectively subsidize the miner’s inclusion of their stuck incoming payment, even though they do not yet control the confirmed coins; it requires precise calculation of total weight and fees.
  5. Transaction pinning represents a critical vulnerability in this system. A counterparty can deliberately keep a low-fee-rate transaction with many descendants in the mempool to prevent time-sensitive transactions from confirming before their deadline. In protocols like the Lightning Network, where channel closures rely on specific time-locks, an attacker who pins your closing transaction could potentially steal funds if you are forced to wait past your security window.
  6. Developers have responded with policy carve-outs, version 3 (‘TRUC’) transactions and package relay in recent Bitcoin Core releases, and ephemeral anchors (pay-to-anchor outputs), shipped in Bitcoin Core 28 and 29. These let a low-fee parent travel with a high-fee child as a package. These mitigations reduce, but do not fully eliminate, the ability of malicious actors to pin time-sensitive transactions; pinning affects relay policy, not consensus.

Key facts

  • Child-pays-for-parent lets a recipient speed up an incoming payment by spending its output with a high fee.
  • BIP125 allows replaceability signaling via nSequence fields in transaction inputs.
  • An RBF replacement must pay at least the fees of everything it displaces, plus extra for its own size, at a higher fee rate.
  • CPFP works because miners evaluate parent-child packages by combined ancestor fee rate.
  • Bitcoin Core version 28 made full RBF acceptance the default behavior for nodes.
  • Recent Bitcoin Core versions add package relay and TRUC (version 3) transactions to make fee bumping more reliable against pinning.

Exercise nine, six, three, one

9CollectList 9 scenarios where transaction confirmation speed matters: from retail purchases to Lightning channel closures. Note the deadline and the consequence of missing it.
6ClusterGroup the 9 into 6 by who can speed up the transaction: sender, recipient, either, a third party, a protocol rule, or no one.
3DistillReduce the 6 to 3 fundamental reasons why a transaction might remain stuck in the mempool beyond its expected confirmation time.
1CrystallizeWrite 1 sentence explaining how CPFP creates a financial dependency between two parties who do not trust each other.

Fact check

Dates, figures and claims checked against the published sources listed below.

Open in the interactive academy →

PT ES ZH JA KO RU DE FR MS