Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Architecture – Makechain
Skip to content

Architecture

Makechain uses a layered architecture with single-chain Simplex BFT consensus, parallel per-project execution, and a separate data availability layer.

System Overview

┌─────────────────────────┐
│  Clients                │  grpc-web / gRPC
│  (Browser, CLI, SDK)    │
└───────────┬─────────────┘

┌───────────▼──────────────────────────────────────┐
│  Validator Node                                   │
│                                                   │
│  ┌──────────┐  ┌──────────────┐  ┌────────────┐  │
│  │ gRPC API │→ │ Mempool      │→ │ Execution  │  │
│  │ (tonic)  │  │              │  │ Engine     │  │
│  └──────────┘  └──────┬───────┘  └─────┬──────┘  │
│                       │                │          │
│               ┌───────▼────────────────▼───────┐  │
│               │ Simplex BFT (single chain)     │  │
│               │ ~200ms blocks, ~300ms finality  │  │
│               └───────────────┬────────────────┘  │
│                               │                   │
│               ┌───────────────▼────────────────┐  │
│               │ State Engine (MemoryStore)      │  │
│               │ Prefix-namespaced key-value     │  │
│               └────────────────────────────────┘  │
└───────────────────────────────────────────────────┘

Layers

Message Layer

Every message is a self-authenticating envelope containing a BLAKE3 hash, Ed25519 signature, and the signer's public key. Messages are structurally validated before entering the mempool.

Consensus Layer

A single Simplex BFT consensus chain orders all messages. The leader proposes blocks by draining the mempool, and the execution engine processes them in two phases:

  1. Account pre-pass — KEY_ADD, KEY_REMOVE, ACCOUNT_DATA, VERIFICATION_ADD/REMOVE, PROJECT_CREATE, PROJECT_REMOVE, and FORK are applied serially (they modify shared account state like project count)
  2. Parallel project execution — Remaining project-scoped messages are grouped by project_id and executed in parallel via rayon, each with its own copy-on-write overlay store

This single-chain model with parallel execution achieves high throughput without the complexity of cross-shard coordination.

State Layer

State is stored in a prefix-namespaced key-value store with lexicographic ordering for range scans:

PrefixNamespace
0x01Project state
0x02Project metadata
0x03Refs
0x04Commits
0x05Collaborators
0x06Account state
0x07Account metadata
0x08Key entries
0x09Verifications
0x0AProject name index
0x0BKey reverse index (pubkey → mid)

Currently backed by an in-memory BTreeMap (MemoryStore). The StateStore trait is designed for future migration to QMDB (Queryable Merkle Database) for persistence and merkle proofs.

Data Availability Layer

The consensus layer stores only message metadata (~100-500 bytes). File content (blobs, trees) lives in a separate DA layer, referenced by da_reference in commit bundles.

Commonware Primitives

Makechain builds on the Commonware Library:

PrimitiveUsage
commonware-consensusSimplex BFT consensus engine
commonware-p2pAuthenticated peer connections
commonware-parallelExecution strategies (Sequential, Rayon)
commonware-runtimeAsync task execution (tokio backend)
commonware-cryptographyEd25519 signing, BLAKE3 digests
commonware-codecBinary serialization

gRPC API

The node exposes a gRPC service on port 50051 (configurable) with:

  • grpc-web support — browser clients via HTTP/1.1 (tonic-web)
  • CORS — configured for cross-origin grpc-web requests
  • Server reflection — runtime service discovery (grpc reflection v1)
  • Message streamingSubscribeMessages with type and project_id filters