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

Keys & Addresses

Private keys, public keys, address encodings from P2PKH through Taproot.

beginner5 days

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

./sign-in

On this page

Learning objectives

  • Derive the mental model from private key to address
  • Recognize legacy, SegWit, and Taproot address formats
  • Know which encoding standards apply (Base58, Bech32, Bech32m)

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
BIP32BIP39

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. 4: Keys and Addresses

Reflection prompts

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

Lab // Address types on regtest

Complete Steps 2–3. Generate Bech32 and Bech32m addresses on regtest and inspect scriptPubKey / descriptor fields with getaddressinfo.

evidence required

  • ·getnewaddress output for bech32 and bech32m (or equivalent)
  • ·getaddressinfo snippet showing scriptPubKey or desc for one address
  • ·One sentence linking the address string to the locking condition
  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.

An address is not a bank account number in a central database. It is a compact encoding of a locking condition — usually “prove you control this public key.”

Complete Step 1 // Required reading in the study plan above, then continue here.

Step 2 — Core idea: private → public → address

Wrong address type, wrong network prefix, or a typo can permanently lose funds. Validate addresses and know what each format commits to.

Analogy: The private key is the only key to a mailbox. The public key is a lock design others can verify. The address is the mailbox label so people can send mail without seeing the lock’s internals.

Loading diagram…

Derivation is one-way: addresses do not reveal private keys.
private key  →  public key  →  hashing / tweaking  →  address string

Never type private keys into random websites. In apps, keep keys in secure modules or hardware wallets.

TypeLooks likeNotes
P2PKHstarts with 1Legacy Base58Check
P2SHstarts with 3Script hash wrapper
P2WPKH / P2WSHbc1q...SegWit v0 Bech32
P2TRbc1p...Taproot Bech32m

Testnet/regtest use different HRPs (tb1, bcrt1, etc.). Always check the network.

Loading diagram…

Different output types encode different locking conditions.

Checksums are not enough

Address checksums catch typos, but they do not stop you from sending to the wrong person or the wrong network.

Base58Check (legacy) mixes numbers and letters and appends a checksum. Bech32 has stronger error detection; Bech32m (BIP-350) tweaks the checksum for Taproot (bc1p). If a library says “invalid checksum,” regenerate — do not hand-edit the string.

HD wallets derive many keys from one seed. Back up the seed/mnemonic, the descriptor or derivation standard, and multisig cosigner records if applicable.

Done when: You can map each address family in the table to an encoding and network HRP.

Step 3 — Try it on regtest (lab)

bitcoin-cli -regtest getnewaddress "" "bech32"
bitcoin-cli -regtest getnewaddress "" "bech32m"
bitcoin-cli -regtest getaddressinfo <addr>

Read scriptPubKey and desc — they connect the address string to the underlying lock.

Builder habits

  • Validate with a library, not regex alone
  • Refuse sends to the wrong chain
  • Prefer Bech32/Bech32m for new wallets (fees + error detection)

Done when: Lab evidence (two address types + getaddressinfo + one linking sentence) is complete.

Next lesson

Blocks & Chain — where confirmed UTXOs live and how reorgs affect finality.

further reading

  • bipBIP-173 Bech32
  • bipBIP-350 Bech32m

progress // sign in

Reading is public. Sign in to mark lessons complete, sync across devices, and unlock your roadmap.

./sign-in-to-track

discussion

Discussion

prevUTXO ModelnextBlocks & Chain

On this page

Press Shift + ? for keyboard shortcuts.

Press R to research on Bitcoin Search.

No questions yet — be the first to ask.