Overview
Transaction fees are an essential component of Bitcoin's economic model. They serve two purposes: incentivizing miners to include transactions in blocks, and providing long-term security for the network as block rewards diminish through halvings. Fees are not explicitly stated in a transaction; rather, they are implicitly calculated as the difference between the sum of all inputs and the sum of all outputs.
How Fees Are Calculated
Fee = Sum of Input Values - Sum of Output Values
Example:
┌─────────────────────────────────────────┐
│ Input 1: 0.005 BTC (500,000 sats) │
│ Input 2: 0.003 BTC (300,000 sats) │
│ ───────────── │
│ Total In: 0.008 BTC (800,000 sats) │
│ │
│ Output 1: 0.006 BTC (600,000 sats) │ ← payment
│ Output 2: 0.00185 BTC (185,000 sats) │ ← change
│ ───────────── │
│ Total Out: 0.00785 BTC (785,000 sats) │
│ │
│ Fee: 0.00015 BTC (15,000 sats) │
└─────────────────────────────────────────┘
Fee Priority
Miners prioritize transactions by their fee rate (satoshis per virtual byte), not total fee amount. A small transaction paying a high fee rate will typically be confirmed before a large transaction paying a lower fee rate.
Transaction A: 250 vB, 5,000 sat fee → 20 sat/vB ← confirmed first
Transaction B: 500 vB, 7,500 sat fee → 15 sat/vB ← confirmed second
Fee Estimation
Wallets estimate appropriate fees by analyzing the current mempool:
- High priority (1-2 blocks): Higher fee rate for urgent transactions
- Medium priority (3-6 blocks): Balanced fee for normal use
- Low priority (12+ blocks): Minimal fee when timing is not critical
- Economy: Lowest reasonable fee, may take hours or days
Fee Optimization Strategies
- Batching: Combine multiple payments into a single transaction to share the overhead of inputs and headers
- SegWit: Use SegWit addresses to benefit from the witness discount, reducing effective fees
- Timing: Send transactions during low-demand periods (weekends, nighttime UTC)
- UTXO management: Consolidate small UTXOs during low-fee periods to avoid paying high fees on many inputs later
- RBF (Replace-By-Fee): Start with a lower fee and bump it if the transaction does not confirm quickly enough
Common Misconceptions
- Fees are not proportional to the bitcoin amount being sent. A transaction sending 100 BTC can cost the same fee as one sending 0.001 BTC if both have the same size in virtual bytes.
- There is no minimum fee enforced by consensus. However, nodes enforce a minimum relay fee (default 1 sat/vB) to prevent spam.
- Fees go to the miner who includes the transaction in a block, not to "the Bitcoin network" as an entity.