What is the mempool and what should merchants know about it?
Since we at Coincharge are concerned with how to accept Bitcoin and Lightning payments in your brick-and-mortar or online store, we will look at the topic of “what is the mempool” from the perspective of a merchant who accepts Bitcoin payments.
But also for those who pay with Bitcoin, this article holds some interesting information.
Mempool is back on everyone’s mind as the fees for a Bitcoin transaction have risen sharply and the duration of a Bitcoin payment can be very long.
We often get the question from our customers lately: “My customer has paid with Bitcoin, but the Bitcoins are not yet credited to my wallet. Can I deliver the goods, are the bitcoins still coming or what can I do?
In this article we will deal with the following topics:
- What is the mempool and how does it work?
- How are Bitcoin transaction fees calculated?
- How can I find a transaction in the mempool?
- How long does a payment remain in the mempool?
- As a merchant, how do I respond when a customer’s payment is “stuck” in the mempool?
- What is the difference between “Payment executed” and “Payment credited”?
- When do I provide the goods or services to the customer? After payment or after credit?
- How can I accelerate a payment after the fact?
- How can fraudsters manipulate a payment after the fact?
Phases of a Bitcoin payment
Each Bitcoin payment can be divided into two phases.
The first phase takes place when a Bitcoin transaction is performed by the payer. For example, if a customer pays with Bitcoin, this payment is first displayed in the so-called mempool.
In the second phase, the Bitcoin amount is credited to the Bitcoin Wallet and this happens when the Bitcoin payment has been confirmed on the Blockchain.
What is the Mempool?
The term mempool is short for memory pool and is effectively the waiting room for Bitcoin transactions.
In the mempool, Bitcoin transactions are waiting to be confirmed on the Bitcoin Blockchain.
A merchant accepting Bitcoin payments can see in the mempool if a payer has made their Bitcoin payment. If this Bitcoin payment was confirmed on the Bitcoin Blockchain, then the Bitcoin payment was finally credited to the merchant’s own Bitcoin wallet.
But what exactly happens in this first phase when a Bitcoin payment has been executed by the customer and is in this wallet?
Mempool – The waiting room of a Bitcoin payment
You can think of it like a waiting room at a bus station, where passengers are waiting for a seat on one of the next buses. This is nicely illustrated on the TXstreet website.
Seats on a bus are limited and those who want to go must buy a seat. This place is not awarded at a fixed price, but must be bought at auction, so to speak.
The price is not based on the amount of the transfer, but on the size of the file. That would be like a very fat person paying more for a seat on the bus than a short, narrow person who takes up little space on the bus.
The size of the file is calculated in sats per Vbyte. The average file size is 225 bytes and for a Segwit payment it is 140 bytes. A Bitcoin Segwit address starts with a 3 or bc1 and is cheaper because smaller file.
Those who are willing to pay more get a place at the front of the queue, those who have time and can wait a bit are placed further back in the queue and have to pay less accordingly.
About every 10 minutes a block is confirmed or a bus departs and the seat assignment starts again.
How do I find a transaction in the mempool?
On the website mempool.space the mempool is presented very clearly with all relevant information.
On the right side, we see in blue the blocks that have already been confirmed on the blockchain.
At the time of recording, the last confirmed block is 793582. There were 2,377 transactions in this block and an average of 41 sat per vByte was paid to get a spot in this block.
In the left pane, shown in yellow, we can see the transactions that are in the mempool. They are waiting for their confirmation.
There are currently 3,655 transactions in the next block being waited for, and an average of 21 sat per VByte was paid to get a spot in that block.
Below that, we can see the fees that need to be paid depending on the urgency or priority of the Bitcoin transaction.
Those who do not care when the Bitcoin transaction is executed pay the amount for No Priority (8 Sat/vB).
Those who want their bitcoin transaction confirmed during the day choose the low priority amount (19 Sat/vB) and those who want it confirmed within the next hour choose the medium priority amount (21 Sat/vB).
If you are in a hurry and want to be part of the next block, choose the highest priority with currently 22 sats per vByte.
Number of Bitcoin transactions in the mempool
In the line below we see the indication that transactions that want to pay less than 5.42 per vByte will be sorted out. These transactions do not find a place in the mempool.
There are currently 314,137 transactions in the mempool waiting to be confirmed on the Bitcoin blockchain.
At this point, however, it must be pointed out that there is not one mempool.
Each Bitcoin Node has its own mempool and each Bitcoin transaction is forwarded to each Bitcoin Node and entered into the corresponding mempool.
Each mempool, or to stick with the analogy to our bus station, has different sized waiting rooms.
However, the Bitcoin Node waiting room at mempool.space is already very large and gives a good impression of how many transactions are still waiting to be processed.
See https://mempool.space/ for current fees payable at the time of reading this article.
Bitcoin Transaction Fee – Cost of a Bitcoin Payment
In a Bitcoin transaction, the sender, i.e. the payer, sets the transaction fee. Thus, the payer also determines how long it takes for the bitcoin transaction to reach the recipient.
We want to perform a bitcoin transaction from the payer’s point of view and use BlueWallet to do so.
Here we see the QR code of a Bitcoin address and scan it with our BlueWallet. As with any Bitcoin wallet, BlueWallet displays a fee that can be changed by the user.
By clicking on it, the user has the possibility to choose between the three priority levels just presented.
However, he can also enter his own fee.
The recommendation in BlueWallet, as with almost all Bitcoin wallets, is a charge for the next block. In our example, BlueWallet suggests 11 sat/vByte. However, if we now take a look at Mempool.space, we can see what fees are proposed for the next block.
If a quick charge costs 11 sats per byte, we multiply that value by 140, since an average Bitcoin segwit payment is about 140 bytes in size. We then arrive at 1,540 sats. At a current Bitcoin rate of about €30,000, that’s then about €0.69 in fees that have to be paid for a Bitcoin payment for a very fast transfer.
As a payer, it is recommended to always take a look at the current fees.
When paying in a store or online store, the payer should already pay a high or at least medium fee.
In the Custom section we can also enter an individual value as the payer.
We will see why later when we take a closer look at the merchant’s perspective.
Find a transaction in the mempool
After the transaction is completed, we receive a transaction ID. In our example: 9e570c59ce1c011f03dbe1b5f9469c780ff836cf7ae7b341f23d623800c8965d
This transaction ID provides us with all the information about the corresponding transaction, which we will now take a closer look at at mempool.space.
If we enter the transaction ID at the top of the search, we see that this transaction is still in the mempool.
The fees we paid in total. We paid 5.75 sats per vbyte. Due to the size of the file, this payment cost us 1,014 sats or $0.31.
It is expected to take several hours for this payment to be confirmed on the Bitcoin blockchain.
We also see that under Features, the RBF item is crossed out. RBF stands for Refund by fees and is not possible for this transaction. More about that later.
We as merchants also receive this transaction ID and can retrieve the same information. This tells us how much the fee was that our customer paid and how long it takes for the payment to be confirmed.
This information is very helpful when we decide whether to hand over the goods to the customer or, in the case of an Internet order, whether to ship the goods or wait a little longer.
If it is foreseeable that the payment will be confirmed during the day, it can be assumed that the process is normal. If the payer is very frugal or has chosen such a small amount that it may be reversed, you should take a closer look and consider waiting a little longer before sending the goods.
Bitcoin Store Settings at BTCPay Server
We have seen that the end customer, the payer, bears the cost of a Bitcoin payment. As a merchant and recipient of the bitcoin payment, we are interested in the transaction being confirmed quickly on the blockchain.
Ideally already in the next block.
In the following, we will briefly discuss the settings that merchants can make on a BTCPay server.
These setting options are also offered in the same or similar form by other Bitcoin payment service providers. However, it is also very interesting for payers and provides the answer why you should not be too stingy when paying with Bitcoin at a merchant.
On the BTCPay server, in the Bitcoin Wallet Settings section, there is a Payment section.
Here the merchant can specify when a Bitcoin payment is considered invalid. If a Bitcoin payment is in the mempool but is not confirmed on the blockchain within 24 hours, i.e. 1440 minutes, this payment is considered invalid. The merchant can then manually validate this payment or issue a refund later.
Why is this limited to 24 hours? If an end customer buys a product for e.g. 50,- €, then this purchase amount is converted based on the current Bitcoin exchange rate and the customer has to send a certain amount in Bitcoins. So the merchant guarantees the customer this conversion rate for 24 hours. Although the average volatility of the Bitcoin price is less than 2% per day, the Bitcoins should still be credited to the merchant’s wallet after 24 hours at the latest.
Then we have the option to set when a Bitcoin payment is considered credited or settled. That is, when the Bitcoin payment was confirmed on the blockchain. Here the setting is set to 1 confirmation. However, you can also set a different number of confirmations. Either multiple confirmations, which is recommended for high-priced products.
However, you can also select the LS unconfirmed setting. In this case, the payment would already be considered completed as soon as it is displayed in the mempool, but not yet confirmed on the blockchain. This setting is useful for small amounts or digital goods.
Then there is another interesting option, which is the recommendation that you want to give your customers for the amount of fees. Here is the setting for one block. This means that the customer is shown the charge as a recommendation for the next block.
Bitcoin payment executed vs. bitcoin payment credited
We just learned that we can see in the mempool when a bitcoin payment has been executed. When the Bitcoin transaction is confirmed on the Blockchain, the Bitcoins are credited to our Bitcoin Wallet, so to speak.
So we have two states:
- Mempool – The customer has paid, the Bitcoin payment has been executed.
- Blockchain – Bitcoin payment was credited to the merchant’s wallet.
If you are a merchant who already accepts card payments in your store or PayPal payments or bank transfers on the Internet, you know that there is a time delay between the customer’s payment and the final credit to your bank account.
In case of a bank transfer, you have to wait at least one banking day for the transfer amount to be credited to your bank account. If you pay by credit card or PayPal, as a merchant you will receive the amount credited after one week. Only in the case of cash payment, as a merchant, you get the money credited immediately and guaranteed.
Even with a bitcoin payment, there is a time delay between the customer’s payment and the final credit to their bitcoin wallet.
How long it takes for the amount paid by the customer to be finally credited to their Bitcoin wallet depends on what the customer was willing to pay as a transaction fee.
Now the question arises, when do we provide the customer with the purchased goods or services?
As soon as the customer has paid and the transaction is visible in the mempool, or only when the payment has been credited to our bitcoin wallet, i.e. when the bitcoin payment has been confirmed on the blockchain.
Bitcoin payment on site for a coffee
You run a coffee shop and a customer wants to pay for his coffee quickly with Bitcoin. Do you give the customer the coffee as soon as the payment is visible in the mempool or only after confirmation on the blockchain?
For smaller amounts, it is recommended to give the customer the coffee as soon as the payment has been made, i.e. is in the mempool.
However, the corresponding bitcoin payment is not yet in our bitcoin wallet. This may take some time and depends on how many fees the customer has paid. As a merchant, we also know the transaction ID and can look up when to expect the payment to be received.
As a cafe operator and for smaller amounts, we can get over a certain waiting time until the final credit to our Bitcoin wallet.
We can choose the settings to hand the coffee to the customer as soon as the transaction is visible in the mempool and the charge is at least enough to confirm the transaction within the next 1440 minutes, 24 hours.
Bitcoin payment on site for luxury items
However, if we are a jeweler selling high-priced products, for example, we will definitely have to wait until the payment is confirmed on the blockchain, i.e. credited to our Bitcoin wallet.
At least one confirmation should be awaited here.
In this case, we should inform the customer that the recommended fast fee is paid and the waiting time is maximum 10 minutes.
The jeweler can certainly bridge the time without any problems while packing the piece of jewelry.
Bitcoin payment on the Internet for physical goods
A comparable situation arises for an online merchant who sends physical goods by mail.
After the customer has paid and the bitcoin payment is displayed in the mempool, the customer is informed that the bitcoin payment was successful.
When I, as a merchant, am informed that the order has been received, I can already assemble the ordered goods and make them ready for shipment.
I then ship the goods only after at least one confirmation has been made on the blockchain.
Bitcoin payment on the Internet for digital goods
In the case of digital goods, delivery of the goods takes place directly via the Internet. When a customer buys a newspaper article or a video, they won’t want to wait long to read the article.
Here it is advisable to provide the customer with the ordered products immediately as soon as the transaction is displayed in the mempool.
The damage in the event of fraud is perhaps still bearable, as these are easily reproducible digital goods.
For higher-priced digital goods such as software keys or memberships, consideration should be given to how to proceed in the ideal case. If necessary, access can also be blocked subsequently.
From a customer value perspective, there should be immediate delivery of digital goods.
Bitcoin payment fraud risks
A payment is always safe and guaranteed for the merchant only when the payment is finally credited.
In the case of a bank transfer, the payment is completed only when the merchant’s bank account is credited.
That is, not at the time when the customer made the transfer at his bank.
There is one banking day between the time of the transfer by the customer and the crediting of the merchant.
Even if payment is made by credit card or PayPal, the merchant receives the information that the customer has paid, but the credit is not issued until several days later.
Only in the case of a cash payment, the merchant receives the money immediately and the payment and credit is immediate.
When paying by bank transfer, credit card or PayPal, there is a risk that a payment will be canceled by the customer. These payments are never secure or guaranteed and there is always a risk of payment cancellation or chargeback.
Nevertheless, each merchant delivers the goods to its customers as soon as it receives the information that the payment has been made by the customer.
A payment with Bitcoin is much safer for the merchant than a payment with credit card or PayPal.
Once a confirmation is received, the payment is safe and guaranteed and there can be no chargeback.
When making a Bitcoin payment, there is little risk as long as the payment is still in the wallet.
As with credit cards and PayPal, a merchant should provide the service to the customer as soon as the customer has paid, even if the credit has not yet been finalized.
But what are the risks for us as merchants if we already provide the service even though the payment appears in the mempool and has not yet been credited to our wallet?
If you already hand over the goods to the customer after the Bitcoin transaction has been displayed in the mempool but not yet confirmed, you run the risk of being defrauded as a merchant.
The probability is low, but not zero and should therefore be kept in mind.
A customer might intentionally set the transaction fee so low that the transaction stays in the mempool for a very long time and might even be deleted from the mempool at some point.
We have already explained in this video how we can check if enough fees have been paid.
Care should therefore be taken to ensure that the fee paid by the payer is at least equal to the non-priority status.
However, it should in no case be below the minimum value for deletion.
However, as a rule, Bitcoin wallets are configured in such a way that a payment cannot be executed in this case.
Replace by Fee (RBF for short)
By default, a Bitcoin transaction that remains in Mempoool for more than 14 days will be deleted. However, this does not have to be the case. As long as the transaction is valid, this transaction can be added to the mempool again and again and hang in the mempool indefinitely.
Replace by Fee is a way to expedite a bitcoin transaction after the fact.
This makes sense if the payer has paid too little, the transaction takes too long and the payment allows RBF.
Whether RBF is allowed can also be read at Mempool.Space at the detail view to the transaction.
With RBF, the transaction fee can be subsequently increased in order to obtain a front place on the waiting list.
This Replace by Fee can only be performed by the payer, not by the payee. In addition, not all Bitcoin wallets support Replace by Fee. As we have seen above, paying with Bitcoins via BlueWallet does not support Replace by Fee and we cannot accelerate the payment afterwards.
If you want to subsequently accelerate a Bitcoin payment via Replace by Fee, you can do so with the help of Sparrow Wallet.
Unfortunately, Replace by Fee also provides an opportunity for fraud by the payer. This is because when a Replace by Fee is performed, the payer can also change the bitcoin address to which the bitcoin payment should go. A fraudster could then deposit their own Bitcoin address and redirect the payment to themselves.
For smaller amounts, it is not likely that a fraudster will make this effort. In the interest of the many honest customers, it is advisable to hand over the corresponding goods or services to the customer in the case of smaller amounts.
As explained above, it is also possible to view the transaction itself at any time and determine whether the fee is sufficiently high and possibly also whether Replace by Fee is not supported by the corresponding wallet.
Child Pays for Parent (CPFP)
For the sake of completeness, Child Pays for Parent (CPFP) should also be mentioned here. Here, a subsequent transaction (the child) pays the fee for a previous transaction (the parent).
Here the payee has the possibility to accelerate a payment.
The payee creates a completely new transaction in which it reissues the bitcoins from the old transaction. The fees for this second transaction are so high that a miner will record and process this transaction along with the previous transaction.
Thus, the original transaction is cross-subsidized by the new transaction.
Summary: What is the mempool?
We have learned that bitcoin payments are displayed in the mempool and as a merchant we learn that the payment has been made. However, the amount has not been credited to our wallet yet.
The key question is whether to hand over the paid service to the customer already and risk having to wait longer for the amount to be credited.
There is a minimal residual risk that a customer fraudulently cancels a bitcoin payment before the bitcoin payment has been confirmed on the blockchain.
For small amounts of perhaps less than €10 (micro payments), the products and services can already be made available to the customer as soon as the transaction is displayed in the mempool. For small amounts, merchants should value customer service over the risk of payment cancellation and provide the customer with the purchased service.
For medium amounts, you should take a look at the transaction yourself and check whether the fees paid by the customer indicate that payment will be received soon.
For higher amounts or when selling over the Internet, you should not hand over or ship the goods until the Bitcoin payment has been confirmed on the blockchain.
Anyone unsure of how to proceed is welcome to contact us and we will review the individual situation and make a recommendation on how to proceed as a merchant.
For those who find the risk of non-payment too high, even for small and medium amounts, we recommend accepting Bitcoin payments via the Lightning network.
In the case of Lightning payments, the information about the successful payment by the customer always occurs simultaneously with the crediting of the Lightning Wallet. With a Lightning payment, there is no chargeback risk for the merchant.