Modeled on Princeton’s Bitcoin and Cryptocurrency Technologies + Nakamoto’s whitepaper

区块链与比特币:从哈希到中本聪共识,亲手搭一条链

Blockchain & Bitcoin: From Hashes to Nakamoto Consensus, Build a Chain Yourself

Hash-pointer chains, Merkle proofs, PoW nonce search, the whitepaper's own attack probability — all in stdlib hashlib, offline and deterministic

8 labs13 AI-mentored sessions~7 hoursBilingual · EN / 中
Start learning →

About this course

Bitcoin's most counterintuitive feat: a crowd of mutually distrusting strangers, any of
whom could cheat, nonetheless agree on "who owns what" — with no bank, no central server.
This flagship build-it-yourself course takes that machine apart layer by layer and has you
rebuild it by hand: no mainnet connection, no heavy libraries — just Python's built-in
hashlib and numpy, running every piece offline and deterministically in your own sandbox.
You'll build a tamper-evident chain from hash pointers and watch one flipped byte cascade
through every downstream hash; write a Merkle tree's membership proof and feel why O(log n)
suffices; hand-roll a toy elliptic curve to sign and verify, grasping "public key as
identity"; walk GoofyCoin straight into the double-spend problem and see how ScroogeCoin
fixes it with centralization — and why centralization is unacceptable. Then the core:
Nakamoto consensus's longest-chain rule, proof-of-work's nonce search (finding leading
zeros), and the attacker-catch-up probability from Section 11 of the whitepaper, which
you implement yourself — dragging attacker hash-fraction q and confirmations z to watch the
double-spend success probability decay exponentially. Beyond that: UTXO transactions and a
Bitcoin Script stack machine, difficulty adjustment, mining pools and the 51% attack, hot/
cold wallet storage, on-chain anonymity and mixing, all the way to altcoins, proof-of-stake,
and smart contracts. The course follows Princeton's Bitcoin and Cryptocurrency Technologies
skeleton plus Nakamoto's whitepaper; every session is original hands-on teaching rebuilt for
the online sandbox — typeset formulas, diagrammed structures, draggable parameters, code
that really runs. You leave no longer treating a blockchain as a black box, but knowing why
every byte is where it is.

Syllabus

1Cryptographic Foundations3 sessions
  • 1Cryptographic Hashes & Hash Pointers: A Tamper-Evident Log30 minStart →
  • 2Merkle Trees: Efficient Membership Proofs30 minStart →
  • 3Digital Signatures & Public Keys as Identities30 minStart →
2A Simplest Cryptocurrency1 session
  • 1From GoofyCoin to ScroogeCoin: Double-Spending & the Centralization Dilemma30 minStart →
3Decentralization & Nakamoto Consensus2 sessions
  • 1Distributed Consensus & Nakamoto Consensus: the Longest-Chain Rule30 minStart →
  • 2Incentives & Proof-of-Work: Block Reward, Fees & Why Honesty Pays30 minStart →
4Transactions, Script & Blocks2 sessions
  • 1Transactions & the UTXO Model30 minStart →
  • 2Bitcoin Script & Block Structure (P2PKH Stack Validation)30 minStart →
5Mining, In Depth2 sessions
  • 1Mining: Difficulty Adjustment & Block Time30 minStart →
  • 2Mining Pools, the 51% Attack & the Double-Spend Race (the Whitepaper's Poisson Calc)30 minStart →
6Storing & Using Bitcoins1 session
  • 1Key Management: Hot/Cold Storage, Split Keys & HD Wallets30 minStart →
7Anonymity & Privacy1 session
  • 1Deanonymization & Mixing: On-Chain Linkability, Mixing & a Peek at Zero-Knowledge30 minStart →
8Ecosystem & the Future1 session
  • 1Altcoins, Sidechains, Proof-of-Stake & Smart Contracts (a Peek at Ethereum)40 minStart →

Same series · 计算机科学与工程探索

CS & Engineering Explorations

Build from scratch the systems you usually treat as black boxes — and understand them to the core.