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

Cryptography Primer

Hashes, key pairs, ECDSA, and Schnorr signatures in a Bitcoin context.

beginner5 days

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

./sign-in

On this page

Learning objectives

  • Explain hashing and why Bitcoin uses SHA-256 and RIPEMD-160
  • Describe public-key cryptography and digital signatures
  • Contrast ECDSA and Schnorr at a builder level

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
BIP340Schnorr

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

    Start with private keys, public keys, and address encodings.

  • bookMastering Bitcoin

    Ch. 8: Signatures

    Read ECDSA vs Schnorr sections.

  • bipBIP-340 Schnorr

Interactive lab // Decoding Bitcoin

Open these Bitcoin Dev Project modules and tools before (or alongside) the graded lab. Capture evidence from the interactive path — do not only skim Pull.

  • Decoding Bitcoin: Hash functions

    Interactive hash playground - pair with the SHA-256 visualizer.

  • BDP: SHA-256 hashes visualizer

    Step through SHA-256 rounds visually (Hash Explained).

  • Decoding Bitcoin: Schnorr signatures

    Builder-level Schnorr before BIP-340.

  • Decoding Bitcoin: Nonce reuse attack

    Why ECDSA nonce reuse is catastrophic - matches a reflection prompt.

Reflection prompts

  1. Why is a digital signature not the same thing as encryption, and how does that show up in Bitcoin transactions?
  2. What goes wrong if an ECDSA nonce is reused, and how does Schnorr change the builder mental model?
  3. After reading BIP-340, what one property of Schnorr would you explain to a wallet engineer in two sentences?

Lab // Hash demo + interactive crypto

Complete Steps 2–3. Use the required hash-functions lab, hash a known string locally, and inspect a throwaway regtest/testnet address. Never reuse that key.

evidence required

  • ·Screenshot or notes from Decoding Bitcoin hash functions (or hashes visualizer)
  • ·SHA-256 digest of a known string (show input + output)
  • ·Address or pubkey you derived for lab-only use
  • ·Note confirming the key material was discarded
  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.

Bitcoin does not “store passwords on the blockchain.” Ownership is proven with cryptography: one-way hashes and signatures that anyone can verify, but only the key holder can create.

Complete Step 1 // Required reading in the study plan above (and the interactive hash lab when listed there). Optional tools sit under further reading beneath the article.

Step 2 — Core idea: hashes, keys, and verify

TermMeaningBitcoin use
HashFingerprint of data; one-wayTxids, block ids, script commits
Private keySecret that can signSpend authority
Public keyDerived from private; safe to share for verifyAddresses / outputs
ECDSAHistorical signature schemePre-Taproot
Schnorr (BIP-340)Taproot’s preferred signaturesSmaller, aggregation-friendly

Analogy: A hash is a fingerprint; a signature is a wax seal — anyone can check it, only the private seal can create it.

// Conceptual — use audited libraries in production
type Hash256 = string;
 
function commitsTo(data: Uint8Array, digest: Hash256): boolean {
  // true if sha256(data) === digest
  return true;
}

Loading diagram…

Signing uses the private key; verification uses the public key and message.

Never invent crypto

Use battle-tested libraries (secp256k1, bitcoinjs-lib, rust-bitcoin, BDK). A one-line RNG mistake can leak keys.

Remember: private keys are secrets; signatures authorize specific sighashes; treat SHA-256 digests as unique IDs in practice.

Done when: You can walk the Mermaid diagram out loud without notes.

Step 3 — Try it and capture lab evidence

  1. Re-open the required hash-functions lab if needed; optionally use the SHA-256 visualizer from further reading.
  2. Locally hash a known string; record input + digest.
  3. Derive a lab-only address or pubkey on regtest/testnet; discard that key material.

Common mistakes

  • Confusing encryption with signatures
  • Reusing ECDSA nonces
  • Assuming “hashed” means “secret” for low-entropy inputs

Done when: Lab evidence is complete and you would refuse to reuse the lab key.

Next lesson

Learn Bitcoin Economics — supply, fees, and why miners secure the chain — then dive into UTXOs.

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

prevGit & Open Source WorkflownextBitcoin Economics

On this page

Press Shift + ? for keyboard shortcuts.

Press R to research on Bitcoin Search.

No questions yet — be the first to ask.