Bitcoin Memory Pool
As soon as the price changes direction, speculators panic and dump their Bitcoins or quickly place additional orders. With the then skyrocketing transaction fees, low fee Bitcoin transfers get stuck in the mempool for days or weeks. A little push can help against that.
Bitcoin speculators can be pretty annoying: no sooner does the price crash, as it did just before Christmas and then in mid-January, than the whole world wants to get rid of their Bitcoins as quickly as possible. More and more sellers voluntarily offer higher and higher transaction fees to ensure that their transaction is included in the next block before the price falls even further – while their own panic sale, along with transactions from other misers, sinks miserably in the miners’ collection pool (mempool). The punishment follows when the offers of transaction fees drop again after the price drops and then the sell order sent days or even weeks ago is executed after all – because there is no expiration date.
In fact, you lose control of at least some of your Bitcoin assets as soon as you send a transaction. The reason is that, according to the Bitcoin rulebook, credit can only ever be spent in full: The amount available on the so-called input address is completely distributed among the output addresses listed in the transaction. These are usually a recipient address, to which the desired transfer amount is credited, and a change address, to which the remainder minus the transfer fee is posted. For the next payment, one then uses the change address as the new input address.
The loss of control is that the change address is empty until the transaction has been confirmed in the blockchain – and that can take days and weeks if you only offer a lousy transfer fee. This is because the miners quite capitalistically select the most lucrative transactions for them with the highest transfer fee bids in order to calculate the next block of the chain from them. If one has distributed one’s Bitcoin assets to several addresses, only the part of the assets from the hanging transaction that was booked on the involved input address is blocked. You can spend the bitcoins from other addresses unhindered.
Users often do not notice this blockade: when making a transfer, Bitcoin clients try to collect the amount from as few input addresses as possible to keep the transaction size small – they send the rest to a previously unused change address. In this way, several change addresses with credit accumulate over time, from which the Bitcoin client can help itself, while another transaction is still on its way and its change has not yet arrived.
Modern clients at least allow to use change addresses from transactions that have not yet been executed as input addresses for a new transfer and to send this transfer even though the change has not yet arrived. What they hide from the user: The new transfer can only be executed after the first one is completed. The miners also notice this when they find the transaction in the mempool. Thus, the second transaction is at least as long in transit as the first, probably even longer.
The easiest way to jump-start hanging bitcoin transactions is to use the free Transaction Accelerator from mining pool operator and online wallet provider ViaBTC. By going to viabtc.com/tools/txaccelerator and entering the transaction ID of the hanging transfer, you can prioritize it for ViaBTC miners: They will include the transaction in the next block even if the transfer fee offered is way too low for it.
The only requirement is that the transaction fee is at least 0.0001 bitcoin per kilobyte (10 satoshi per byte) – about 25 cents for a simple transaction. Anyone can use the service without registering, not just ViaBTC customers. However, ViaBTC only allows 100 prioritizations per hour. If you are late, you have to wait until the next full hour to try again. It takes a good amount of luck to get your transaction expedited when the exchange rate drops.
A second, more expensive option is to increase the transaction fee afterwards. The procedure is called “Replace by Fee” (RbF), was submitted as Improvement Proposal 125 (Bitcoin Improvement Proposal, BIP-0125) at the end of 2015 and is now supported by many Bitcoin clients. In this process, the client sends a second transaction that uses the same input address as the first, but advertises a higher fee.
In order for the second transaction with the higher fee to be accepted, the original transaction must already have been marked as “replaceable”. In the Electrum wallet client, this flag can always be set by default in the settings. Independently of this, Electrum sets the Replaceable flag automatically if you select a particularly low transfer fee – but you can deactivate it again manually.
Transactions with Replaceable flag Electrum shows in the overview as replaceable. With a few clicks they are equipped with higher transaction fee.
By sending non-urgent transactions first with a low fee but Replaceable flag set, you can save a lot of money: If the fee was significantly too low, which is why the transaction is still not executed after two or three days, you can try again with a slightly higher one. If that doesn’t work either, increase the fee further – until the transaction finally ends up in the blockchain after all. This is especially worthwhile when cleaning up the wallet, if you transfer the small change of your change addresses to a single address – such transactions are often several kilobytes in size and are correspondingly expensive in times of high fees.
Children are liable for their parents
The third option is called “Child pays for Parent”, or CpfP for short, and is more expensive than Replace by Fee. While with Replace by Fee only the sender of a hanging transaction can give legs, with Child pays for Parent actually only the recipients of the transaction can. Normally, these are the owner of the receiving address and the owner of the change address – i.e. the sender.
The procedure exploits the greed of the miners to get the transaction confirmed after all, which is stuck because the transfer fee is too low. However, it only works with Bitcoin clients that allow the transfer of unconfirmed funds – for example, from still empty change addresses as with Bitcoin Core or Electrum.
To speed up an incoming payment that is stuck because the fee is too low, spend the money in advance. To do this, simply transfer money from the receiving address, where the money will be received, to another address in your wallet. You can’t skimp on the transfer fee, though, because it has to be exceptionally high – so high that the hanging and the new transaction combined are still lucrative for the miners. When searching for the most lucrative deals, miners stumble upon your princely rewarded transaction and immediately select it for the next block. However, upon checking to see if it is a valid transaction, they discover that the input address is still empty. Taking a second look at the mempool, the miners find the hanging parent transaction and, if it’s still worth it to them, include both in the same block. This way the child transaction pays the missing fees for the parent transaction.
Jam on the Blockchain
In the night from Tuesday to Wednesday, the mempool reached an initial peak of about 60,000 transactions, or just over 40 megabytes.
After that, the situation relaxed a bit, the mempool dropped to etwea 30 megabytes, many transactions sent on Sunday or Monday were finally confirmed. But already on Wednesday afternoon it started again. Yesterday night the mempool reached an all-time high with about 80,000 unconfirmed transactions, today the situation calms down a bit again, even if there are still about 50,000 transactions waiting to finally get into the blocks.
For one thing, this means that you may have to wait a very long time for your transaction to be confirmed. You can think of it like a forever-long line at an official counter. If people are added at a faster pace than the officials can process them, the wait will get longer and longer.
With Bitcoin, it’s not a number you pull that determines when you get confirmed, it’s the fee. Miners can pick and choose which transactions they fill the block space, which is limited to 1 megabyte. Therefore, they naturally confirm the transactions that pay the highest fees based on their size in kilobytes. Logic. The result is that transactions become not only slower, but also more expensive.
Unfortunately, there is no magic formula for getting transactions confirmed under these circumstances. For example, I used the average fees displayed by Tradeblock as a guide and added about a third more. This went mighty wrong and I had to wait around 48 hours for my confirmation.
The optimal fee
Many wallets calculate the fee automatically. Electrum or Mycelium, for example. The algorithms these wallets use are not perfect, but they are probably better than a layman’s estimate. That you are better off choosing a higher fee under the circumstances goes without saying.
Some wallets, like Client, allow you to set up the per-kilobyte fees to be paid by hand. This way, those who know a bit can select the optimal fee themselves.
An indication of how much you have to pay can be found on the website bitcoinfee.21.co. It is best to set the fee view as mBTC per byte, because you can then simply enter the same number in the client as bitcoin per kilobyte.
As this chart shows, if you pay 0.0008 – 0.0009 bitcoin per kil0byte, you have a good chance of confirmation in the next block. For a normal transaction, which is about 0.3 kilobytes, that works out to a fee of about 16 cents. If you create larger transactions with several inputs, you will easily have to pay 70-80 cents. Who even has the misfortune to own a bundle of daily payouts from cloud miners, may now be strongly annoyed by this habit.
And what if the transaction hangs in the mempool?
Well. If you’ve sent too few charges along, then one option is to sit it out. Eventually the transaction will be confirmed. It’s annoying, but no need to panic. The bitcoins are not lost.
- You used a wallet that supports “RBF” like Electrum or GreenAddress. With these wallets you have the possibility to increase the fee afterwards.
- You resend the transaction. Whether this works or not depends on whether important nodes in the network still have your transaction in the mempool. Ironically, it is now advantageous if the charge was significantly too low, as nodes are then more likely to give up hope that a confirmation will occur in the foreseeable future and delete the transaction. For example, check blockchain.info to see if your transaction is still there. If not, you should take advantage of the moment. You can resync your node (then the transaction should be gone and you can send it again), export the private key and import it at blockchain.info, for example, write down the seed (a passphrase of 18 or 24 words) and then delete the wallet, reinstall it and enter the seed. Exactly how it works depends on which wallet you use. Google will help you, maybe also this short guide.