Bitcoin Mempool: How Do Transactions Work?

Bitcoin is a cryptocurrency network that allows users to send and receive electronic payments anywhere in the world. There are no physical bitcoins, no accounts that hold bitcoins. Instead, Bitcoin acts as a form of electronic money and users can make peer-to-peer (P2P) transactions using bitcoin blockchain, which acts as a kind of e-book. The blockchain is constantly being updated by nodes that exchange updated balances and data across the entire network. However, before transactions can be added to the blockchain, they must go to the mempool.

How does Bitcoin transaction work?

Before moving on to the mempool, let's understand how a bitcoin transaction works. All bitcoin transactions are simply pending transactions that only exist in the mempool until they are confirmed. Every time a user initiates a bitcoin transaction, it is signed with a cryptographic signature and sent to the bitcoin network, waiting for a miner to confirm the transaction and add it to the blockchain. Every verified transaction is publicly available on the public ledger as a means of transparently recording and distributing every Bitcoin transaction on the ledger without the possibility of manipulation.

Blockchain technology makes decentralization possible, but it has its limitations. For example, the Bitcoin network processes about 4,6 transactions per second.
Transactions per second (GST) is the number of transactions that the blockchain network can process every second.
Compare this to VisaNet, which handles 1 TPS. Despite the possibility of some adaptation to improve the scalability of blockchain technology, the system remains relatively slow, which leads to high fees and periodic delays, especially during periods of high transaction volume.

Blockchain was originally designed to enable Bitcoin to operate without banks, government oversight, regulators, or other central authorities. Although Bitcoin does not need external authorities to operate, it still needs to be able to verify transactions, which it does with cryptographic keys.

Bitcoin's public key cryptography acts as an identification of users, allowing them to access their wallets or accounts, and mainly ensures the integrity of transactions. Each user has a private key for his own use and a public key that is visible to all users of the system. Together, these keys act as a digital signature to authenticate transactions.

When two users agree on a particular transaction, the next step is authorization. Every transaction must be authorized before it can be added to the blockchain. This is done through consensus, which means that all decentralized parties, such as computers on a network, or nodes, must objectively agree that a transaction is authorized and valid. Node owners (miners) are encouraged to verify unconfirmed transactions through proof of work consensus, or PoW, which requires them to solve cryptographic problems or complex mathematical puzzles.

Once this task is completed, the transaction is confirmed and can be added to the block. When a Bitcoin block is full, it is added to the blockchain, which is called finalization, and the next block is opened.

What is Bitcoin's Mempool?

Mempool, or memory pool, is a virtual waiting room where confirmed transactions are collected while miner will not process them to be added to the next block. Each node maintains its own mempool, and each node has its own storage capacity for uncommitted transactions. When a transaction is confirmed and included in a block, it is removed from the mempool.

The nodes share mempool data, passing signed transactions to each other until they reach the entire network. When the shared mempool reaches full capacity during periods of high transaction volume, the node prioritizes transactions based on transaction fees that are above the threshold. All transactions, the cost of which is below the threshold, are removed from the pool, and only new transactions are added to the pool, the cost of which meets the minimum. In other words, transactions with a higher fee have priority to be processed and removed from the mempool and added to the block.

The relationship between Bitcoin's mempool and transaction fees

If you think of a mempool as a waiting room, then when it is overloaded, there will be a lot of transactions waiting to be cleaned up. Typically, transactions smoothly move into and out of the pool as they are verified and added to the block, but sometimes the pool can be overwhelmed.

Congestion periods are usually associated with either a large number of transactions or a sharp decrease in the hash of a transaction. During such periods, the mempool becomes congested, delays can occur, which leads to an increase in fees.

The term “trade hash” refers to the difficulty of mining a blockchain. At this point, there may not be enough miners to handle the complexity or congestion of the blockchain. Therefore, it takes longer to confirm some transactions.

Every Bitcoin transaction stays in a mempool until it's ready to be confirmed, but there is no single, all-encompassing mempool. Each node has its own memory pool, and the default is typically less than 300 MB.

When the pool is full, users have the option to pay a higher fee, which can push their transactions to the front row for faster confirmation. On the other hand, transactions with lower fees remain in the mempool, where they will remain unconfirmed until the congestion decreases. Likewise, during peak times when the transaction volume is low, fees are correspondingly lower. After the transaction is committed and added to the committed block, it is removed from mempool.

You can check the status of the BTC transaction here.

Understanding the size of the memory pool and the number of transactions

The size of the mempool in bytes is a metric to estimate how long the network congestion will last, while the graph of the number of mempool transactions gives a clear indication of the flow of transactions causing the congestion. The larger the mempool size, the more congested the network is, resulting in longer average confirmation times and higher priorities required to add transactions to a block. However, if the size of the mempool decreases, this means that the node has received a new valid block and eventually removed the pending transactions contained in the block from the mempool.

Typically, the mempool size can fluctuate as it depends on the number of transactions that are being transferred. Since each node also has its own view of deferred transactions depending on its ability to store unconfirmed transactions, this also explains why the mempool size varies.

Mempool transaction counter
In contrast, if the number of transactions in the pool increases, it means that the total number of unconfirmed transactions in the pool grows. Thus, a higher fee is charged. For example, on October 4, 2021, there were 4,25 thousand unconfirmed transactions in the Bitcoin mempool, and the average transaction fee was $ 2,45. Compare this to October 25, 2021, when mempool peaked at 6,6K transactions and an average transaction fee of $ 3,09.

Average Bitcoin Transaction Fee

What to do when transactions are overloaded?

During periods of peak traffic, a significant number of transactions can accumulate on the Bitcoin network, which increases latency and increases transaction fees. When demand exceeds supply, miners have considerable freedom to choose which transactions they will process first. In scenarios like this, even those who paid a generous commission may wait longer than expected.

Several factors contribute to the occurrence of delays, including the fact that the Bitcoin blockchain is not easily scalable, which means it is also easily overloaded. During periods of high overload, you have the option of simply waiting it out, or switching to Lightning Network to perform small transactions off the main chain, or pay a higher transaction fee.

Once a transaction has been submitted, you are left with several options that can speed up the transaction. If your transaction is stuck in the queue, you can move forward with the Replace-by-Fee option, or the RBF option, which allows you to resubmit the transaction with a higher fee. However, not all wallets support this option. If yours is not supported, you will need to consider alternatives such as child pays for parent, or CPFP. When using CPFP, miners choose transactions with the highest total commission. You can also use a transaction accelerator that allows you to send transactions worth at least 0,1 mBTC per kilobyte to the ViaBTC mining pool for priority confirmation.

Finally, you can use the Lightning Network, which is a second tier solution. The Lightning Network allows you to open a new channel, conduct as many transactions as needed outside the chain of the regular Bitcoin network, and then close the payment channel when the transactions are confirmed. With the Lightning Network, you can essentially skip a congested queue, and your fees can also be significantly lower.

If neither the Lightning Network nor any other solution is suitable, rest assured that even with stalled transactions, your bitcoin will not be lost. It will remain in your wallet until the transaction is confirmed.

What if the mempool didn't exist?

Each transaction must go through a mempool before it is added to the blockchain. During periods of high traffic and congestion, mempool collects and stores transactions until miners can add them to the block.

The mempool also allows nodes to access other nodes' mempools, giving them the ability to obtain more detailed information about specific transactions before they are confirmed. While most users want to spend as little time as possible in the mempool, this is not always possible - especially when more transactions are coming in than can be cleared promptly. When a block is mined, all transactions contained in it are cleared from the mempool, which reduces its size accordingly.

Without the mempool, nodes would not be able to view incoming transactions and would have no idea how congested the blockchain network is. It would be impossible to understand or pinpoint the source of congestion, high fees, and other network congestion issues.

Сonclusion

Waiting for a transaction can be annoying. While you might be tempted to blame it all on the mempool, this is a critical function of the Bitcoin network as it is used to aggregate and store transactions until they are ready to be added to the blockchain. Understanding how mempool works will help you use it to your advantage to ensure that transactions are processed on time - and lessen your frustration if they aren't.

Rate this article
Blockchain media

  1. Jacques

    J'attends un transferts de gains et capital placé en bourse depuis 1 mois est-ce un délai habituel pour une somme de 63.000 E environ?
    Thank you for your reply.

    Reply