Architecture

Mainsail’s architecture is designed for modularity, fast finality, and high developer accessibility. It is composed of a hybrid runtime that splits responsibility between Rust (low-level execution and storage) and Node.js (coordination, APIs, and extensibility).

Consensus Layer

  • Protocol: BFT-inspired consensus, inspired by Tendermint
  • Validators: 53
  • Block Time: 8 seconds
  • Finality: Instant finality on commit (no reorgs)
  • Signature Aggregation: Uses BLS cryptographic signatures for validator consensus

Execution Layer (Rust)

  • Engine: REVM — a fast, modular EVM implementation written in Rust
  • Features: Executes all smart contracts and transaction logic
  • Compatibility: Fully EVM-compatible (Solidity, Vyper, and all Ethereum tooling)

Storage Layer (Rust)

  • Database: Heed — embedded, ACID-compliant key-value store
  • Purpose: Persists EVM state, ledger data, and contract storage
  • Design: Optimized for low-latency lookups and efficient state pruning

Node Runtime (Node.js)

  • Language: Node.js (TypeScript)
  • Responsibilities:
    • Manages block production and validator coordination
    • Handles peer-to-peer messaging and network propagation
    • Interfaces with the Rust-based execution/storage layers
    • Provides modular hooks for plugins and extensions
    • Implements various APIs to read & write blockchain data

RPC Layer

  • Protocol: Ethereum JSON-RPC (v2)
  • Purpose: Enables interaction with Mainsail through familiar Ethereum developer tools
  • Wallet Support: Works natively with MetaMask, Rabby, and Ledger
  • Key Endpoints: eth_call, eth_sendRawTransaction, eth_getBlockByNumber, etc.

Optional REST API Layer

  • Backend: PostgreSQL
  • Purpose: Indexes and exposes chain data (blocks, accounts, contracts, transactions)
  • Usage: Ideal for explorers, analytics, and high-level developer queries

Inter-Layer Communication

  • Rust handles deterministic execution and persistence
  • Node.js coordinates and routes state and network events
  • The two runtimes communicate via native bindings (napi-rs)

How Mainsail Differs from Geth and other Ethereum Clients

FeatureMainsailGeth / Ethereum Clients
Chain TypeCustom Layer 1 blockchainEthereum mainnet or testnet client
ConsensusBFT-inspired (Tendermint-like) with 53 validators and BLS signature aggregation; instant finalityEthereum PoS (via Beacon Chain)
EVM EngineREVM (Rust)Go-EVM (Geth), Erigon (C++), Nethermind (C#), etc.
Storage EngineHeed (ACID key-value store)LevelDB, RocksDB, or custom
RuntimeRust (EVM execution & storage) + Node.js (consensus, P2P, RPC, APIs)Native (Go, C++, Rust depending on client)
RPC APIEthereum-compatible (JSON-RPC subset)Full Ethereum RPC spec
Tooling SupportCompatible with MetaMask, Rabby, Ledger, Hardhat, Foundry, Remix, web3.js, etc.Same
Execution FocusFast, modular EVM execution for custom chains and smart contract platformsFull Ethereum state machine + consensus + P2P
Sync / NetworkingCustom Mainsail protocol stackEthereum P2P (devp2p, gossipSub, etc.)