CWhen a user of cryptocurrencies make a transaction, the first place where this is noted is in what is known as mempool. A mempool is an intermediate temporary memory where user transactions are momentarily stored. Once the transaction arrives at this place, the miners select them to process them. It is at this last point, when the transaction really becomes effective and becomes integrated into the blockchain.
Bearing this in mind, we can say that mempool is a "waiting room". One in which the transactions are stored until they are processed by the miners. But How does it work? What use does it have? We will review all of this and more in this article.
How does a mempool work?
As we have commented in the beginning, a mempool is a temporary storage space for cryptocurrency transactions. This is a fairly simple task to perform. In Bitcoin for example, the functions of a mempool are regulated by the BIP-35. Let's remember that a BIP
, is a document that standardizes various procedures or functions within Bitcoin. To better see how a mempool works, it is best to divide it into phases as follows:
First phase: Receipt of the transaction.
In this first phase, mempool receives the transactions generated by users within the network. Remember that each user uses their wallet to create a cryptocurrency transaction. This is a simple process that takes no more than 10 seconds to complete. Once this operation is completed, the transaction begins its long journey to confirmation. For this, the transaction is transmitted to the network so that it can process it.
Now imagine the same process but on a much more massive scale. Imagine that hundreds of thousands of users at the same time perform the same activity in a relatively short period of time. This obviously generates high transaction traffic on the network. Traffic that must be handled in the most efficient way by the next phase of the process.
It is here where mempool plays its first important role in receiving and storing all these transactions. All in order that in due time they are effectively served and processed by the miners.
Second phase: Access to transactions
During this phase, the cryptocurrency miners learn about each of the transactions that have been made by users. Each and every one of these transactions are in the mempool waiting to be processed.
To do this, miners access the mempool and begin to select the transactions to include in the next blockchain block. With each chosen transaction, the mempool is freed up in space and the network is balanced. In a nutshell, the fewer transactions in the mempool, the less pressure on the network and the faster the confirmations. This is why when a mempool is "full," confirmations usually take longer.
To explain it more simply, imagine the following. You are in a public waiting room waiting to be seen. There are several care agents in the room who quickly process your requests. If there are few people in the waiting room, the agents will be able to resolve your request quickly. However, if the waiting room is crowded, officers will take longer to attend to you.
Well, it is precisely what happens in the mempool and the network of miners. The resolution of the transactions by the miners (the agents) is very fast. However, miners will take longer to confirm their transaction if the mempool is crowded. This situation leads users to pay more commissions in order to take a higher priority for miners. The higher the commission, the greater the probability of being quickly chosen to process your transaction. A competitive situation that we can see markedly in the rise in commission prices when the mempools are at their limits.
What is the use of mempool?
The main utility of a mempool, is its ability to store network transactions so that they can be processed later. This allows users to carry out their operations with total comfort and know that they will receive the appropriate response in due course.
Secondly, mempool is a good way to equalize the level of commissions in the network. With a little used mempool and a decongested network, the value of the commissions falls. But with the increase in transactions and a greater occupation of the mempool, the commissions rise. This is because users begin to pay higher commissions so that their transactions take priority.
Another usefulness of mempool is linked to the level of security and resistance against DDoS attacks. For example, the mempool can be limited to receive a certain number of transactions. This prevents the network from becoming oversaturated and access to it by those who use the network is violated.