Published: 2020-12-30 at block 663,688
Bitcoin Price: $28,100
Table of Contents
- My Bitcoin Transaction is Stuck and Unconfirmed
- How Do Miners Prioritize Transactions?
- But I didn’t even set the fee rate - it was done automatically by my wallet.
- So then where in the queue is my transaction?
- What do the different colored layers in the mempool visualizer represent?
- Reading the Mempool
- Getting an ETA for your Bitcoin Transaction
- Where can I see what fee rate I paid for my transaction?
- So what can I do for my unconfirmed transaction?
- What does an RBF transaction look like?
- Walking through a Replace By Fee (RBF) Transaction
- Wrapping Up
- Other Techniques to Reduce Transaction Fees and Further Fee Optimization
My Bitcoin Transaction is Stuck and Unconfirmed
You were expecting your bitcoin transaction to get mined and confirmed within the next block (~10 minutes), but for some reason your transaction isn’t going through.
It seems stuck and you’re worried that your transaction will never clear. You ask yourself, “have I just lost some bitcoin?”
If this sounds familiar, don’t worry - your funds are safe. Chances are, the fee you included in your transaction wasn’t high enough for miners to prioritize it.
How Do Miners Prioritize Transactions?
A lot of people transact on the Bitcoin network, but each block can only fit so many transactions - the supply of block space is limited but demand for it is high.
Because miners can’t fit everyone’s transactions into the next block, they prioritize transactions based primarily on transaction fee rates (though other factors like the age of the transaction and its size are also considered).
If your transaction fee rate is higher than others’, then your transaction is more likely to be added and confirmed (“sent” or “unstuck”) in the next mined block.
However, in your case, your fee rate was likely not high enough...
But I didn’t even set the fee rate - it was done automatically by my wallet.
Wallets estimate fee rates the best they can... but when the network suddenly gets clogged with a ton of unconfirmed transactions, oftentimes those estimated fee rates aren’t competitive enough.
As a result, you’re left in this situation where you didn’t include a high enough fee rate and your transaction is forever pending.
So then where in the queue is my transaction?
To answer this, we need to look at the memory pool (or mempool for short).
The mempool is essentially where unconfirmed transactions wait in line to get mined. There are many mempool visualizers and fee estimators, like:
Side note: I've also created a full guide on how to use Mempool.space.
Let’s look at this example from the Jochen mempool visualizer:
It looks like a mountain with peaks and valleys right? Well if we extend that analogy further:
- A peak represents an increase in the number of unconfirmed transactions. This means that the demand for block space is greater and you’ll need to pay a higher fee rate to get your transaction confirmed ASAP
- A valley represents a decrease in the number of unconfirmed transactions - you can pay a smaller fee rate to get your transaction confirmed
What do the different colored layers in the mempool visualizer represent?
In the legend above, you’ll see that colors represent transaction fee rates measured in sats/byte.
Similar to how a neighborhood’s home prices are compared by cost-per-square-foot, miners compare transactions in the mempool on a Satoshis per Byte (sats/byte) basis.
You may have also seen the metric “Satoshis per Virtual Byte” (sats/vbyte) used as well. It’s a similar concept, but measures the block not in terms of its size, but in terms of its virtual size.
This sats/byte vs. sats/vbyte topic warrants its own blog post, but the gist is that one of Bitcoin’s scaling solutions, the Segregated Witness (SegWit) softfork, allows for a block to no longer be limited to its size limit of 1mb, but instead to its weight limit of 4mb.
Virtual bytes (vbytes) are essentially a conversion tool that helps us measure weight units back to size (by dividing the weight units by 4).
Regardless, the fee rate (measured in either sats/byte or sats/vbyte) helps miners prioritize a large backlog of transactions. By creating a market for a Bitcoin block’s digital real estate, miners can easily assess how your transaction fee rate stacks up against others and prioritize accordingly.
The higher your relative fee rate vs. other transactions’ fee rates
→ the more attractive your transaction is to mine
→ the greater likelihood of your transaction getting mined ASAP
Let’s say that the price of bitcoin is $20,000. There are 100,000,000 satoshis per bitcoin. A 10 sats/byte fee rate would be the equivalent of paying $0.002 per byte. If the average transaction size is about 250 bytes, then at a 10 sat/byte fee rate, you’d pay $0.50 for your transaction.
- 10 satoshis / 100,000,000 satoshis = 0.0000001
- 0.0000001 * $20,000 = $0.002
- $0.002 * 250 bytes = $0.50
So now that we understand the mempool dynamics and fee rate market, we can get a better idea of what the actual mempool graph means:
Reading the Mempool
Initially (before the left red arrow), transactions could be confirmed fairly inexpensively (blue 0-10 sats/byte; green 10-40 sats/byte) because the queue of unconfirmed transactions was really small. There wasn’t a lot of demand for block space so you could pay a lower fee rate and your transaction would confirm quickly.
Then as the mempool began to get clogged with more transactions (after the left red arrow), miners started getting overwhelmed. As demand for block space increased (ie. more transactions were being initiated and awaiting confirmation) while the supply of block space remained the same, the transaction fee rate had to increase as well (mountain peaking).
This led miners to prioritize transactions with higher fee rates (yellow 40-140 sats/byte) over the ones with lower fee rates (green, blue). Visually, it’s like miners focused on and started picking away at the peak of the mountain.
As the number of transactions being sent started cooling off and miners dealt with the higher fee rate transactions, they could finally return to mining the lower priority transactions with lower fee rates (after the right red arrow).
Putting this mempool and fee rate knowledge into context - if your transaction got stuck, it’s likely because you initiated your transaction right before a sudden spike in network activity (like at the left red arrow).
Side note: you may have also noticed a dark border covering the entire chart - this means that people were willing to pay >2,000 sats/byte regardless of network conditions!
Getting an ETA for your Bitcoin Transaction
To better understand when your unconfirmed transaction will be unstuck, you’ll have to look at:
- The trend of unconfirmed transactions in the mempool and
- Determine whether the fee rate you paid will be enough to incentivize miners to mine your transaction within your preferred time horizon
Once you know what fee rate you paid and where the mempool is trending, you can get a better sense of when your transaction is likely to be confirmed.
Returning back to this example: if you sent your transaction at the left red arrow at a 10 sat/byte fee rate (blue), then by the right red arrow, your transaction probably still hasn’t been confirmed and will likely take more time to be mined.
However, if you sent your transaction at the left red arrow at a 30 sats/byte fee rate (green), then there is a good chance that by the right red arrow, your transaction has confirmed or will be confirmed soon, assuming that no spike in network activity occurs.
Where can I see what fee rate I paid for my transaction?
In most wallets, you’ll be able to see what fee rate you paid in your transaction details. But in case yours doesn’t, you can view these kinds of details in a block explorer.
There are many block explorers, like
Side Note: I've also created a full guide on how to use mempool.space.
It’s like viewing a shipped order on Fedex. On Fedex, you can enter your tracking number and you’ll see all the details regarding your package, like when it shipped, when it’s estimated to be delivered, how much you paid for shipping, confirmation of delivery, etc.
Similarly, a block explorer takes in data like a transaction ID, hash, address, block height, etc. and displays details like the transaction amount, fee rate, ETA, number of confirmations, addresses involved, etc.
Comfort with a block explorer is incredibly useful and you can even host your own if you’re privacy-conscious (remember, if you’re typing super unique info like your address or transaction ID into an online service, they can correlate that information with your IP address).
Ok, so now you understand:
- how miners prioritize transactions by fee rate and that the Bitcoin network is just functioning as expected,
- where your transaction stands in the queue by using tools like a mempool visualizer and block explorer, and
- your transaction’s expected ETA for its first confirmation by looking at the mempool trend and how your fee rate fits into that…
So what can I do for my unconfirmed transaction?
Ask yourself: how important is the speed of confirmation for your transaction?
Depending on your time horizon, you can either:
- Wait it out if you have the time or
- Rebroadcast your transaction with a higher fee if you’re in a rush
Waiting it out:
If your transaction isn’t time sensitive and you can wait a while, then you may want to consider just waiting for your transaction to confirm. In most cases, transactions confirm within 72 hours.
If your transaction doesn’t confirm within 72 hours, then don’t worry - your transaction won’t be stuck forever. After 2 weeks, it’s likely that your transaction will just be dropped from the mempool, in effect “refunding” you and allowing you to send a new transaction with your original balance (in reality, if your transaction hasn't been confirmed, your funds have never left your wallet).
If you can’t wait 72 hours to 2 weeks, then consider...
Rebroadcasting your transaction with a higher fee:
If you’re in a hurry, then you might have the option to rebroadcast your transaction with a higher fee (aka. Fee Bumping).
But this Replace By Fee (RBF) technique only works with a handful of wallets - so you’ll need to check with your wallet vendor to see whether it’s compatible. You can also check this compatibility matrix for convenience.
If your wallet supports RBF and you have already opted-in, then you can simply send another RBF transaction.
Side Note: There are also “free” transaction accelerator services, but I am personally skeptical of these. Why would a free service offer to pay a higher fee on my behalf? Probably because they want to link my transactions to my IP address or something…
What does an RBF transaction look like?
It looks exactly like any other transaction - you set the amount you want to send, the address of the recipient, etc. And with your newfound knowledge of mempool dynamics and fee rates, you could customize your RBF transaction’s fee rate too.
But what sets RBF transactions apart is that it tries to front run your pending transaction by incentivizing miners with a new transaction that spends the same coins but with a higher fee rate.
Once your new RBF transaction is mined, it essentially cancels out your original unconfirmed transaction.
To bring this all back into context, I’ll walk through an example.
Walking through a Replace By Fee (RBF) Transaction
From looking at the mempool, I know that the suggested fee rate is 5-9 sats/vbyte:
And looking at the mempool chart, I can see that the highest priority transactions have fee rates of 2-30 sats/vbyte (purple to yellow peaks on the right-hand side), whereas most unconfirmed transactions have fee rates of 1 sat/vbyte (pink).
For this example, I've sent an initial transaction with a low 1 sat/vbyte fee rate:
So my 1 sat/vbyte transaction has been broadcasted and is awaiting confirmation - I can click on "View in Explorer" in the Blockstream Green app and it will open the Blockstream.info block explorer.
Because I only sent a fee rate of 1 sat/vbyte and the mempool looks like miners are prioritizing 9+ sat/vbyte fee rates, I'll need to use replace-by-fee in order to get my transaction unstuck and confirmed.
To do that, all I need to do is go back to my transaction details, click "Increase Fee", then set a new custom fee rate (I'll use 10 sats/vbyte this time):
So with this new fee, I expect my new RBF transaction (10 sat/vbyte) to "front-run" my initial unconfirmed transaction (1 sat/vbyte). The initial fee will be recovered and the RBF fee will be the one I pay to miners.
And that's all you need to do to RBF. Easy right?
So we’ve learned about:
- Miner incentives and transaction priority based on fee rates
- The mempool and where your unconfirmed transaction is in the queue
- Block explorers and transaction details
- The optimal fee rate to pay to get your transaction mined ASAP
- Time preference and either waiting it out or replacing by fee
If you’d like to practice setting fee rates and sending RBF transactions, I’d highly recommend going through the process of inspecting the mempool and sending transactions.
With this knowledge and some practice, sending Bitcoin transactions should induce much less anxiety and instill much more confidence.
Other Techniques to Reduce Transaction Fees and Further Fee Optimization
So now that you’re an expert on mempool mining dynamics and fee rates, what other areas should you know about to optimize your fee rates?
- Transaction size and complexity: did you know you can decrease the size of your transaction and pay way less in total fees by using SegWit addresses that start with ‘bc1’ instead of a ‘1’ or ‘3’?
- Bull markets: often times, bull markets cause a ton of network congestion so if you’re looking to transact at a lower fee rate, avoid sending transactions during bull markets
- 9AM EST: did you know that BitMEX (one of the largest Bitcoin derivatives exchanges) usually clogs the mempool with a ton of transactions at 9AM EST every day? Best to avoid sending transactions at this time
- Lower time preference: if you want to optimize fee rates to a point where you pay only 1 sat/vbyte, then you and your recipient will have to lower your time preferences and practice patience ;)
- Batching: you can send bitcoin to multiple recipients in a single transaction
- Consolidation: you can consolidate your bitcoins (UTXOs) so that your future transactions use fewer inputs, decreasing your future transaction sizes
- Child pays for parent transactions (CPFP): your “child” transaction can pay for both its own and its parent’s transaction so that both transactions can be confirmed in the next block
- Lightning Network: this second-layer scaling solution allows you to send transactions in fractions of a second and pay tiny fees, but requires much more knowledge (eg. HTLCs, state channels, channel management, etc.)
- Weekends: typically, fee rates are lower on weekends due to less on-chain activity
Feel free to read this wiki on other ways to reduce your future transaction fees!
Hope you found this blog post helpful - if you did, please share the article to those who might need it and make sure to subscribe to the newsletter to stay up to date on the latest posts!
What did I miss? What else would you like to learn more about? Let me know on Telegram!