Skip to content

MemPool

  • by
What Is The MemPool?

What Is The MemPool?

The MemPool, short for memory pool, is a short-term database of unconfirmed transactions that is kept by each node.

Although the term “MemPool” is frequently used, there is no common pool shared by all bitcoin nodes. Each node keeps their own record of unconfirmed transactions. When a bitcoin miner finds a new block, they select transactions from the mempool to include in that block. Since miners have an incentive to maximize revenue, it stands to reason that they’ll prioritize transactions that pay the highest fee rate. In the event that a transaction is taking too long to confirm, either the sender or the receiver can use one of the fee bumping methods to incentivize a miner to confirm their transaction sooner.

Pending Transactions

When a transaction is broadcast, it is sent from a node to its peer nodes, who then send it to their peers. This cycle repeats until the transaction has spread widely enough for every node to add it to their own mempool. This buffer zone is essential because it allows nodes to relay all pending transactions to their peers before the next block is mined. While transactions are waiting in the mempool, nodes check each transaction to ensure that they comply with the bitcoin consensus rules. These checks include verifying signatures, ensuring that outputs do not exceed inputs, and that UTXO has not been spent before. If a transaction does not meet these criteria, it will be rejected. If a transaction is compliant, it will remain in the mempool until a miner includes it in a block and adds it to the blockchain.

Fee Market

The MemPool acts as a form of transaction fee marketplace, allowing individuals sending transactions to see how much demand there is for limited block space at the moment. Because block capacity is limited to 1 MB, each block results in a bidding war between those sending transactions. On-chain fees are calculated by fees per byte commonly known as the fee rate. Fees can be estimated by looking at the transactions that haven’t been confirmed yet.

Anyone sending a transaction is able to examine current mempool congestion to make an informed decision about how high/low of a fee rate to pay. Senders can get a sense of how fast their transaction will be added by looking at the spread of fees at any particular time. The transaction that pays the highest fee rate gets put to the blockchain first, followed by those that pay a lower fee rate.

Transaction fees tend to climb when more transactions join the mempool (increasing demand) in order to get into the next block. If the mempool clears out and the number of outstanding transactions decreases, transaction costs are expected to decrease (decreasing demand). Bitcoin wallets that offer custom miner fees not only enable their users to prioritize transactions more precisely but they create a more efficient fee market overall and are helping bitcoin to scale.