Core Primitives
Cryptographic hashing, digital signatures, addresses, transactions, and blocks
Welcome to Minichain — a hands-on guide to building a minimal but complete blockchain implementation in Rust.
By the end of this book, you’ll have built:
Core Primitives
Cryptographic hashing, digital signatures, addresses, transactions, and blocks
Storage Layer
Persistent storage for accounts, blocks, and contract state using sled
Virtual Machine
A register-based VM with 16 registers, gas metering, and execution tracing
Assembler
A custom assembly language that compiles to VM bytecode
Consensus
Proof of Authority (PoA) consensus for block validation
CLI
A complete command-line interface to interact with your blockchain
Building a blockchain from scratch teaches you:
This book assumes familiarity with:
minichain/├── crates/│ ├── core/ # Blockchain primitives│ ├── vm/ # Virtual machine│ ├── storage/ # Persistent state│ ├── consensus/ # PoA logic│ ├── chain/ # Blockchain orchestration│ ├── assembler/ # Assembly compiler│ └── cli/ # Command-line interface├── contracts/ # Example contracts└── tests/ # Integration testsReady to dive in? Start with the Project Overview to understand the architecture, then jump into Chapter 1: Core Primitives.
You can also explore the full contract example at English Auction Smart Contract.