Cluster Mempool

A Core redesign that groups related transactions and orders the packages by fee, replacing single-transaction ordering.

Basically

Cluster mempool changes how Bitcoin Core handles transactions waiting to be mined. It groups related transactions so they can be ordered more effectively by fee.

Key Takeaways

  • Cluster mempool replaces Bitcoin Core's legacy mempool architecture. It groups related unconfirmed transactions into clusters, allowing globally optimal fee-based ordering for mining, eviction and Replace-by-Fee evaluation.
  • Each cluster is linearised and split into chunks sorted by descending feerate. Mining selects the best chunks first, while eviction removes the worst chunks first, making the two operations exact mirrors.
  • Cluster mempool shipped in Bitcoin Core 31.0 in April 2026. It resolves long-standing issues including transaction pinning, suboptimal block templates and the need for CPFP carve-out hacks.

What Is Cluster Mempool?

Cluster mempool redesigns how Bitcoin Core organises and prioritises unconfirmed transactions in the mempool. It groups all related transactions, meaning those connected through parent-child spending relationships, into clusters rather than tracking each transaction's ancestors and descendants independently. Each cluster is a connected component in the transaction graph.

Suhas Daftuar and Pieter Wuille at Chaincode Labs were the primary developers of the redesign, which took multiple years. The legacy mempool used ancestor feerate for mining and descendant feerate for eviction, two methods that could contradict each other. These conflicting orderings could evict the very transactions that would be most profitable to mine.

Cluster mempool unifies all mempool operations under one consistent ordering derived from cluster linearisation. This produces better block templates, more accurate fee estimation and stronger resistance to transaction pinning attacks.

How It Works

Cluster mempool uses three core concepts: clusters, linearisations and chunks. Together, they provide one framework for deciding which transactions belong in the next block and which to evict when the mempool is full.

Clusters

A cluster is a connected component in the mempool's transaction graph. Transactions A and B belong to the same cluster if B spends an output of A. If transaction C spends an output of B, all three form one cluster, and any two transactions connected through a chain of parent-child relationships are grouped together.

Bitcoin Core 31.0 limits each cluster to 64 transactions and 101,000 virtual bytes. These limits replace the legacy per-transaction caps of 25 ancestors and 25 descendants. Those caps were insufficient because a fully connected component could still grow arbitrarily large despite the individual limits.

Linearisation

Linearisation produces a topologically valid ordering of transactions within a cluster, optimised so the highest-feerate subsets appear first. A topologically valid ordering places every parent transaction before its children because a child cannot be mined without its parents.

Finding a truly optimal linearisation is computationally expensive, with worst-case complexity of O(n × 2^(n/2)). Bitcoin Core uses practical polynomial-time algorithms instead.

The 64-transaction cap on clusters means re-linearisation only needs to run on the affected cluster when a new transaction arrives. It does not need to run across the entire mempool.

Chunks

A linearised cluster is divided into chunks, which are groups of consecutive transactions in the ordering that would be mined together. The chunking algorithm runs in O(n) time by iterating through the linearised transactions and merging consecutive chunks whenever a later chunk has a higher feerate than the preceding one. Within a cluster, chunk feerates decrease monotonically.

The chunking process produces a feerate diagram, which plots cumulative transaction size in vbytes on the x-axis against cumulative fees on the y-axis. The feerate diagram is the key data structure for comparing mempool states. A replacement transaction is accepted only if the resulting mempool's feerate diagram is strictly better than the current one.

Unified Ordering

Clusters are linearised and chunked so that all mempool operations use the same ordering. Mining and eviction become exact mirrors, with the first chunk evicted guaranteed to be the last chunk that would be mined. These changes remove the contradictions of the legacy system.

What It Replaces

The legacy mempool maintained two separate ordering systems that frequently contradicted each other. One used ancestor feerate for mining, while the other used descendant feerate for eviction.

These orderings could produce absurd results. The transaction with the lowest descendant feerate, making it first to be evicted, might simultaneously have a high ancestor feerate, making it one of the best to mine. The legacy system could therefore evict the most profitable transaction in the mempool.

The old ancestor and descendant limits of 25 each also created practical problems. They forced artificial constraints on transaction chains and enabled pinning attacks. An adversary could attach low-feerate descendants to a victim's transaction, making RBF replacement expensive or impossible.

Better Block Templates for Miners

Miners benefit directly because block templates now reflect a globally optimal fee ordering. The legacy ancestor-feerate heuristic could miss profitable transaction combinations and leave fees unclaimed. Cluster mempool's chunk-based selection captures the full value of complex transaction dependency chains.

Improved Fee Estimation

Fee estimation becomes more accurate when the mempool has a single, consistent ordering, so applications and wallets can better predict the feerate a transaction needs for inclusion in the next block. Bitcoin Core 31.0 also lowered the minimum fee rate bucket from 1 sat/vB to 0.1 sat/vB, matching the default minimum relay fee. You can read the Bitcoin fee market dynamics research article for more on how fees interact with block space demand.

Lightning Network and Layer 2 Protocols

Protocols such as Lightning channels and other Layer 2 systems depend on predictable mempool behaviour and benefit from more rational transaction ordering. Force-close transactions and their fee bumps are organised within cluster boundaries, making their interactions more predictable.

The CPFP carve-out allowed a single additional child transaction to exceed package limits, but it was incompatible with cluster mempool and has been removed. TRUC (Topologically Restricted Until Confirmation) transactions, defined in BIP 431, replace it. TRUC transactions use nVersion=3 and enforce a strict one-parent, one-child topology with "sibling eviction", replicating carve-out functionality more cleanly.

Transaction Pinning Resistance

Transaction pinning is an attack where an adversary manipulates mempool policy to prevent a victim's transaction from confirming or being replaced. The legacy mempool's complex rules, including the no-new-parents requirement for RBF and ancestor/descendant limits, created multiple pinning vectors.

Cluster mempool's feerate-diagram-based RBF evaluation eliminates many of these vectors. A replacement is accepted if it makes the mempool strictly better as measured by the diagram, regardless of whether it introduces new unconfirmed parents or changes the cluster topology.

Inspecting Clusters

Bitcoin Core 31.0 introduced new RPC commands for inspecting cluster mempool state. Node operators, miners and developers can use these commands to understand how transactions are grouped and prioritised. The feerate diagram endpoint is particularly useful for evaluating whether a proposed replacement would be accepted.

Cluster Size Limits May Reject Valid Transactions

The 64-transaction, 101 kB cluster limit means a new transaction will be rejected if it would merge two large clusters or push an existing cluster over the limit. Applications that create long chains of unconfirmed transactions need to account for these constraints. The limits are configurable via Bitcoin Core's debug command-line arguments, but the defaults are what the network broadly enforces for relay.

CPFP Carve-Out Removal

The removal of CPFP carve-out is a breaking change for Lightning implementations that relied on it. Node software must migrate to TRUC (v3) transactions so both channel parties can still fee-bump commitment transactions. Lightning implementations including LND and Core Lightning have been updating to support this transition.

Linearisation Quality

Optimal linearisation is computationally infeasible for larger clusters, so the practical algorithms are heuristic approximations. In rare cases, the linearisation might not capture the true optimal ordering, and a slightly suboptimal set of transactions could be selected for mining. The 64-transaction cluster cap keeps this error small in practice.

Transition Period

Nodes running older Bitcoin Core versions still use the legacy mempool, so the network will have mixed behaviour during the upgrade period. Transactions valid under cluster mempool rules might be rejected by legacy nodes, and vice versa. This divergence will diminish as adoption of Bitcoin Core 31.0+ spreads.

The glossary entry is for informational purposes only and does not constitute financial or investment advice. You should always do your own research before using any protocol or technology.

0

← All 1876 glossary terms