Transaction Fees

11 min readarticleIncludes quiz · 5 questions

Bitcoin transaction fees pay miners to include your transaction in a block. Fees are not fixed—they vary based on network congestion and transaction size. Higher fees mean faster confirmation. Understanding fees helps you avoid overpaying while ensuring timely confirmation.

What are Transaction Fees?

  • Definition: Payment to miners for including your transaction in a block.
  • Calculation: Sum of inputs minus sum of outputs (implicit, not explicitly stated).
  • Market-based: You compete with other users—higher fee = higher priority.
  • Measured in sat/vB: Satoshis per virtual byte (weight-based fee rate).
  • Voluntary but necessary: Technically optional, but zero-fee transactions rarely confirm.
Transaction Fees
Transaction Fees

Key Definitions:

  • sat/vB: Satoshis per virtual byte—the standard fee rate metric.
  • Virtual byte (vByte): Weight-adjusted size after SegWit (1 vByte = 4 weight units).
  • Fee market: Users bid for block space by setting fees; miners prioritize highest fees.
  • Fee estimation: Wallets estimate appropriate fees based on recent blocks and mempool.
  • Replace-By-Fee (RBF): Increasing a transaction's fee after broadcasting.
  • Child-Pays-For-Parent (CPFP): Recipient adds high fee to unconfirmed parent transaction.

How Fees Are Calculated:

Formula: Fee = (Inputs) - (Outputs)

Example:

  • Input: 0.1 BTC
  • Output 1: 0.05 BTC (payment)
  • Output 2: 0.0499 BTC (change)
  • Fee: 0.1 - 0.05 - 0.0499 = 0.0001 BTC (10,000 sats)

If transaction size is 250 vBytes: Fee rate = 10,000 sats / 250 vB = 40 sat/vB

Fee Rates (sat/vB):

Current market conditions vary, but typical ranges:

  • 1-5 sat/vB: Very low priority. May take days or weeks. Only when mempool is empty.
  • 10-20 sat/vB: Low priority. Next few hours to days. Good for non-urgent payments.
  • 30-50 sat/vB: Medium priority. Next few blocks (30-60 min). Standard for most transactions.
  • 100+ sat/vB: High priority. Next block (10 min). Urgent payments during congestion.
  • 500+ sat/vB: Emergency. High congestion or extremely urgent.

Check current rates: mempool.space, bitcoinfees.net

Mempool Fee Distribution
Mempool Fee Distribution

What Affects Transaction Size?

Larger transactions = higher fees:

  • Number of inputs: Each input adds ~68 vBytes (SegWit) or ~148 bytes (legacy)
  • Number of outputs: Each output adds ~31 vBytes (SegWit) or ~34 bytes (legacy)
  • Address types: SegWit/Taproot are smaller than legacy
  • Multisig: Multiple signatures increase size
  • Script complexity: Complex scripts (timelocks, etc.) add data

Example:

  • 1-input, 2-output SegWit tx: ~140 vBytes
  • 10-input, 2-output SegWit tx: ~700 vBytes (5x larger = 5x fee)

Fee Estimation Strategies:

Wallets estimate fees using:

  • Recent block data (what fees got confirmed recently?)
  • Current mempool (how many transactions waiting?)
  • User urgency (slow, medium, fast confirmation)

Choosing a fee:

  • Too low: Transaction stuck in mempool, takes forever
  • Too high: Wastes money, but confirms fast
  • Just right: Confirms in target time (e.g., next 3 blocks)

Resources:

  • mempool.space: Visual mempool and fee estimates
  • bitcoinfees.net: Simple fee recommendations
  • Your wallet's built-in estimator

Replace-By-Fee (RBF):

What is RBF?

  • Ability to increase fee on unconfirmed transaction
  • Broadcast a new version with higher fee
  • Miners drop old version, prioritize new one
  • Must be signaled when creating original transaction (sequence < 0xfffffffe)

When to use:

  • Your transaction is stuck (fee too low)
  • Network congestion increased unexpectedly
  • You need faster confirmation

How to use:

  • Many wallets support RBF (Electrum, Sparrow, BlueWallet)
  • Select stuck transaction, choose "Bump Fee"
  • Wallet creates new transaction with same inputs but higher fee

Limitation:

RBF Process
RBF Process

Child-Pays-For-Parent (CPFP):

What is CPFP?

  • Recipient spends unconfirmed UTXO with high fee
  • Miner must include parent transaction to collect child's high fee
  • Effectively boosts parent transaction priority

When to use:

  • You received a transaction with too-low fee
  • Sender didn't use RBF (can't bump fee)
  • You need the funds confirmed urgently

How it works: 1. Alice sends Bob 0.1 BTC with 1 sat/vB fee (very low) 2. Bob creates new transaction spending that 0.1 BTC with 200 sat/vB fee 3. Miners see: to get Bob's high fee, must also include Alice's low-fee tx 4. Both transactions confirm together

Trade-off:

  • Recipient pays to speed up sender's transaction
  • Useful if you control both addresses

Fee Market Dynamics:

What drives fees up:

  • High transaction volume (bull markets, NFT mints, etc.)
  • Block space is limited (~1 MB per block)
  • Users bidding higher to get confirmed faster

What drives fees down:

  • Low transaction volume (bear markets, weekends)
  • SegWit/Taproot adoption (more efficient use of space)
  • Lightning Network (moves transactions off-chain)
  • Batching and consolidation

Long-term:

  • Block subsidy decreases every halving
  • Fees must eventually replace subsidy to secure network
  • Fee market will become more important over time

Stuck Transactions:

Why transactions get stuck:

  • Fee too low for current mempool conditions
  • Network congestion increased after broadcasting
  • Spending unconfirmed outputs (parent stuck = child stuck)

Solutions: 1. Wait: Mempool clears eventually, transaction confirms or expires (2 weeks default) 2. RBF: Bump fee if enabled 3. CPFP: Recipient spends with high fee 4. Rebroadcast: Some nodes drop old transactions; rebroadcast to refresh 5. Cancel: If supported, create conflicting transaction with higher fee to yourself (double-spend your own transaction)

Test Your Knowledge

This lesson includes a 5-question quiz (passing score: 75%).

Quiz functionality available in the mobile app.