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
Feature | Mainsail | Geth / Ethereum Clients |
---|---|---|
Chain Type | Custom Layer 1 blockchain | Ethereum mainnet or testnet client |
Consensus | BFT-inspired (Tendermint-like) with 53 validators and BLS signature aggregation; instant finality | Ethereum PoS (via Beacon Chain) |
EVM Engine | REVM (Rust) | Go-EVM (Geth), Erigon (C++), Nethermind (C#), etc. |
Storage Engine | Heed (ACID key-value store) | LevelDB, RocksDB, or custom |
Runtime | Rust (EVM execution & storage) + Node.js (consensus, P2P, RPC, APIs) | Native (Go, C++, Rust depending on client) |
RPC API | Ethereum-compatible (JSON-RPC subset) | Full Ethereum RPC spec |
Tooling Support | Compatible with MetaMask, Rabby, Ledger, Hardhat, Foundry, Remix, web3.js, etc. | Same |
Execution Focus | Fast, modular EVM execution for custom chains and smart contract platforms | Full Ethereum state machine + consensus + P2P |
Sync / Networking | Custom Mainsail protocol stack | Ethereum P2P (devp2p, gossipSub, etc.) |