Skip to content

Project Overview

Minichain is a single-node, account-based blockchain with a register-based virtual machine, Proof of Authority consensus, and persistent storage.

We prioritize learning over production-readiness. Every component is designed to be:

  • Understandable — Clear, well-documented code
  • Minimal — No unnecessary features
  • Complete — A working end-to-end system
┌─────────────┐
│ CLI │ ← User interface
└──────┬──────┘
┌──────┴──────┐
│ Chain │ ← Orchestration
└──────┬──────┘
┌──────┴──────┬───────────┬───────────┐
│ VM │ Consensus │ Storage │
└──────┬──────┴─────┬─────┴─────┬─────┘
│ │ │
└────────────┴───────────┘
┌─────┴─────┐
│ Core │ ← Primitives
└───────────┘
CrateDepends OnPurpose
corePrimitives: hashing, crypto, blocks, transactions
vmcoreVirtual machine execution
storagecorePersistent state with sled
consensuscorePoA validation
chaincore, vm, storage, consensusBlockchain logic
assemblercoreAssembly → bytecode
cliallUser interface
ComponentTechnologyWhy
HashingBlake3Fast, secure, modern (blake3 crate)
SigningEd25519Fast, compact signatures (ed25519-dalek crate, comparison)
StoragesledEmbedded, transactional
SerializationbincodeCompact binary format
CLIclapRust standard for CLIs

The project includes a complete English Auction smart contract walkthrough, including storage layout, dispatch flow, CLI usage, and integration tests.

We use an account-based model (like Ethereum) rather than UTXO (like Bitcoin):

pub struct Account {
pub nonce: u64, // Transaction count
pub balance: u64, // Balance in MIC (Mini Coin)
pub code_hash: Option<Hash>, // Contract bytecode hash
pub storage_root: Hash, // Storage trie root
}

Why account-based?

  • Simpler mental model
  • Easier smart contract state
  • Natural fit for our VM

Minichain has a native cryptocurrency called Mini Coin with the symbol MIC. It serves multiple purposes:

  • Transaction fees — MIC is used to pay for gas when executing transactions and deploying/calling contracts
  • Account funding — Initial MIC is minted by authorities for testing purposes
  • Value transfer — MIC can be sent between accounts as a native value
PropertyValue
NameMini Coin
SymbolMIC
Decimals0 (whole units only)
Initial Supply0 (minted by authorities)

For testing, authorities can mint MIC using the CLI:

Terminal window
minichain account mint --from authority_0 --to <ADDRESS> --amount 1000

MIC can also be received through transactions from other accounts.

For simplicity, we use Proof of Authority (PoA):

  • Single trusted authority signs blocks
  • No mining or staking complexity
  • Instant finality
  • Perfect for learning and private chains

Let’s start building! Head to Chapter 1: Core Primitives to implement the foundation.