Ancestor Feerate

The fee rate of a transaction combined with all unconfirmed transactions it depends on. Miners price the package, not the single tx.

Key Takeaways

  • That is an accurate and precise definition. Ancestor feerate is a foundational concept in Bitcoin's mempool management and transaction relay policy. Here is a closer look at why this metric is crucial for the Bitcoin network: How Ancestor Feerate Works In Bitcoin, transactions can depend on unconfirmed predecessor transactions (ancestors). For example, if you receive unconfirmed funds and immediately try to spend them, your new transaction (the "child") cannot be processed until the original transaction (the "parent") is confirmed. The Problem: If a parent transaction pays too low of a fee, it gets stuck in the mempool. Because of dependency chains, the child transaction is also stuck, even if it offers a generous fee on its own. The Solution (CPFP): Child-Pays-For-Parent (CPFP) relies directly on ancestor feerates. By attaching a high fee to the child transaction, the combined ancestor feerate of the package (parent + child) increases. Why Miners Use It Miners want to maximize their revenue per block (measured in satoshis per virtual byte, or sat/vB). Package Mining: Because a miner cannot include a child transaction without also including its unconfirmed parent, they evaluate transactions as connected packages. Ordering: Miners sort these packages by their collective ancestor feerate to ensure they are always mining the most profitable combination of transactions that fit within the block weight limit.
  • The metric referred to here is ancestor feerate (often evaluated as part of package feerate). Here is how that concept breaks down in the context of Bitcoin transactions and fee bumping: The Problem: A user broadcasts a transaction (the "parent") with a fee that is too low, causing it to get stuck in the mempool because miners prioritize higher-paying transactions. The Solution (CPFP): The user creates a second transaction (the "child") that spends the unspent output of the stuck parent transaction. The Metric's Role: Miners don't just look at transactions individually anymore; modern mining algorithms evaluate ancestor feerate (the combined fee of the parent and child divided by their combined virtual size). By attaching a sufficiently high fee to the child transaction, the combined feerate of the package crosses the threshold required to make it profitable for miners to include both in the next block.
  • This update represents one of the most significant structural overhauls in Bitcoin Core's history. Here is a closer look at what the Cluster Mempool and the shift to chunk feerate achieve: Unified Ordering: The legacy mempool relied on two separate, sometimes conflicting metrics—ancestor feerate for inclusion and descendant feerate for eviction. Cluster mempool groups related transactions into connected components ("clusters") and linearizes them into a single, consistent framework. Optimal Chunking: Once a cluster is linearized, it is divided into monotonically decreasing chunks (groups of transactions mined together). This allows nodes to construct more optimal block templates (maximizing miner revenue) and make precise, predictable eviction decisions when the mempool is full. Enhanced Security: By fixing inconsistencies in how packages and replacements are evaluated, cluster mempool significantly strengthens resistance against transaction pinning attacks, which is especially important for the security and reliability of layer-2 protocols like the Lightning Network.

What Is Ancestor Feerate?

The paragraph you shared outlines a fundamental concept in Bitcoin's transaction selection and mempool management known as ancestor feerate. Here is a breakdown of what this means and why it changed how Bitcoin blocks are assembled: The Core Problem Before 2016 In Bitcoin, transactions must follow strict ordering rules: a child transaction (one that spends outputs from a previous unconfirmed transaction) cannot be processed before its parent transaction. Before PR #7600 was merged in June 2016, Bitcoin Core evaluated transactions entirely on an individual basis. This created a major bottleneck: If a user broadcasted a parent transaction with a very low fee, miners would ignore it because it wasn't profitable. Even if the user followed up with a child transaction offering a massive fee to incentivize miners to grab both, miners evaluating transactions individually would still reject the low-fee parent, leaving the high-fee child stranded in the mempool. How Ancestor Feerate Solved It Ancestor feerate shifts the evaluation model from individual transactions to dependent packages. Package Calculation: It sums up the total fees of the target transaction plus all of its unconfirmed ancestors, and divides that by the total virtual size (vbytes) of the entire package. Effective Profitability: This gives miners a true reflection of the revenue per virtual byte they will earn by including the whole chain. If a high-fee child makes the combined package profitable enough, miners will willingly mine the low-fee parent right alongside it. This mechanism is closely tied to CPFP (Child-Pays-For-Parent), a technique wallet users rely on to unstick transactions that were sent with fees that ended up being too low for current network congestion.

How It Works

Cumulative virtual size (vsize) of the transaction and all of its unconfirmed ancestors. Cumulative modified fees of the transaction and all of its unconfirmed ancestors. Cumulative signature operation (sigop) count across the ancestor set. Why Bitcoin Core Caches These Values These aggregate metrics are essential for several core mempool and mining operations: Ancestor Feerate Calculation: By dividing the cumulative modified fees by the cumulative virtual size, Bitcoin Core determines the ancestor feerate. This is the combined fee rate of the transaction and all its unconfirmed parents. Miners use this rate to decide whether the entire package is profitable enough to include in a block template. Child-Pays-For-Parent (CPFP):If a parent transaction has a very low fee and gets stuck, a user can broadcast a child transaction with a high fee that spends the parent's output. The cached ancestor values allow the node to instantly recognize that the child boosts the overall package feerate, making both transactions attractive to miners. Block Template Construction:When building blocks, miners select transaction packages based on these pre-calculated ancestor feerates to maximize mining revenue without violating block weight or sigop limits. Performance and Safety Limits To prevent attackers from exploiting these calculations with deep, complex chains of transactions (which could cause a denial-of-service via excessive resource consumption), Bitcoin Core enforces strict default limits. By default, a transaction cannot have more than 25 unconfirmed ancestors or exceed a cumulative virtual size of 101 kvB (including itself).

The Calculation

Based on the example provided in the paragraph, we can complete the calculation for the child's ancestor feerate and break down the key Bitcoin Core concepts mentioned. Completing the Calculation To find the child's ancestor feerate (also known as the package feerate), we combine the fees and sizes of both the parent and child transactions: Total Package Fees: 400 sats (parent) + 2,100 sats (child) = 2,500 sats Total Package Size: 200 vbytes (parent) + 150 vbytes (child) = 350 vbytes Ancestor Feerate: 2,500 sats / 350 vbytes ≈\approx≈ 7.14 sat/vB Even though the child transaction alone pays a high fee rate of 14 sat/vB, miners must include the lower-fee parent transaction first. Therefore, the effective feerate of the package as a whole is diluted to 7.14 sat/vB. Key Bitcoin Core Concepts Explained Child-Pays-For-Parent (CPFP): A mechanism where a user submits a child transaction with a high fee rate to incentivize miners to confirm an unconfirmed, low-fee parent transaction along with it. Modified Fees: Bitcoin Core allows miners to manually adjust a transaction's priority using the prioritisetransaction RPC command. This can artificially boost or penalize a transaction's effective fee without changing its actual on-chain fee. Ancestor Score: Defined as the minimum between a transaction's individual feerate and its ancestor feerate. This ensures that if a high-fee transaction is dragged down by a low-fee ancestor (like in the example above, where the child's 14 sat/vB rate is dragged down by the parent's 2 sat/vB rate), the network evaluates the package based on its true bottleneck value.

Block Template Construction

This passage highlights a clever optimization used in Bitcoin Core's BlockAssembler to select transactions for a block efficiently and reliably. Why This Technique Is Used Absolute Determinism: Floating-point math can sometimes yield slightly different rounding results depending on the computer's CPU architecture or compiler. In critical software like Bitcoin Core, avoiding floating-point arithmetic ensures that every node calculates transaction priorities in the exact same way. Integer Cross-Multiplication: Instead of dividing fees by size (which results in decimals), the algorithm rearranges the inequality using cross-multiplication: feesAsizeA>feesBsizeB ⟹ feesA×sizeB>feesB×sizeA\frac{\text{fees}_A}{\text{size}_A} > \frac{\text{fees}_B}{\text{size}_B} \implies \text{fees}_A \times \text{size}_B > \text{fees}_B \times \text{size}_AsizeA​feesA​​>sizeB​feesB​​⟹feesA​×sizeB​>feesB​×sizeA​ This allows Bitcoin Core to compare fee rates accurately using only fast, precise whole-number (integer) multiplication.

Historical Ancestor and Descendant Limits

This paragraph outlines a historical mechanism in Bitcoin Core used to handle transaction dependency limits before the introduction of cluster mempool mempool architectures. Here is a breakdown of the key concepts mentioned: Ancestor/Descendant Limits: To prevent denial-of-service attacks that could bog down node memory and CPU cycles when calculating fees and validating transactions, Bitcoin Core historically limited how long a "chain" of unconfirmed transactions could be (e.g., a transaction depending on another unconfirmed transaction, and so on). CPFP (Child-Pays-For-Parent): A fee-bumping technique where the recipient of a transaction creates a child transaction with a high feerate, incentivizing miners to include both the low-fee parent and the high-fee child together. The CPFP Carve-Out: Normally, adding a child transaction that pushed a package past the descendant or ancestor limits would be rejected. The carve-out created a specific exception for a child transaction under 10 kvB that had only one unconfirmed ancestor. Lightning Network Relevance: In a Lightning Network payment channel, commitment transactions are shared between two parties. If one party broadcasts a commitment transaction, both parties might need to independently attach a child transaction to fee-bump it and ensure their funds aren't stuck. The carve-out ensured that neither party was blocked from doing so by standard mempool limits.

Why It Matters

This paragraph outlines how Bitcoin transactions get unstuck when network fees spike unexpectedly. Here is a quick breakdown of the core concepts: The Challenge: When network fees rise rapidly, transactions with low fee rates can get stuck in the mempool for a long time. Replace-by-Fee (RBF): A mechanism allowing the sender to replace a pending transaction with a new one offering a higher fee. However, this requires the sender's cooperation and specific transaction settings. Child-Pays-For-Parent (CPFP): A mechanism allowing the recipient (or anyone else) to take an unconfirmed transaction and spend its output in a new "child" transaction with a very high fee. Miners look at the combined "ancestor feerate" of both transactions, incentivizing them to confirm the whole package. Lightning Channel Force-Closes: When a Lightning channel force-closes, the commitment transaction uses a pre-signed fee rate that might be too low. Parties use anchor outputs to attach a CPFP child transaction, ensuring timely confirmation without needing the counterparty's help.

Mining and Eviction Asymmetry

The paragraph you shared highlights a long-standing architectural mismatch in Bitcoin Core: the gap between how transactions were chosen for inclusion in a block versus how they were dropped when the memory pool reached capacity. The Legacy Disconnect: Ancestor vs. Descendant Feerates Prior to the cluster mempool refactor, Bitcoin Core relied on two separate heuristics that were not perfectly complementary: Block Construction (Highest Ancestor Feerate): When building a block template, Bitcoin Core sorted transactions by their highest ancestor feerate. This ensured that parent transactions were always mined before their children. Mempool Eviction (Lowest Descendant Feerate): When the mempool exceeded its size limit and needed to drop transactions, it sorted by the lowest descendant feerate. Why This Caused Edge Cases Because these two methods used different underlying logic, they created friction: Premature Evictions: The mempool could evict a transaction that a miner would actually want to include because its descendant metric looked unfavorable, even though its overall package economics were sound. Stuck Memory: Transactions that had little to no chance of ever being mined could linger in the mempool because they didn't trigger the specific conditions required for eviction. The Modern Fix: Cluster Mempool The cluster mempool update completely redesigns how Bitcoin Core manages unconfirmed transactions by grouping related transactions into connected components called clusters. Instead of separate sorting rules, clusters are ordered using a process called linearization and broken down into ordered chunks. Under this unified system: Block building takes transactions from the top chunks (highest priority). Eviction removes transactions directly from the bottom chunks (lowest priority). This makes eviction the exact mathematical inverse of mining selection, eliminating the dangerous edge cases caused by legacy heuristics. Cluster Mempool Explained with Peter Wuille This video features an in-depth technical discussion with a Bitcoin Core developer explaining the mechanics of cluster mempool and how it transforms transaction fee estimation.

Transaction Pinning

Ancestor and descendant limits created opportunities for transaction pinning attacks. An adversary could attach many low-fee descendants to a shared transaction, exhausting the descendant limit and preventing the counterparty from adding a CPFP child. This was a significant concern for Lightning Network and other contracting protocols that rely on timely confirmation. V3 transactions (BIP 431) addressed this by enforcing a strict 1-parent-1-child topology, ensuring ancestor feerate accurately reflects incentive compatibility.

Greedy Approximation

Ancestor feerate mining is a greedy heuristic: it picks the best-looking package at each step without considering the global optimum. In rare cases, this greedy approach can miss a more profitable set of transactions. For example, including a mediocre-feerate ancestor package early might consume block space that could have been better used by a group of smaller, higher-feerate independent transactions.

Cluster Mempool: The Evolution Beyond Ancestor Feerate

Bitcoin Core v31.0 introduced cluster mempool, a fundamental redesign that replaces ancestor feerate as the primary ordering metric. Under cluster mempool: Chunk feerate is computed similarly to ancestor feerate but over an optimally determined grouping within the linearized cluster, rather than a simple ancestor chain. This enables more accurate transaction selection and makes RBF policy more principled: replacements must strictly improve the mempool's overall feerate diagram. For a detailed explanation of how cluster mempool works, see the research article on Bitcoin cluster mempool explained. This glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.

0

← All 1876 glossary terms