An Introduction to Bitcoin Core's Fee Estimation Algorithm

·

Why Do Transaction Fees Exist?

Bitcoin’s block space is a finite resource. When priced too low, demand inevitably exceeds supply. If block space were free, users would exploit it excessively—decentralized gambling, uploading full backups of the Bitcoin whitepaper, or timestamping personal files are just a few examples.

To ensure limited block space is allocated to those who value it most (i.e., willing to pay the highest fees), Bitcoin operates a fee market. The mempool acts as a decentralized clearinghouse: users bid for block space by attaching fees to transactions, and miners prioritize transactions based on these fees. The higher your fee, the greater the chance your transaction "outbids" others for inclusion in the next block.


The Challenges of Fee Estimation

Estimating the right fee is notoriously difficult due to:

  1. Unpredictable Supply:

    • Long-term, block space supply averages ~2MB every 10 minutes (or 4M weight units).
    • Short-term, block arrival follows a Poisson distribution—blocks can appear seconds apart or take over 45 minutes.
  2. Fluctuating Demand:

    • Cyclical patterns exist (e.g., quieter weekends), but demand spikes unpredictably during events like price volatility.
  3. Diverse User Needs:

    • Urgent transactions (30-minute confirmation) vs. time-sensitive smart contracts (6-hour window) vs. non-urgent timestamping (weeks).

Poor fee estimates waste money (overpaying) or cause delays (underpaying). Let’s explore estimation techniques.


1. Instant Mempool-Based Estimation

A naive approach checks your mempool and sets fees to place your transaction in the top 2MB of the fee-paying queue. However:

Verdict: Too simplistic for reliable estimates.


2. Historical Block-Based Estimation

Analyzing past blocks seems logical but is vulnerable to miner manipulation:


3. Mempool History + Block Data (Bitcoin Core’s Approach)

Bitcoin Core combines mempool history and confirmed block data for robust estimates. With a large enough sample, it predicts fees required for confirmation within a target block range.


How Bitcoin Core Estimates Fees (Pre-v0.15)

Key Concepts: Buckets and Targets

Tracking Data

Bitcoin Core logs:

Probability = B / A.

Exponential Weighting

Newer blocks receive higher weight (multiplier: 0.998 per block, ~346-block half-life). This:


The estimateSmartFee() Workflow

Users specify a target block count for confirmation. The algorithm:

  1. Checks the highest-fee bucket (9400+ sat/byte).
  2. Verifies if its confirmation probability exceeds 95% for the target.
  3. Steps down bucket tiers until finding a probability <95%.
  4. Returns the median fee of the last 95%-compliant bucket.

Used by RPC methods (estimatesmartfee, sendtoaddress) and GUI transactions.


Limitations and Improvements

👉 Explore Bitcoin fee tools for real-time data.


FAQs

Q: Why not just pay the highest fee?

A: Overpaying wastes money. Bitcoin Core aims for the minimum fee with 95% confirmation confidence.

Q: How often does Bitcoin Core update fee estimates?

A: Continuously, using exponential weighting to emphasize recent blocks.

Q: Can miners manipulate fee estimates?

A: Possible but costly. v0.15+ algorithms reduce this risk by requiring mempool-originated tx for calculations.


Conclusion

Bitcoin Core’s fee estimator balances simplicity and accuracy, leveraging historical data without over-engineering. While imperfect during volatility, it provides transparent, statistically grounded estimates for most users.

👉 Learn advanced fee strategies to optimize your transactions.


### Key SEO Enhancements:  
- **Headings**: Hierarchical H2/H3 structure for readability.  
- **Keywords**: "Bitcoin fee estimation," "mempool," "transaction confirmation," "sat/byte," "miner manipulation," "block space."