blockchaindev
☰ Lessons

Learning track

Build a blockchain in Rust

Primitives, hashing and Merkle trees, blocks, a mempool, proof of stake, P2P gossip, and a minimal VM — built from scratch.

  1. 01 Core primitive types for a blockchain in Rust Build the foundational types of a blockchain in Rust: newtype-wrapped Hash, Address, and Amount with fixed-size arrays, derives, and serialization.
  2. 02 Hashing and Merkle trees in Rust Compute cryptographic hashes with sha2 and blake3, then build a Merkle tree in Rust with inclusion proofs you can verify in O(log n).
  3. 03 Building the block and chain structures Define a BlockHeader and Block, hash a block deterministically, and build a Blockchain that validates and appends linked blocks from genesis.
  4. 04 Implementing a mempool Build a transaction pool in Rust: validated inserts, dedup by hash and nonce, fee-ordered selection with a BinaryHeap, eviction, and a note on shared access.
  5. 05 Proof of stake from scratch in Rust Build a stake-weighted PoS core in Rust: deterministic proposer selection, 2/3 finality voting, and the slashing intuition — with compiling, tested code.
  6. 06 P2P networking and gossip Build a minimal async TCP gossip node in Rust with tokio — peer connections, message broadcast, and hash-based dedup to stop loops.
  7. 07 A minimal VM and intent-based execution Build a complete stack-based VM in Rust with gas metering, then contrast imperative bytecode execution with the declarative intent model.