Fee Estimation
When building transactions, you need a fee rate (sat/vB) so the transaction is included in a block within an acceptable time. Fee estimation uses the mempool and sometimes external APIs to suggest a rate. This guide covers getting fee rates from your node (e.g. Bitcoin Core RPC), from HTTP APIs, and how to use them in code. For the economics of fees, see Transaction Fees.
- Too low: Transaction may sit in the mempool or be dropped; user waits or payment fails.
- Too high: User overpays; acceptable for urgency, wasteful otherwise.
Estimation is heuristic: the mempool changes constantly, and miners choose which transactions to include. There is no guarantee a given fee rate will confirm in N blocks; treat estimates as guidance. Try the Fee Estimator to estimate fee from vBytes and current network rate.
- sat/vB (satoshis per virtual byte): Standard unit. Virtual size comes from SegWit weight (weight/4).
- BTC/kB: Legacy unit; 1 BTC/kB = 100,000 sat/vB. Bitcoin Core's
estimatesmartfeereturns BTC/kB; convert to sat/vB for modern use.
Bitcoin Core's estimatesmartfee RPC returns an estimated fee rate for a given confirmation target (number of blocks).
When you don't run a full node, you can use a third-party fee API (e.g. mempool.space API). These return fee rates for different confirmation targets (e.g. 1, 3, 6 blocks).
- 1–2 blocks: High urgency; pay a premium (e.g. "fastest" from API or target 1 in
estimatesmartfee). - 3–6 blocks: Normal payments; balance cost and speed.
- 6+ blocks: Low urgency; often cheapest.
Use the same unit (sat/vB) when calculating total fee from estimated rate and transaction virtual size.
- Reorgs: Short reorgs can delay confirmation; estimates don't account for this.
- Mempool churn: A sudden spike in demand can make your estimate stale; consider refreshing close to broadcast.
- Pruned nodes:
estimatesmartfeestill works; it uses the mempool. If your node has no mempool (e.g. block-only), use an API or another node.
- Transaction Construction - Using fee rate to set transaction fee
- Transaction Fees - Fee market and RBF/CPFP
- Mempool - How unconfirmed transactions are stored and selected
- Coin Selection - Selecting UTXOs with effective value and fee in mind