Blockchain/Level II · Mechanics/2.2 Transactions/Lesson 5
The mempool
The local waiting room that every node manages independently
MaterialsA block explorer with a mempool view (e.g. mempool.space)Optional: a Bitcoin Core node (‘getmempoolinfo’)
Wonder
- Why does a transaction valid on one full node get rejected by its neighbor?
- What happens to the lowest-fee transactions when a node hits its memory limit?
- How do miners decide which unconfirmed transactions deserve space in their next block?
Explore
- The mempool is not a central database; it is a local, in-memory list maintained independently by every full node. Bitcoin Core drops unconfirmed transactions that linger too long: 72 hours when expiry was introduced in version 0.12, two weeks (336 hours) since version 0.14. Two nodes that received transactions in a different order, or run different settings, hold slightly different mempools.
- Each node applies consensus rules (like valid scripts and no double-spending) alongside local policy rules, such as minimum fee rates and RBF settings. If a transaction does not meet a specific node’s minimum fee-rate threshold, that node will reject it or evict it if already included, even if other nodes accept it.
- By default, Bitcoin Core limits the mempool size to 300 MB via the ‘maxmempool’ parameter in the bitcoin.conf file. When this limit is reached, the node dynamically raises its minimum fee threshold to make room for more profitable transactions, expelling the least valuable ones first. Run ‘getmempoolinfo’ and observe how ‘mempoolminfee’ rises above the static ‘minrelaytxfee’ when the pool fills.
- Miners select transactions from their own mempools to build blocks, prioritizing the highest fee per virtual byte, evaluated together with any unconfirmed parent transactions. When a valid block arrives, every node removes the confirmed transactions, and any conflicting ones, from its pool.
- Policy is not consensus. A transaction that most nodes refuse to relay, because it falls below their fee floor or uses a non-standard form, can still be valid in a block, and some miners accept such transactions directly. So each node’s mempool is only an estimate of what the next block will contain, and different nodes may disagree at the margins.
- At shutdown, Bitcoin Core saves its mempool to a file, mempool.dat, and reloads it at startup, discarding anything that is no longer valid, so a restarted node does not begin with an empty pool. To watch the mempool at work, open mempool.space: its projected blocks show what miners are likely to include next, and each new block clears the top layer.
Key facts
- The mempool is a local memory pool on each node, not a single universal service.
- Bitcoin Core defaults to a 300 MB limit for the mempool size via ‘maxmempool’.
- Bitcoin Core drops unconfirmed transactions after two weeks by default (336 hours, since version 0.14).
- Nodes apply both consensus rules and local policy rules, including minimum fee rates.
- When the mempool is full, nodes dynamically raise fee thresholds to evict less profitable transactions.
- Bitcoin Core saves its mempool to ‘mempool.dat’ at shutdown so it survives a restart.
Exercise nine, six, three, one
9CollectList 9 distinct unconfirmed transactions from a block explorer’s mempool view. Note their current fee rates, sizes in virtual bytes, and confirmation counts (all zero).
6ClusterGroup the 9 transactions into 6 categories based on why they might be stuck: low fee rate, high size, RBF signaling, unconfirmed inputs, orphan status, or other policy reasons.
3DistillReduce the 6 groups to 3 core reasons a node would reject or evict a transaction from its mempool despite it being consensus-valid.
1CrystallizeWrite 1 sentence explaining how local policy differences between nodes create a fragmented, non-universal view of pending transactions across the network.
Fact check
Dates, figures and claims checked against the published sources listed below.
- Bitcoin Core documentation: -maxmempool and -mempoolexpiry configuration parameters
- A. M. Antonopoulos & D. A. Harding, Mastering Bitcoin, 3rd ed. (2023)
- mempool.space documentation on real-time mempool visualization