A high-performance, partially synchronous blockchain consensus engine built in Rust.
Ockham is a "from scratch" implementation of the Simplex Consensus protocol. It is designed to prioritize simplicity and latency, achieving optimal confirmation times without the complexity of traditional View Change protocols.
-
Optimal Optimistic Confirmation:
$3\delta$ (three network hops to finalize). -
Optimal Block Time:
$2\delta$ . - Simplex Liveness: Uses a unique "Dummy Block" mechanism.
-
BLS Signature Aggregation: Uses
blstfor efficient signature verification. - JSON-RPC API: Standard interface for external clients.
- Graceful Shutdown: Ensures data integrity upon termination.
The project is structured into modular components:
-
consensus: The core State Machine. Handles proposals, vote aggregation, and the$3\Delta$ timeout logic. -
types: Core data structures includingBlock,Vote, andQuorumCertificate(QC). -
crypto: BLS12-381 cryptography usingblst. Supports signature aggregation and VRFs. -
network:libp2pimplementation using Gossipsub/Noise. -
storage: Persistent storage usingRedb. -
rpc: JSON-RPC server implementation.
- Rust Toolchain (stable)
cargo build --releaseWe provide a script to spin up a local 4-node cluster for demonstration:
./scripts/test_cluster.shEach node exposes a JSON-RPC server.
- Node 0:
http://127.0.0.1:8545 - Node 1:
http://127.0.0.1:8546 - ...
Example Query:
curl -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "method":"get_status", "params":[], "id":1}' http://127.0.0.1:8545Run the simulation tests to verify the consensus logic:
cargo testThis project is being developed in 4 phases:
-
Phase 1: The Core Library
- Core data structures (
Block,Vote,QC). - Consensus State Machine (
SimplexState). - Simulation Tests.
- Core data structures (
-
Phase 2: The Networked Prototype
libp2pintegration.- Gossipsub configuration.
- Network-based consensus tests.
-
Phase 3: Cryptography and Storage
- Replace mock crypto with
blst(BLS12-381). -
Redbintegration for persistence. - Sync protocol.
- Replace mock crypto with
-
Phase 4: Optimization and Tooling
- Signature Aggregation.
- JSON-RPC API.
- Graceful Shutdown.
- Block Explorer (Moved to separate repo).
This project is licensed under the MIT License - see the LICENSE file for details.