Project Overview
Project Overview
Section titled “Project Overview”Minichain is a single-node, account-based blockchain with a register-based virtual machine, Proof of Authority consensus, and persistent storage.
Design Philosophy
Section titled “Design Philosophy”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
Architecture
Section titled “Architecture”┌─────────────┐│ CLI │ ← User interface└──────┬──────┘ │┌──────┴──────┐│ Chain │ ← Orchestration└──────┬──────┘ │┌──────┴──────┬───────────┬───────────┐│ VM │ Consensus │ Storage │└──────┬──────┴─────┬─────┴─────┬─────┘ │ │ │ └────────────┴───────────┘ │ ┌─────┴─────┐ │ Core │ ← Primitives └───────────┘Crate Dependencies
Section titled “Crate Dependencies”| Crate | Depends On | Purpose |
|---|---|---|
core | — | Primitives: hashing, crypto, blocks, transactions |
vm | core | Virtual machine execution |
storage | core | Persistent state with sled |
consensus | core | PoA validation |
chain | core, vm, storage, consensus | Blockchain logic |
assembler | core | Assembly → bytecode |
cli | all | User interface |
Key Technologies
Section titled “Key Technologies”| Component | Technology | Why |
|---|---|---|
| Hashing | Blake3 | Fast, secure, modern (blake3 crate) |
| Signing | Ed25519 | Fast, compact signatures (ed25519-dalek crate, comparison) |
| Storage | sled | Embedded, transactional |
| Serialization | bincode | Compact binary format |
| CLI | clap | Rust standard for CLIs |
Featured Smart Contract
Section titled “Featured Smart Contract”The project includes a complete English Auction smart contract walkthrough, including storage layout, dispatch flow, CLI usage, and integration tests.
Account Model
Section titled “Account Model”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
Native Token: Mini Coin (MIC)
Section titled “Native Token: Mini Coin (MIC)”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
Token Details
Section titled “Token Details”| Property | Value |
|---|---|
| Name | Mini Coin |
| Symbol | MIC |
| Decimals | 0 (whole units only) |
| Initial Supply | 0 (minted by authorities) |
Getting MIC
Section titled “Getting MIC”For testing, authorities can mint MIC using the CLI:
minichain account mint --from authority_0 --to <ADDRESS> --amount 1000MIC can also be received through transactions from other accounts.
Consensus: Proof of Authority
Section titled “Consensus: Proof of Authority”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
What’s Next?
Section titled “What’s Next?”Let’s start building! Head to Chapter 1: Core Primitives to implement the foundation.