From hash functions to block chaining, mining, elliptic curves and signatures, UTXO transactions, distributed consensus, and the smart contract virtual machine. Over 30 lessons, you'll work up to building Bitcoin and Ethereum's internals with your own hands. You'll use nothing but Python's standard library — not a single external package.
The 30 lessons are split into 6 chapters. We recommend working through them in order starting from Chapter 1, but feel free to skip around to whatever interests you. * Short snippets that only use the standard library run right in your browser. For lessons that use the shared helper code (common/), run the sample code yourself with Python 3 (all output in this course was generated with Python 3.14.2).
We start by pinning down exactly what problem an administrator-free ledger solves, then get hands-on with the hash functions that make it possible. You'll chain blocks together, bundle transactions with a Merkle tree, and finish by building proof-of-work and difficulty adjustment yourself.
This chapter brings "who" into the ledger. Starting from point addition on secp256k1, you'll build private and public keys, ECDSA signatures, and Bitcoin addresses by hand. You'll finish with 12-word mnemonics and HD wallets, growing an unlimited number of keys from a single seed.
You'll understand the UTXO model, where there's no such thing as a "balance" number, and build and sign transactions by hand. You'll actually try a double-spend — sending the same coin to two people — and see exactly where a node stops it, finishing with the UTXO selection and change calculation a wallet handles automatically.
You'll build the waiting room transactions sit in before they make it into a block, the fee market around it, and how new coins are created along with the halving schedule. From there you'll move into a world with multiple miners, seeing how forks get resolved and actually reproducing a 51% attack that exploits that very rule.
The stage shifts from Bitcoin to Ethereum, where you'll get a handle on the account model's way of seeing the world. From there you'll build the EVM yourself as a stack machine, understanding storage, gas, and calldata — the three pillars of smart contracts — down at the level of individual instructions.
You'll build if and while out of nothing but JUMP, notify the outside world with events, and call contracts from other contracts. You'll finish by building an ERC-20 token and running every piece from all 30 lessons through a single chain from start to finish.
Once you've finished all 30 lessons, head over to Python Fundamentals to strengthen your foundations, or Python Security Fundamentals to add an attack-and-defense perspective. A membership unlocks every course.