Research/Bitcoin

Bitcoin Fee Market: How Transaction Fees Actually Work

Understanding Bitcoin's fee market: mempool dynamics, fee estimation, RBF, and strategies for cost-effective transactions.

bcMaoFeb 19, 2026

Every Bitcoin block has a maximum weight of 4 million weight units, roughly equivalent to 1 to 1.5 MB of transaction data after SegWit. This hard limit creates a scarce resource: block space. When more transactions compete for inclusion than a block can hold, a fee market emerges. Users bid for block space by attaching fees, and miners select the most profitable set of transactions to include. Understanding this market is essential for anyone building on Bitcoin or managing UTXOs efficiently.

Where Fees Come From

Bitcoin was not designed with a fee market from day one. Satoshi Nakamoto's original client included a fixed minimum fee and prioritized transactions partly by "coin age": how long inputs had been unspent. In the early years, blocks were far from full and most transactions confirmed with minimal or zero fees.

The fee market became economically significant as transaction volume grew relative to block capacity. The 1 MB block size limit, originally introduced as a spam prevention measure, turned block space into a genuinely scarce commodity. Today, transaction fees serve two purposes: they compensate miners for including transactions, and they act as a natural spam deterrent by imposing a cost on consuming shared resources.

Fees also play an increasingly important role in Bitcoin's long-term security budget. As the block subsidy halves every 210,000 blocks (roughly every four years), transaction fees must eventually replace the subsidy as the primary incentive for miners to secure the network.

Mempool Architecture

The mempool (memory pool) is where unconfirmed transactions wait before being included in a block. Each Bitcoin node maintains its own mempool independently: there is no single global mempool. Transactions propagate across the peer-to-peer network, and each node decides which transactions to accept and relay based on its own policy rules.

Mempool acceptance rules

Bitcoin Core enforces several default policy rules for accepting transactions into the mempool. These are not consensus rules (they do not affect block validity), but they determine what transactions propagate across the network:

  • Minimum relay fee: transactions must pay at least 1 sat/vB to be relayed by default
  • Maximum mempool size: default is 300 MB, after which the lowest-fee-rate transactions are evicted
  • Standard transaction checks: non-standard scripts, excessive size, or dust outputs cause rejection
  • Package limits: ancestor and descendant counts are capped (default 25 each) to prevent denial-of-service through long transaction chains
No global mempool: Because each node maintains its own mempool with potentially different policy settings, the view of "pending transactions" varies across the network. A transaction visible in one node's mempool may not exist in another's. Tools like mempool.space show the perspective of specific nodes, not a definitive global state.

Fee rate: the unit of measurement

Transaction fees in Bitcoin are not based on the value being transferred. A transaction sending 0.001 BTC costs the same as one sending 1,000 BTC, assuming they have the same size. What matters is the fee rate: the fee paid per unit of transaction weight, measured in satoshis per virtual byte (sat/vB).

Virtual bytes (vBytes) are a SegWit concept that normalizes the cost of witness data versus non-witness data. Witness data (signatures) is discounted by a factor of four, incentivizing SegWit adoption. A transaction's virtual size equals its weight divided by four. This means a Taproot key-path spend is cheaper per input than a legacy P2PKH spend, because Schnorr signatures sit in the witness and receive the discount.

Input TypeApproximate vBytes per InputSegWit Discount
Legacy P2PKH~148 vBNone
Nested SegWit (P2SH-P2WPKH)~91 vBPartial
Native SegWit (P2WPKH)~68 vBFull
Taproot (P2TR key-path)~58 vBFull
Multisig 2-of-3 (P2WSH)~105 vBFull

How Miners Select Transactions

Miners aim to maximize the total fee collected in each block. The naive approach is to sort all mempool transactions by fee rate and include them from highest to lowest until the block is full. In practice, transaction dependencies complicate this: a child transaction cannot be included without its unconfirmed parent, even if the child pays a higher fee rate.

Ancestor fee rate sorting

Bitcoin Core's block template algorithm uses ancestor fee rate as the primary sorting criterion. For each transaction, it calculates the combined fee rate of the transaction plus all its unconfirmed ancestors (parent transactions still in the mempool). This aggregate rate determines inclusion priority.

This design has important implications. A high-fee child transaction can effectively "pull in" a low-fee parent, because the combined ancestor fee rate of the child includes both. This is the basis of Child Pays for Parent (CPFP), discussed below.

Block template construction

The block template algorithm in Bitcoin Core repeatedly selects the transaction package (transaction plus ancestors) with the highest ancestor fee rate, adds it to the block, updates the remaining transactions' ancestor sets, and repeats until the block weight limit is reached. This greedy algorithm does not guarantee the globally optimal fee extraction, but it performs well in practice and runs efficiently.

Fee Estimation

Estimating the right fee for a transaction is one of the hardest problems in Bitcoin UX. Pay too little and your transaction may wait hours or days for confirmation. Pay too much and you waste money unnecessarily. Fee estimation must predict future demand for block space, which is inherently uncertain.

Bitcoin Core's estimator

Bitcoin Core includes a built-in fee estimator (estimatesmartfee) that tracks how long transactions at various fee rates take to confirm. It maintains a histogram of fee rates and observed confirmation times, then uses this historical data to recommend a fee rate for a target number of blocks. The estimator is intentionally conservative: it tends to overestimate rather than underestimate, prioritizing reliability over cost savings.

Failure modes of fee estimation

Fee estimators can fail in several ways, particularly during unusual market conditions:

  • Sudden demand spikes: a viral NFT mint or token launch can flood the mempool in minutes, rendering estimates stale before transactions confirm
  • Mempool clearing events: if several blocks are found in quick succession, the mempool may empty rapidly, and transactions overpay
  • Weekend/weekday patterns: fee markets have cyclical patterns tied to business hours and geographic activity, which simple estimators may not capture
  • Out-of-band fees: some miners accept fees through private channels or transaction accelerator services, making public mempool data an incomplete picture
Fee sniping risk: During periods of very high fees, miners have an economic incentive to re-mine recent blocks rather than extend the chain, because the fees in a recent block may exceed the block subsidy plus current mempool fees. Bitcoin Core mitigates this by setting nLockTime to the current block height on new transactions, making them invalid for inclusion in reorged blocks targeting earlier heights.

Replace-by-Fee (RBF)

Replace-by-Fee allows users to replace an unconfirmed transaction with a new version that pays a higher fee. This is the primary mechanism for adjusting fees after broadcast. The original opt-in RBF policy was specified in BIP 125, requiring transactions to signal replaceability by setting a sequence number below 0xfffffffe.

Full RBF

Bitcoin Core 24.0 introduced an option (mempoolfullrbf=1) to allow replacement of any unconfirmed transaction, regardless of signaling. By Bitcoin Core 28.0, full RBF became the default behavior. This change acknowledged that opt-in signaling provided a false sense of security: zero-confirmation transactions were never safe against determined double-spenders, and miners had always been free to include whichever transaction they chose.

RBF rules

A replacement transaction must satisfy several conditions under Bitcoin Core's default policy:

  • The replacement must pay a higher absolute fee than the sum of all transactions it displaces
  • The replacement's fee rate must exceed the original's fee rate
  • The replacement must pay for its own relay bandwidth: at least 1 sat/vB above the displaced transaction's fee rate
  • The replacement cannot evict more than 100 transactions from the mempool (to prevent DoS attacks)
  • All inputs in the original transaction must be included in or spent by the replacement

Child Pays for Parent (CPFP)

CPFP is a complementary fee-bumping technique that works differently from RBF. Instead of replacing the stuck transaction, you create a new child transaction that spends one of its outputs and pays a high enough fee to make the package (parent plus child) attractive to miners.

CPFP has a key advantage over RBF: the recipient of a transaction can use it, not just the sender. If Alice sends Bob a transaction with too low a fee, Bob can spend his (unconfirmed) output in a high-fee child transaction. Miners will include both the parent and child together, because the child cannot be mined without its parent.

FeatureRBFCPFP
Who can use itSender onlySender or recipient
MechanismReplace the original transactionSpend an output in a new high-fee transaction
Extra block spaceNo (replaces the original)Yes (adds a second transaction)
Cost efficiencyMore efficient (no extra transaction)Less efficient (pays for two transactions)
Requires planningMust signal or rely on full RBFRequires a spendable output (change output or anchor output)
Protocol supportBIP 125 / full RBFNative to miner selection algorithm

Anchor Outputs and Fee Management

Anchor outputs are a critical innovation for fee management in payment channel protocols. The problem they solve is fundamental: when a Lightning channel commitment transaction is created, the fee rate must be set in advance. But the transaction may not be broadcast for days, weeks, or months: by the time it needs to go on-chain, the fee market may look entirely different.

How anchor outputs work

Instead of pre-committing to a specific fee, anchor outputs allow the commitment transaction to be created with a minimal fee rate. Each party in the channel gets a small additional output (the anchor) that they can spend in a CPFP transaction to bump the fee at broadcast time. This decouples fee negotiation from the channel state update process.

The Lightning Network's adoption of anchor outputs (specified in BOLT 3) was a significant improvement. Before anchors, both channel counterparties had to agree on a fee rate for every commitment transaction, leading to fee negotiation failures during volatile fee markets. With anchors, the commitment transaction uses a low fee, and whichever party needs to broadcast it bumps the fee unilaterally using CPFP.

Ephemeral dust and zero-fee anchors

The evolution of anchor outputs continues with ephemeral dust outputs. Traditional anchors required each output to satisfy the dust limit (currently 546 satoshis for P2PKH outputs), tying up small amounts of capital. Ephemeral dust relaxes this constraint for transaction outputs that are guaranteed to be spent in the same block, enabling zero-value anchor outputs. This reduces the capital requirements for maintaining Lightning channels and simplifies the anchor spending logic.

Historical Fee Patterns

Bitcoin's fee market exhibits several recurring patterns tied to network events and market cycles. Understanding these patterns helps users and developers anticipate periods of high fees and design systems that remain functional during fee spikes.

Halving cycle correlation

Fee spikes tend to cluster around periods of high on-chain activity, which often correlate with bull markets that follow halving events. During the 2017 cycle, average fees reached levels that made sub-dollar transactions impractical. The 2021 cycle saw similar spikes. Each cycle has driven increased adoption of batching, SegWit, and Layer 2 solutions.

Ordinals and inscriptions

The launch of the Ordinals protocol in early 2023 introduced a new source of block space demand. Inscriptions embed arbitrary data (images, text, applications) into Bitcoin transactions, consuming significant witness space. This created sustained periods where fees were elevated not by financial transactions but by data storage. BRC-20 token mints further amplified fee pressure by generating large volumes of small transactions.

Consolidation windows

Experienced operators monitor the fee market for low-fee periods to consolidate UTXOs. Consolidation transactions combine many small UTXOs into a single larger one, reducing future transaction costs. Weekends and holidays often present lower fees, as do periods shortly after difficulty adjustments that increase block frequency.

Fee Strategies for Developers

Building Bitcoin applications that interact with the fee market requires deliberate design decisions. Naive fee handling leads to either overpaying during normal conditions or having transactions stuck during spikes.

Transaction batching

Batching combines multiple payments into a single transaction with multiple outputs. This is one of the most effective fee reduction strategies available. A batched transaction with 50 outputs is far cheaper than 50 individual transactions, because the fixed overhead (version, locktime, input data) is shared across all outputs.

UTXO management

Applications that generate many small UTXOs (such as exchanges or payment processors) should implement proactive UTXO consolidation during low-fee periods. Each additional input adds weight to a transaction, so a wallet full of small UTXOs may find itself paying substantial fees even for simple transfers. In extreme cases, the fee to spend a UTXO can exceed its value, rendering it economically unspendable: a phenomenon sometimes called "dust."

Fee bumping by design

Applications should always plan for fee bumping rather than trying to guess the perfect fee upfront. This means:

  • Enabling RBF signaling on all transactions so they can be replaced if fees spike after broadcast
  • Including change outputs that can be used for CPFP if the recipient needs to accelerate confirmation
  • Monitoring mempool conditions and adjusting fee estimates in real-time before broadcasting
  • Using anchor outputs in any protocol that involves pre-signed transactions with uncertain broadcast timing

Fee Impact on Layer 2 Protocols

On-chain fees have a direct impact on the economics and security of Layer 2 protocols. The relationship between base-layer fees and Layer 2 viability is one of the most important considerations in Bitcoin scaling design.

Lightning Network fee exposure

Lightning Network channels are exposed to on-chain fees at multiple points: opening, closing (cooperative or forced), and splicing. During fee spikes, force-close transactions require timely confirmation to enforce HTLC timeouts. If fees are too high, the justice transaction that punishes a cheating counterparty may become uneconomical to broadcast, weakening the security model.

This creates a paradox: the security of Lightning channels depends on the ability to transact on-chain, but high fees can make those on-chain transactions prohibitively expensive. The channel reserve requirements and watchtower economics are both affected by the fee environment.

Spark: fee-independent transfers

Spark takes a fundamentally different approach to the fee problem. Because Spark transfers happen entirely off-chain through key rotation rather than on-chain transactions, they are not subject to Bitcoin's fee market at all. A Spark transfer costs the same whether the mempool is empty or overflowing.

The only interaction with on-chain fees occurs during deposits (moving Bitcoin from L1 to Spark) and exits (moving Bitcoin from Spark back to L1). Once funds are on Spark, any number of transfers can occur without touching the blockchain. This makes Spark particularly resilient during fee spikes that can disrupt Lightning channel operations: there are no channels to open, close, or rebalance, and no force-close transactions that depend on timely on-chain confirmation.

Fee ScenarioOn-chain BitcoinLightning NetworkSpark
Low fees (1-5 sat/vB)All transactions cheapChannel management affordableTransfers unaffected
Medium fees (20-50 sat/vB)Small payments become expensiveChannel opens/closes cost more; routing fees may riseTransfers unaffected
High fees (100-500 sat/vB)Only large transactions practicalForce-close becomes risky; small HTLCs may be uneconomical to claimTransfers unaffected
Extreme fees (500+ sat/vB)Network congested; long confirmation timesChannel security degraded; dust HTLCs trimmedTransfers unaffected; exits expensive
Exit cost tradeoff: While Spark transfers are fee-independent, exiting from Spark to L1 requires an on-chain transaction. During extreme fee spikes, small Spark balances may be expensive to exit: the same dust economics that affect all Bitcoin Layer 2 solutions. The key difference is that Spark users can wait for low-fee periods to exit, since ongoing transfers do not depend on chain access.

The Future of Bitcoin Fees

Several developments are reshaping how the fee market operates and how users interact with it:

Package relay

Package relay (BIP 331) allows nodes to evaluate groups of related transactions together for mempool acceptance. Currently, a low-fee parent transaction may be rejected individually, even if it has a high-fee child that would make the package worth mining. Package relay fixes this by letting nodes accept the parent and child as a unit, significantly improving the reliability of CPFP for Layer 2 protocols.

Cluster mempool

The cluster mempool proposal restructures how Bitcoin Core organizes transactions internally. Instead of tracking individual ancestor and descendant relationships, it groups connected transactions into clusters and sorts them by fee rate chunks. This enables more accurate eviction decisions, better RBF evaluation, and a closer alignment between the mempool's ordering and the actual block template a miner would construct.

Fee-dependent timelocks

A proposed soft fork mechanism that would allow timelocks to account for fee market conditions. A transaction could specify that its timelock only advances during blocks where the median fee rate is below a threshold. This would protect Layer 2 users from scenarios where high fees prevent timely enforcement of time-sensitive transactions like HTLC claims or justice transactions.

Practical Recommendations

For users and developers navigating Bitcoin's fee market:

  • Use native SegWit or Taproot addresses to minimize transaction weight and benefit from the witness discount
  • Always enable RBF so you can adjust fees after broadcasting
  • Monitor mempool conditions before sending transactions: tools like mempool.space provide real-time visibility into fee rate distributions
  • Batch payments when possible to amortize the fixed transaction overhead across multiple outputs
  • Consolidate UTXOs during low-fee periods to avoid paying high per-input costs later
  • For time-insensitive payments, consider using off-chain protocols like Spark to avoid the fee market entirely

Bitcoin's fee market is a direct consequence of the protocol's most fundamental design choice: capping block size to keep the network decentralized. Fees are not a bug to be eliminated but a feature that ensures long-term security. The challenge for builders is to develop tools and protocols that let users interact with Bitcoin effectively regardless of where fees stand on any given day.

This article is for educational purposes only. It does not constitute financial or investment advice. Bitcoin and Layer 2 protocols involve technical and financial risk. Always do your own research and understand the tradeoffs before using any protocol.