If you have ever executed a cryptocurrency transaction, you may have noticed a delay. These delayed transactions are usually held in what is called a mempool. This guide details what a mempool is, how it works, and why it is an essential part of a cryptocurrency transaction.
KEY TAKEAWAYS
• A mempool is like a waiting room where transactions are sent before they are added to the blockchain.
• Each node has its own unique mempool with a list of transactions waiting to be included into a block.
• Most blockchains utilize a mempool, with the exception of many rollups.
- What is a mempool?
- How does the mempool work?
- Mempool dynamics and transaction lifecycle
- Mempool congestion and backlog
- Managing transaction priority fees
- Mempool synchronization and block space
- Mempool size and eviction
- Mempool in Bitcoin and Ethereum networks
- Mempools are key to decentralized transactions
- Frequently asked questions
What is a mempool?
A mempool is like a waiting room on a blockchain’s node where unprocessed transactions are stored. Here, transactions wait in line before they are added to the blockchain. The term mempool is a combination of two words — “memory” and “pool.” In the context of blockchain technology, this pool ensures that unconfirmed transactions are managed efficiently before being added to a block.
Bitcoin was the first blockchain to introduce and utilize the concept of a mempool. Later, other blockchains like Ethereum also adopted the practice. Most blockchains have some type of mempool, even though they may have a different term for it (e.g., the Parity blockchain, Polkadot, uses the term “Transaction Queue” to represent mempools).
An exception to the rule is Solana, which does not have a native mempool. Rollups (e.g., Arbitrum and Optimism) are another example of blockchains that typically do not use a mempool.
Role in blockchain transactions
Mempools play a major role in how blockchain nodes operate. For a transaction to be completed and recorded on a blockchain, it must first be added to a block. However, not all nodes on a blockchain network can create a new block.
In blockchains that use proof-of-work, such as Bitcoin, only miners can add transactions to a new block. As for blockchains utilizing a proof-of-stake mechanism, such as Ethereum, only validators or proposers can add transactions to a block. This process of block validation is crucial for maintaining the integrity and security of cryptocurrency transactions.
After initiating a transaction, users must depend on a miner or a validator to approve the transaction and add it to the blockchain. This doesn’t happen instantly. Instead, there is a delay between the time a transaction was initiated and when it will be completed. During this time, the transaction is stored in a mempool awaiting confirmation.
How does the mempool work?
When a user initiates a transaction, it’s sent to a node. The node will then add the transaction to its mempool and put it in a queue, awaiting validation. Once the transaction is validated, it will be marked as pending. Miners can only add transactions marked as pending to a new block.
You should know that blockchains don’t have just one mempool. On the contrary, every node in a blockchain network has its own transaction memory pool. For instance, each node in the Bitcoin blockchain has its own pool of transactions waiting to be added to the public ledger.
Here is a demonstration of an Ethereum mempool that we constructed. You can filter transactions by fees, addresses, and almost any other parameter that you can think of. This programmability is what makes mempools unique to each node.
Together, mempools in individual nodes make up a collective mempool. This decentralized approach to transaction processing ensures that no single point of failure can disrupt the flow of unconfirmed transactions.
Mempool dynamics and transaction lifecycle
To illustrate mempool dynamics and transaction lifecycle, let’s assume that you want to send 0.01 BTC to a friend.
- First, you will key in your friend’s wallet address, accept the blockchain transaction fees, and then hit Send.
- The transaction will be added to the nearest node’s mempool as a queued transaction.
- Next, the transaction will be broadcast to other nodes in the network, but it will not be available on the blockchain just yet. Instead, every node performs individual tests to check that the transaction is genuine.
- If the nodes approve the transaction, its status changes from “queued” to “pending.”
- Eventually, the pending transaction will be picked by a miner and added to a new block.
- Next, the miner will broadcast this block back to all nodes. As a result, all nodes will now have access to all the transactions included in the new block.
- At this stage, the nodes that still have your transaction stored in their mempools will delete it.
- Finally, your transaction is completed, and your friend receives the 0.01 BTC.
This lifecycle highlights the importance of transaction throughput and the role of blockchain nodes in maintaining the flow of transactions.
Mempool congestion and backlog
Congestion in a transaction mempool occurs when the demand for block space exceeds the number of transactions that can fit in one block. Several factors can trigger a mempool backlog. These include:
- Events or news: Events and news that directly affect the blockchain industry, like token launches, airdrops, or support from famous personalities, can cause sudden spikes in transaction demand. These spikes may lead to a temporary mempool backlog.
- Forks or network upgrades: Network activities like forks or an upgrade to a blockchain network may cause momentary mempool congestion as the nodes in the network update the changes.
- Congestion in the network: If the blockchain network is experiencing high transaction volumes, it will put pressure on the available block space, eventually leading to mempool congestion. For example, the average number of transactions in one block on the Bitcoin blockchain is currently around 3,100. If the number of pending transactions greatly surpasses this number for several hours, the network will get congested, and as a result, the mempools will also get congested.
Understanding these factors and how they impact mempool congestion is important for users and developers. It enables them to anticipate potential delays and make the necessary adjustments to save on gas fees and avoid delays. Plus, it helps manage transaction prioritization and ensure efficient transaction processing.
Managing transaction priority fees
With many transactions occurring at the same time, there are several factors that determine which transactions get prioritized within a mempool. We highlight some of them below.
One of the primary factors determining the order of executing transactions within a mempool is the fees attached to each transaction. Miners and validators are driven by profit, and they get to choose which transactions they want to add to a new block. Unsurprisingly, they favor transactions with higher fees.
Therefore, the fees associated with a transaction heavily influence its chances of being included in a block. Miners normally organize transactions inside their mempools in terms of fees per unit of transaction data
This fee-based approach creates a competitive market within mempools, emphasizing the need for effective transaction prioritization. It forces users to choose between paying higher fees for fast transaction completion or lower fees at the expense of longer waiting periods.
Mempool synchronization and block space
Mempools don’t have to keep a matching list of all transactions waiting to be added to a block. However, they have to know which transactions have already been added to the blockchain so that they can remove it from their mempool.
When a miner broadcasts a new block to the nodes on the network, they can check for this information and thus achieve mempool synchronization. This ensures that only unmined transactions are kept in mempools.
Block space, on the other hand, is the capacity available to include transactions in a new block. Since this space is limited, miners or validators prioritize transactions with higher gas fees while the rest are sent to the mempools awaiting confirmations.
Efficient mempool synchronization is vital for maintaining transaction throughput and ensuring that the blockchain network functions smoothly.
Mempool size and eviction
Every transaction added to a mempool is a piece of data not more than a few kilobytes (kb). The sum of all the bytes making up the transactions is the size of the mempool. A larger mempool size indicates that there are numerous transactions awaiting confirmation. It could also signify a spike in network traffic.
While mempools don’t have a predefined maximum size, nodes can set size limits for their mempools. This is normally set at 300 MB for Bitcoin. When the mempool reaches this threshold, nodes may enforce a minimum transaction fee requirement. Any transactions with a fee rate lower than this limit are evicted from the mempool. By doing so, nodes can avoid crashing due to an overload of pending transactions.
Understanding how mempool size affects transaction fees and times is important since it enables users to pick the best times to carry out a transaction. There are several websites that track the global mempool size on the Bitcoin network, such as BitcoinTicker.co. This approach is the key to optimizing transaction processing and managing transaction backlogs.
Mempool in Bitcoin and Ethereum networks
Now, let’s look at how mempools function in Bitcoin and Ethereum, the two most popular blockchains worldwide.
Bitcoin
All valid transactions sent across the Bitcoin network are not added to the blockchain instantly. They have to wait in the Bitcoin mempool.
Originally, transaction fees in Bitcoin were measured in the number of satoshis per byte of transaction. However, this changed after the SegWit upgrade. Now, transactions in a Bitcoin mempool are measured in weight units. This upgrade introduced what is known as a SegWit feature.
As transactions that use segwit features begin to be used, this change will allow more data to be included per block (with 100% of transactions using segwit features this is expected to be about 2 MB of data per block, however in the worst case could be up to 4 MB of data per block).
In so far as it allows a greater transaction volume, it can be expected to increase the UTXO database more quickly (with 100% of transactions using segwit features, the rate of increase might be expected to approximately double; however because segwit is a soft fork, the worst case UTXO growth is unchanged).
Bitcoin Core
As a result of the upgrade, Bitcoin blocks can now accommodate up to four times more transactions.
Ethereum
Like Bitcoin, the Ethereum blockchain initially utilized the Ethereum mempool to serve as temporary storage for transactions awaiting to be added into a block. However, Bitcoin’s block sizes are limited by size, and Ethereum’s are limited by gas fees.
Additionally, after Ethereum’s move from a proof-of-work to a proof-of-stake consensus mechanism, the network introduced the concept of a block-builder.
Block builders are specialized third-party entities that compile transactions to create an optimized transaction bundle that can form a block. They do so by reordering or including certain transactions in a bundle from a memory pool. Eventually, they offer the bundles to proposers/validators for inclusion in a block at a fee.
The value of a block depends on the transactions it contains. Therefore, it incentivizes block builders to create the most lucrative blocks as they are likely to be prioritized and confirmed quicker by validators. Consequently, like in other blockchains, the more fees you pay on Ethereum, the higher the chances that your transaction will be confirmed sooner.
Mempools are key to decentralized transactions
A mempool is a vital component in blockchain transactions. It acts as a form of a waiting room where unconfirmed transactions await validation and, ultimately, inclusion in a new block. Understanding the mechanics of a mempool, such as transaction queuing, validation, and fee prioritization is essential for cryptocurrency users to optimize their transaction processing and manage transaction backlogs effectively.
Frequently asked questions
Where is the mempool in Bitcoin?
How long can bitcoin be stuck in a mempool?
What is a mempool size?
What happens when a mempool is full?
What is the maximum size of Mempool?
Can transactions be removed from the mempool?
Disclaimer
In line with the Trust Project guidelines, the educational content on this website is offered in good faith and for general information purposes only. BeInCrypto prioritizes providing high-quality information, taking the time to research and create informative content for readers. While partners may reward the company with commissions for placements in articles, these commissions do not influence the unbiased, honest, and helpful content creation process. Any action taken by the reader based on this information is strictly at their own risk. Please note that our Terms and Conditions, Privacy Policy, and Disclaimers have been updated.