Capstone: Bitcoin-Lite Node

Lesson, slides, and applied problem sets.

View Slides

Lesson

2 min read

Capstone: Bitcoin-Lite Node

Why this module exists

The real difficulty of blockchain engineering is integration. The capstone requires you to stitch together:

  • Serialization and hashing
  • UTXO validation
  • Script execution
  • Mempool selection
  • Mining and PoW checks
  • Chain selection and reorgs

1) Validation pipeline

A node must reject invalid data early:

  1. Header sanity + PoW
  2. Merkle root check
  3. Transaction validation (UTXO + scripts)
  4. State update

2) Mining pipeline

  1. Select transactions (fee rate + availability)
  2. Create coinbase
  3. Compute merkle root
  4. Search nonce
  5. Broadcast block

3) Reorg safety

Longer chains can arrive after you mine. Your node must rollback and re-apply state deterministically.


4) Design constraints

We use toy choices to keep code manageable:

  • Fixed difficulty
  • Simplified sighash
  • P-256 instead of secp256k1

These keep the system learnable while retaining the shape of Bitcoin.


What you will build

A full node + miner that accepts transactions, mines blocks, and maintains a consistent UTXO set across forks.


Key takeaways

  • A blockchain is an execution engine with strict determinism.
  • Robustness is about invariants, not just features.
  • The capstone is where correctness matters most.

Module Items

Join Discord