Skip to content
Tutorials Center
My learning

Topics

Blockchain Tutorial

Learn Blockchain step by step: 41 lessons in 8 chapters with examples, quizzes, diagrams and projects.

Start learning →

of lessons completed

Getting Started

  1. 1 What Is a Blockchain? Understand what a blockchain is, the problem it solves, how blocks link into a chain, and what it is not. Includes a tiny live demo in Python.
  2. 2 How a Blockchain Works End to End Follow one transaction through a blockchain network: signing, the mempool, block proposal, validation, confirmations and finality, with a clear diagram.
  3. 3 History and Landscape: Bitcoin, Ethereum and Beyond A short history of blockchain from cypherpunks to Bitcoin and Ethereum, plus public, private and consortium chains, layer 2s and hype worth ignoring.

Cryptography Foundations

  1. 4 Cryptographic Hash Functions Learn what a cryptographic hash function does, with SHA-256 in Python: determinism, the avalanche effect, preimage and collision resistance, bytes vs text.
  2. 5 Hash Pointers and Tamper Evidence Link records by their hash to build tamper-evident logs. Detect edits, find where history was changed, and see why rewriting a long chain is costly.
  3. 6 Merkle Trees and Proofs of Inclusion Build a Merkle tree in Python, handle odd leaf counts, compute the root and verify a proof of inclusion with only log n hashes. See how light clients use it.
  4. 7 Public-Key Cryptography Basics Understand key pairs, signing versus encryption, why a key replaces an account on a blockchain, and why key size and randomness matter, with a toy RSA example.
  5. 8 Digital Signatures with a Toy Scheme Build a Lamport one-time signature from SHA-256 in Python, see why signatures prove authorization, why a key must not sign twice, and how replay attacks work.
  6. 9 Elliptic Curves in Plain Language Learn point addition and scalar multiplication on a tiny elliptic curve, how secp256k1 and ECDSA work, and why reusing a signing nonce leaks the private key.
  7. 10 Keys, Addresses and Wallets Follow a blockchain identity from private key to public key to address, learn Base58Check checksums, seed phrases and HD wallets, and why custody matters.

Building a Toy Blockchain

  1. 11 Designing a Block Design a blockchain block in Python: header versus body, index, timestamp, previous hash and nonce, with deterministic JSON serialization and dataclasses.
  2. 12 Building and Validating the Chain Create a genesis block, append linked blocks, verify the whole chain and see exactly how tampering is detected, with a runnable Python toy blockchain.
  3. 13 Proof of Work and Mining Learn how proof of work turns hashing into a cost: leading-zero difficulty, nonce search, the probability maths and the energy trade-off, with live Python.
  4. 14 Difficulty Adjustment and Block Time See how a proof-of-work chain retargets difficulty so blocks keep a steady pace when hash power changes, with a seeded Python simulation and a plot.
  5. 15 Transactions and the Mempool Build signed transactions, validate them against balances and nonces, hold them in a mempool and assemble a block by fee, with live Python.
  6. 16 UTXO vs Account Model Compare Bitcoin-style UTXOs with Ethereum-style account balances and nonces, including change, double-spend checks and trade-offs, with two live Python ledgers.

Consensus and Networks

  1. 17 The Double-Spend Problem and Byzantine Faults Why digital cash needs consensus: double spends, the Byzantine generals problem, Sybil attacks and trust assumptions, with small live Python demos.
  2. 18 Longest Chain Rule, Forks and Reorgs See how proof-of-work chains settle disagreement: competing blocks, stale blocks, reorganizations, confirmations and 51 percent attack odds, simulated in Python.
  3. 19 Peer-to-Peer Networking and Gossip See how blockchain nodes find peers, gossip blocks and transactions across the network, why latency causes forks, and how light nodes differ from full nodes.
  4. 20 Proof of Stake Learn how proof of stake picks validators by locked-up stake, how slashing and finality work, what nothing-at-stake means, and run a live lottery simulation.
  5. 21 BFT, Delegated and Other Consensus Mechanisms Compare PBFT-style voting, quorum math (3f+1), Raft, delegated and authority-based consensus and DAG ledgers, with a live quorum calculator in Python.

Smart Contracts

  1. 22 What Are Smart Contracts? Understand smart contracts: programs stored on a blockchain, deterministic execution, contract state, gas as metering and the limits of on-chain code.
  2. 23 Building a Toy Smart Contract Engine Build a tiny smart contract engine in Python: contract classes, metered storage, calls as transactions, gas counting, events and automatic reverts.
  3. 24 Reading Solidity: A First Contract Learn to read a first Solidity contract: pragma, state variables, functions, events, msg.sender and require, with a counter and a token and Python equivalents.
  4. 25 Tokens, ERC-20 and NFTs Learn fungible and non-fungible tokens: the ERC-20 interface, balances, allowances, mint and burn, and NFT metadata, with live Python models of each.
  5. 26 Smart Contract Security Pitfalls See how reentrancy, integer overflow, missing access control, front-running and oracle manipulation break contracts, with live Python models and real incidents.
  6. 27 dApps, Oracles and Wallet Integration How a decentralized app talks to a node over JSON-RPC, how wallets sign, why oracles are a trust problem, and how indexers and off-chain storage fit in.

Using Blockchains in Practice

  1. 28 Bitcoin in Practice Bitcoin's fixed supply and halving schedule, block size and weight, how Script locks coins, how fees work, and how to read a real block header in Python.
  2. 29 Ethereum in Practice How Ethereum works day to day: accounts and nonces, the EVM and gas metering, EIP-1559 fees, blocks and logs, and why rollups exist, with live Python models.
  3. 30 Scaling: Layer 2, Rollups and Sharding Why blockchains process few transactions per second, the scalability trilemma, and how payment channels, rollups, sidechains and sharding help, with live models.
  4. 31 Privacy and Zero-Knowledge Proofs Why public blockchains are pseudonymous, not anonymous: chain analysis, mixers, hash commitments and a toy zero-knowledge proof you can run in Python.
  5. 32 DeFi, DAOs and Governance Understand decentralized finance: lending with collateral, automated market makers and the constant-product formula, DAO voting and the risks, with runnable code.
  6. 33 Enterprise and Real-World Use Cases See where blockchains are used beyond crypto: supply chains, provenance, identity and CBDCs, and learn a checklist for deciding when you should not use one.

Projects

  1. 34 Project: A Complete Mini Blockchain Combine blocks, proof of work, signed transactions, balances and full-chain validation into one Python class, then prove it works with assert tests and tampering.
  2. 35 Project: A Wallet with Signed Transactions Build a wallet in Python on the secp256k1 curve: key generation, ECDSA signing, addresses, balance tracking and a ledger that rejects forged transactions.
  3. 36 Project: Simulating a Multi-Node Network Simulate a blockchain network in Python: several nodes mine and gossip blocks, forks appear from latency, the longest chain wins, and a report shows convergence.
  4. 37 Project: On-Chain Voting and a Token Build a governance token and snapshot-based voting with quorum on a toy blockchain in Python, then prove with tamper checks that edited history is caught.
  5. 38 Project: Supply Chain Provenance Tracker Build a supply chain provenance tracker in Python: record product events on a hash-linked chain, prove one shipment with a Merkle proof and run audit queries.

Practice and Review

  1. 39 Practice Exercises with Solutions Ten graded blockchain exercises in Python on hashing, Merkle roots and proofs, mining, chain validation, UTXO checks, AMM math and supply: with runnable solutions.
  2. 40 Blockchain Interview Questions Forty blockchain interview questions with short answers: core concepts, cryptography, consensus, smart contract security and system design, with links to lessons.
  3. 41 Blockchain Cheat Sheet A one-page blockchain cheat sheet: glossary, formulas for mining, quorum, halving and constant-product swaps, Python hashing patterns and a when-to-use checklist.