Have you ever wondered what happens to Bitcoin transactions before they are confirmed? It is added to the waiting room along with some other unconfirmed transactions. This waiting room, called Mempool, is an integral part of the Bitcoin mining process. A mempool or memorypool is a mechanism for storing information about unconfirmed transactions. These transactions have been validated but are not yet in the blockchain.
Transactions are not added to the blockchain as soon as you make a payment. They are first sent to the peer node for verification. Each node verifies the cryptographic signature and checks if the funds are available. When the check is complete, the transaction will be broadcast to nearby nodes again. The goal is to send transaction data to as many nodes as possible. This helps the node reach consensus on the validity of the transaction.
If the transaction is invalid, the node simply drops the transaction. This can happen if the sender’s wallet is out of balance or the recipient’s public key is invalid. On the other hand, if the node can consider the transaction valid, the transaction is moved to mempool and the mining node can retrieve it and package it in a block.
What happens to the transaction when it reaches the mempool?
In the utopian world, miners receive a transaction as soon as it reaches the mempool and add it to the blockchain in 10 minutes (Bitcoin block time is 10 minutes). However, this usually does not happen. This is because there are thousands of other transactions in mempool waiting to be confirmed.
Therefore, if the size of the mempool is very large, the transaction can remain unconfirmed for some time. In addition, if the transaction stays in the mempool for a long time, it will eventually be deleted. This is because the mempool is valid for 2 weeks. Transitions remaining in mempool for more than 2 weeks will be canceled and funds will be returned to the wallet.
How big is the mempool?
Each transaction sent to mempool is a data package of no more than a few kilobytes (kb). Adding these bytes will reach the current size of the mempool. The large size means that we are waiting for multiple transactions to be confirmed. It may also indicate an increase in network traffic, with more transactions being added to mempool than seen. In this case, you will have to pay more transaction fees to confirm the transaction preferentially.
There is no such maximum size, but the node can set a size limit on the mempool. This limit is usually 300MB. When the mempool reaches this limit, the node may allocate a minimum transaction fee. Transactions that do not meet this limit will be removed from mempool. It also prioritizes transactions according to transaction fees. This helps miners choose preferred transactions.
It’s a good idea to see how the size of the mempool affects the time and price of a transaction, and to check this factor before sending a transaction. On some websites you can see the size of the mempool on the Bitcoin network. More popular options include BitcoinTicker.co, Jochen-hoenicke.de, and Blockchain.com.
Importance of mempools
Mempool is advantageous for both miners and users. These help miners get transactions based on priority. This is useful if you have a lot of traffic on your network. The miner can also download the current “transaction wait list” and start checking transactions. For users and networks, mempool provides resistance to DDoS attacks. These attacks occur when a malicious attacker floods the network with very few transactions, causing unmanageable congestion.