Child Pays For Parent (CPFP): The technical bridge between ancestors and descendants
Child Pays For Parent (CPFP): The technical bridge between ancestors and descendants
In the previous chapters, we saw how the node tracks "Parents" and "Children." But why does this matter? The most practical reason is Child Pays For Parent (CPFP). Imagine you receive a transaction that pays a very low fee (1 sat/byte). It might stay in the mempool for days. To speed it up, you send a new transaction spending that "Slow" money, and you give the new transaction a Massive Fee (e.g., 100 sats/byte). The miner now has an incentive to mine your "Cheap" parent so they can get the "Expensive" child.
For the Sovereign Architect, CPFP is the "Incentive Bridge." It is the proof that the network's economics can "Pull" slow history forward through the power of future rewards.
Analyzing the Bridge: Fee Aggregation
In the source code, we see how the node calculates the "Package Fee-Rate" for a family of transactions.
/**
* PEDAGOGICAL ANALYSIS: THE INCENTIVE PULLER
* This logic calculates the "Combined Value" of a
* transaction and its ancestors.
*/
void CTxMemPoolEntry::UpdateAncestorState(int64_t modifySize, CAmount modifyFee, int64_t modifyCount, int64_t modifySigOps)
{
// 1. Add the size of the parent to the total "Family Size".
nSizeWithAncestors += modifySize;
// 2. Add the fee of the parent to the total "Family Fee".
nModFeesWithAncestors += modifyFee;
// 3. Update the "Count" (Number of members in the family).
nSigOpCountWithAncestors += modifySigOps;
}
Explaining the Bridge: The Rescue of the Slow
-
"The Family Unit": The Mempool doesn't just see a single transaction; it sees a Package. When a miner looks at your high-fee child, the code tells them: "To get this 100 sat fee, you must also mine the 1 sat parent." The miner does the math and realizes the "Average Fee" is 50.5 sats. This is enough to include the block. It is the Synergy of the Sovereign.
-
"The Rescue Mission": CPFP allows the receiver of money to control the speed of the confirmation. Even if the sender was "Cheap," the receiver can "Sponsor" the transaction. It is the Agency of the Machine.
-
"The Ancestor Score": The node keeps a "Score" for every transaction that includes all its ancestors. This score is what is used for sorting (Chapter 3). A low-fee transaction with a high-fee child will "Float" to the top of the pool. It is the Gravity of the Protocol.
-
"The Technical Complexity": Calculating these family scores is hard work for the CPU. This is why there are limits (25 ancestors). The node must ensure that the "Incentive Bridge" doesn't become a "Resource Drain." It is the Balance of the Core.
The Sovereignty of the Bridge
CPFP is the "Economic Rescue" of the network. It ensures that the market can always find a way to prioritize what matters, even if the original sender made a mistake. As a Sovereign Architect, you know that "The future can heal the past." By utilizing the CPFP logic in your node, you are exercising your power to "Accelerate" the unconfirmed truth. You are the "Master of the Bridge."
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: