A Student's Guide to Distributed Ledgers
A 20-chapter course on blockchain technology, written as runnable Jupyter notebooks. Each chapter pairs a short explanation with hands-on Python examples — tampering with a naive ledger, building chained hashes, simulating consensus, scoring use cases, and more. Examples use the Python standard library almost exclusively and seed their random number generators, so every run is reproducible.
Link to Amazon: Blockchain in Theory and Practice: A Student's Guide to Distributed Ledgers
Each chapter is available in two formats:
- ipynb/ — interactive Jupyter notebooks (run and modify the examples yourself)
- pdf/ — pre-rendered PDFs for reading offline or printing
| # | Chapter | Notebook | |
|---|---|---|---|
| 1 | Blockchain and the Derivatives Market: An Introduction | ipynb | |
| 2 | A Short History of Blockchain | ipynb | |
| 3 | Types of Blockchain: Public, Private, Permissioned, and Consortium | ipynb | |
| 4 | Transactions, Blocks, and the Chain Data Structure | ipynb | |
| 5 | Cryptographic Foundations: Hashing, Signatures, and Wallets | ipynb | |
| 6 | Consensus I: Byzantine Generals, Proof-of-Work, and Proof-of-Stake | ipynb | |
| 7 | Consensus II: BFT Families, Raft, and Proof-of-Authority | ipynb | |
| 8 | Performance and Scalability: Transactions per Second | ipynb | |
| 9 | Smart Contracts, Peer-to-Peer Networks, and Hash Maps | ipynb | |
| 10 | Reference Architecture: Inside Hyperledger Fabric | ipynb | |
| 11 | Use Cases I: Cross-Border Data Clearance and the Coin-Based Exchange | ipynb | |
| 12 | Use Cases II: Digital-Asset Custody and Immutable Metadata Storage | ipynb | |
| 13 | The Landscape Since 2023: A 2026 Update | ipynb | |
| 14 | Real-World Asset Tokenisation | ipynb | |
| 15 | Stablecoins: Design, Reserves, and Risk | ipynb | |
| 16 | Stablecoins, Money, and the Economy | ipynb | |
| 17 | Central Bank Digital Currencies | ipynb | |
| 18 | Decentralised Finance (DeFi) | ipynb | |
| 19 | Oracles, Interoperability, and Cross-Chain Infrastructure | ipynb | |
| 20 | Security, Risk, and Assurance in Tokenised Finance | ipynb |
Requires Python 3.10 or newer.
# 1. Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# 2. Install dependencies
pip install -r requirements.txt
# 3. Launch Jupyter and open any chapter
jupyter notebook ipynb/The examples rely on the Python standard library, with one exception: chapter 5 uses the ecdsa package for elliptic-curve signatures (installed via requirements.txt). Run the cells in each notebook in order; they are designed to be modified and re-run.
The PDFs in pdf/ are generated from the notebooks with nbconvert, which requires two system tools in addition to the Python dependencies:
- Pandoc
- A LaTeX distribution with XeLaTeX (e.g.
texlive-xetexandtexlive-fonts-recommendedon Debian/Ubuntu)
On Debian/Ubuntu:
sudo apt install pandoc texlive-xetex texlive-fonts-recommendedThen rebuild any chapter (or all of them):
jupyter nbconvert --to pdf ipynb/chapter01.ipynb --output-dir pdf/ipynb/ # 20 chapter notebooks (the source of truth)
pdf/ # pre-rendered PDF of each chapter
requirements.txt # Python dependencies