In this article, we will look at where transactions are temporarily stored and wait to be finally incorporated into a block by a miner.

The mempool briefly explained

Mempool is the abbreviation for "memory pool". A mempool is very closely linked to the mining process. You can think of it as a waiting area where transactions remain until they are selected for a block by a miner. If you want to read more about what mining is, take a look at the following article.

There is no such thing as "a mempool"

For example, if a transaction is sent from Alice to Bob, the node checks whether the transaction complies with the rules of the network and the history of the blockchain. If there is a conflict with other transactions, there are not enough funds for a transfer or the signature is invalid and it is not possible to check whether the BTC amount can be spent, the transaction is considered invalid and is rejected by the node. If the transaction is valid, it is stored by the node in its mempool and forwarded to other nodes. Here you can see how quickly valid transactions are forwarded from node to node.

As distribution in a decentralized network takes a certain amount of time, different nodes do not have the same mempool of transactions at a certain point in time. The nodes may not all have received the same transactions, so each node in the network may have a different copy of the mempool.

Therefore, one cannot speak of "a mempool", but rather of "the mempool".
The verified transactions remain in the mempool until they are selected by a miner and added to the next block.

Inclusion of the verified transaction in a block

The inclusion of a verified transaction in a block depends on the decision of the miners and, above all, on the financial incentive of a transaction for the miners, i.e. the fee that is used for the transaction. In addition to the block subsidy, the transaction fees are part of the miners ' reward for their work.

Mempool and blockchain explorers such as bits.monospace.live or mempool.space visualize, among other things, the unconfirmed transactions. Specific information can be determined for each transaction.

The transaction identifier (TxID) is comparable to the fingerprint of the transaction. You also receive information about the number of inputs and outputs and the total amount of the transfer. Finally, the fee rate used and the fees paid as well as the size of the transaction and the storage space occupied by the transaction are also revealed. The space in a block is limited. With the SegWit(Segregated Witness) upgrade, the concept of maximum block size (1 MB) was eliminated and replaced by the maximum block weight (4 MB). The miners decide which transactions to select for their potential block. Miners therefore have an economic incentive to prioritize the transactions with the highest fees.

The purpose of the mempool is therefore not only to transmit unconfirmed transactions, but also to supply miners with transactions so that they can mine.

"All aboard, please!"

You can also imagine this mempool as a kind of giant bus station where people are waiting for a bus. The only difference is that transactions are waiting here to be included in a block. Preference is given to those that reward the miner with more transaction fees. If the number of outstanding transactions in the mempool is very high, this can lead to longer waiting times and higher transaction fees, as senders have to pay higher fees to have their transactions prioritized. Similarly, people would get a seat on the next bus faster if they were willing to pay more. On txstreet you can also see this process visually.

So next time you should make sure that you don't pay too low a fee for a transaction. Otherwise, this could lead to your transaction remaining in the mempool for a long time until the average transaction fees decrease.

If a transaction stays in the mempool for too long and is removed, you can always republish it as long as it is valid, so it will be confirmed sooner or later. However, if you no longer want confirmation, you must cancel the transaction, e.g. by spending one of the inputs. You can use the "Replace By Fee" function to replace an unconfirmed transaction with another one or to subsequently increase the fees and thus the financial incentive for miners.

The fee rate

To be able to estimate the fees correctly, you can take a look at the currently unconfirmed transactions. If the throughput is low, you should therefore not pay too much, while at peak times the transaction fee can be set a little higher to avoid unnecessary waiting times.

In the mempool explorer mempool.space you will find a section that shows the current fee rates.

You can find another tool that can help you with this on the jochen-hoenicke.de website. Here you can view the distribution of fees so that you can estimate which fees you should set for your transaction.

Overall, the mempool is an important part of the Bitcoin network as it ensures that all pending transactions are stored until they can be included in a block. Furthermore, the mempool provides an additional layer of security and resistance to DDoS attacks, where a network is flooded with small transactions and performance is impacted.

And have you learned something new again? How have you set your transaction fees so far? Do you pay attention to the "current distribution of fees" or do you let your wallet take care of everything automatically? Let us know what you think in our Blocktrainer forum!