io_oi is a next-generation decentralized consensus protocol designed for the IoT and high-frequency trading era. It combines the speed of zero-copy serialization with the security of WASM sandboxing and a unique L1/L2 tiered architecture.
- ⚡ Zero-Copy Core: Built on
rkyvfor near-instantaneous serialization and deserialization. - 🛡️ WASM Sandboxing: Arbitrators run in
wasmtimewith strict fuel limits and resource isolation. - 💾 DualCache-FF: A high-performance two-tier storage engine (RAM + Disk) with probabilistic pruning.
- 🔒 Hardened Security:
- Replay Protection: Sequence-based union validation.
- Double-Sign Prevention: Mandatory Write-Ahead Logging (WAL) with
fsync. - Malformed Packet Defense: Strict
rkyvvalidation on every network boundary.
- 🌐 Flexible Governance:
- Trust Modes: Full (Global Broadcast) or Localized (Gossip-based).
- Control Modes: Strict (Leader-managed) or Competitive (Decentralized Election).
io_oi reverses the traditional distributed database philosophy by placing the high-performance cache at the very top of the stack.
graph TD
User[User / AI App] -->|9ns Read / 113ns Write| A[DualCache-FF]
A -->|Write-Behind Channel| B[io_oi Consensus Layer]
B -->|iroh QUIC| C[P2P Network]
C --> D{Leader / Arbitrator}
D -->|WASM Signed| E[Signed Record]
E -->|Broadcast| F[Global State Sync]
F -->|Background Update| A
By placing DualCache-FF on top, applications experience near-native RAM latency. The heavy lifting of network consensus and WASM arbitration happens asynchronously in the background, making the system ideal for real-time AI training and edge computing.
core/: 核心協議庫。定義了基礎資料結構、DualCacheFF儲存引擎介面。node/: 節點伺服器。整合 Iroh P2P、RESP 閘道器與 WASM 執行環境。python-bindings/: servergo-ai 模組。提供 Python 使用者(AI 工程師)零拷貝存取DualCacheFF的能力,支援numpy矩陣。cli/: 命令列工具。負責創世管理、Peer 加入及自然語言指令。wasm/: 仲裁合約。定義 WIT 介面用於編寫自定義共識邏輯。
- Rust 2024 Edition
- Cargo
cargo build --releaseWe use a comprehensive test suite covering core consensus, security attacks, and chaos engineering.
cargo test -p io_oi_node --test protocol_testsTo monitor the consensus network in real-time, launch the Bun-based dashboard:
cd dashboard
bun devOpen http://localhost:3000 to access the Leader Control Panel.
We have implemented rigorous testing for:
- rkyv Validation: Preventing Segfaults from malicious payloads.
- WASM Resource Limits: Protecting against infinite loops and memory exhaustion.
- Double Sign Detection: Cryptographic proof of Leader misconduct.
- Replay Attack Prevention: Ensuring every vote is unique and fresh.