Feedback
Sign in./start

Site navigation

Theme

Learn

  • Roadmaps

Build

  • Projects
  • Developer Tools

Contribute

  • Open Source Projects
  • Issues
  • Reviews
  • First Contribution
  • BountiesSoon
  • Feedback

Prove

  • Builders

Ecosystem

  • Partners
  • Get Funded↗
  • HackathonsSoon
Sign in./start-building

Become an Open Source Builder. Learn. Build. Contribute. Prove.

Feedback welcome — open a GitHub issue.

Learn

RoadmapsStart Building

Build

ProjectsDeveloper Tools

Contribute

Open Source ProjectsIssuesReviewsFirst ContributionSupportFeedback

Prove

Builders Directory

Account

Sign in

Legal

PrivacyTermsCredits

© 2026 Pull // code MIT · curriculum CC BY-SA 4.0

PrivacyTermsCredits

lesson // bitcoin

Mempool & Fees

Follow unconfirmed transactions, fee estimation, RBF, and CPFP.

intermediate4 days

Public lesson — sign in to track progress on this roadmap.

./sign-in

On this page

Learning objectives

  • Explain mempool policy versus consensus rules
  • Estimate fees and choose confirmation targets
  • Apply RBF and CPFP fee-bumping strategies

study // plan

Lessons are primers. Start with Step 1 (required reading) when present, then follow the numbered steps in the article. Depth comes from primary sources, labs, reflection, and evidence.

Research on Bitcoin Search
mempoolBIP125

Step 1 // Required reading

Complete these before the numbered steps in the lesson body. Links are listed here once — not repeated below.

  • bookMastering Bitcoin

    Ch. 9: Transaction Fees

Reflection prompts

  1. Explain Mempool & Fees to a teammate without jargon - what problem does it solve?
  2. What would break in production if you misunderstood Mempool & Fees?
  3. Which BIP, book chapter, or Core doc is authoritative here, and what did you verify?

Lab // Fee rate + bump strategy

Complete Steps 2–3. On regtest (or with estimatesmartfee), compute a sat/vB example and write which bump tool you would use if the tx stalled — RBF or CPFP — and why.

evidence required

  • ·Fee rate calculation (feeSats / vsize) or estimatesmartfee output
  • ·One sentence choosing RBF vs CPFP for a stuck payment scenario
  • ·Link to Mastering Bitcoin Ch. 9 or Optech fee-bumping section you used
  1. 01

    Worked mental model

    Re-read the diagrams in this lesson once out loud in plain language. If you cannot explain the flow to a friend without jargon, pause and revisit the Mastering Bitcoin / Mastering Lightning chapters linked in Resources. Chapter references are intentional, not decorative.

  2. 02

    Hands-on habit

    Every protocol idea should be paired with one local experiment. That habit turns reading into builder instinct.

    1. Reproduce the happy path on regtest (or Polar for Lightning)
    2. Break it on purpose (wrong fee, expired invoice, offline peer)
    3. Write down what error you saw and which layer produced it (wallet, node, mempool, peer)
  3. 03

    Glossary check

    Pick three terms from this lesson and define them in one sentence each without opening notes. Weak definitions mean the lesson is not finished yet.

  4. 04

    Resource order

    Use Resources in order: narrative book chapter first, then BIP/BOLT for precision, then implementation docs for commands. Jumping straight to RPC flags without the mental model creates brittle knowledge.

The mempool is each node’s holding area for valid unconfirmed transactions. Miners (and other nodes) choose what to relay and mine based on policy and fees — not every consensus-valid transaction is welcome under default policy.

Complete Step 1 // Required reading in the study plan above, then continue here. This lesson closes the Bitcoin Basics chapter.

Step 2 — Core idea: auction, policy, bumping

Users experience Bitcoin through confirmation delays and fee spikes. Wallets that cannot bump fees create support nightmares.

Analogy: An auction-house lobby. Anyone can submit a bid (transaction). Higher fee rates tend to get seated (mined) first when space is scarce. Some items are rejected at the door for policy reasons even if they are “legal.”

const feeRateSatVb = feeSats / vsize;

Estimate using node RPCs (estimatesmartfee) or public observers, then expose slow/medium/fast targets in UX.

Loading diagram…

Stuck transactions need fee bumping via RBF or CPFP.
  • RBF (BIP-125): replace an unconfirmed tx with a higher-fee variant (signals required)
  • CPFP: spend an unconfirmed output with a high-fee child that incentivizes mining both

Policy ≠ consensus

A transaction can be consensus-valid yet non-standard under default mempool policy. Test relay behavior, not only block validity on regtest miner shortcuts.

Done when: You can explain when RBF vs CPFP is the right bump tool.

Step 3 — Try it: fee math + bump choice (lab)

bitcoin-cli -regtest estimatesmartfee 6
# Or after a send: feeSats / vsize from getrawtransaction ... true

Pick a stuck-payment scenario (e.g. low fee, no RBF signal, or you control a change output). Write which bump you would use and why.

Common mistakes

  • Broadcasting without RBF signaling when users may need to bump
  • Overpaying dramatically due to stale fee estimates
  • Creating long unconfirmed chains that hit ancestor/descendant limits

Done when: Lab evidence (fee calc + RBF/CPFP choice + source link) is complete. Complete the chapter quiz when prompted.

Next lesson

P2P Network (Protocol Depth) — how transactions and blocks actually propagate.

further reading

  • bipBIP-125 RBF
  • articleBitcoin Optech: Fee bumping

review // club

Chapter review picks

Practice on real Bitcoin OSS changes tied to this chapter. Read the diff, use the checklist, and optionally paste your review comment URL in your lab notes.

  • Mempool.space explorer GFI

    Compare mempool.space's fee views with what you'd build in the block explorer project.

    gfi
    UXfee visualization
    30 min·beginneropen on GitHub
  • Bitcoin Optech fee bumping topics

    Study Optech's fee-bumping overview and connect it to wallet UX when mempools are congested.

    spec review
    RBFCPFPfee markets
    40 min·intermediateopen on GitHub
  • BDK wallet good first issue

    Shortlist a BDK GFI related to UTXO or wallet APIs and draft a one-paragraph approach.

    gfi
    UTXO trackingAPI clarity
    30 min·intermediateopen on GitHub
  • rust-bitcoin serialization PRs

    Review a rust-bitcoin PR touching transaction or script encoding and check test coverage.

    pr review
    consensus encodingtests
    40 min·intermediateopen on GitHub
  • BIP-141 SegWit specification

    Read BIP-141 and summarize how witness data changed block weight and transaction serialization.

    spec review
    vbyteswitness commitmentsoft fork
    45 min·intermediateopen on GitHub
  • BIP-341 Taproot specification

    Walk through BIP-341 and note what observers learn from key-path vs script-path spends.

    spec review
    key pathscript pathprivacy
    50 min·advancedopen on GitHub
review checklist
  1. Does the change solve the stated problem?
  2. Are edge cases and rollout behavior covered?
  3. Are tests or test vectors included?
  4. Is the diff minimal and clearly explained?

More repos and GFIs on /discover and /issues.

build // next

Apply this chapter in a project

You have the concepts — ship something small to prove it. These Pull projects connect directly to what you just studied.

  • project // utxo-selector

    ./spec./submit
  • project // tx-decoder

    ./spec./submit

discussion

Discussion

prevMultisig & TimelocksnextP2P Network

On this page

Press Shift + ? for keyboard shortcuts.

Press R to research on Bitcoin Search.

No questions yet — be the first to ask.