Built for
Developers
Composable Rust crates with type safety, zero unsafe code, and comprehensive test coverage. From first clone to running API in under 2 minutes.
Quick Start
Clone, build, and run — everything works offline after initial setup.
$ git clone https://github.com/openibank/openibank$ cd openibank# Run all 321 tests$ cargo test --workspace# Run the banking demo$ cargo run --example banking_demo# Start the REST API server$ cargo run -p openibank-api -- --port 3000
Crate Architecture
16 crates organized in dependency layers. Each crate is independently testable and publishable.
Foundation
openibank-typesAmount(i128), Asset, IDs, errors
Core Banking
openibank-ledgerDouble-entry journal, holds, idempotency
openibank-wallet4-compartment wallets, Ed25519 keys
openibank-permitsSpendPermit authorization, budget tracking
openibank-commitmentCommitmentGate state machine
openibank-worldlineSHA-256 hash-chain event log
openibank-receiptsEd25519 signed receipts, canonical JSON
Trading
openibank-matchingBTreeMap orderbook, maker/taker fees
openibank-clearingMultilateral netting, clearing cycles
Chain
openibank-chainPrivate chain node, genesis, tokens
Integration
openibank-coreBankingEngine composing all subsystems
openibank-apiAxum REST server with 9 endpoints
Bot Framework
bot-coreAgent identity, lifecycle, fleet management
bot-brainBrain trait: Rule / ML / LLM / Hybrid
bot-strategiesDCA, Grid, Market Maker, Arbitrage, Portfolio
bot-safetyBudget, rate limit, anomaly, kill switch
REST API
Axum 0.7 server exposing the full BankingEngine over HTTP. JSON request/response with proper error codes.
| Method | Endpoint |
|---|---|
| GET | /health |
| POST | /api/v1/wallets |
| GET | /api/v1/wallets/{id}/balance/{asset} |
| POST | /api/v1/deposits |
| POST | /api/v1/transfers |
| GET | /api/v1/receipts/{id} |
| POST | /api/v1/orders |
| POST | /api/v1/clearing/obligations |
| POST | /api/v1/clearing/settle |
Code Example
Complete transfer pipeline in under 30 lines of Rust.
use openibank_core::*;
use openibank_types::*;
let mut engine = BankingEngine::new(EngineConfig::default());
// Create wallets
let alice = engine.create_wallet("alice")?;
let bob = engine.create_wallet("bob")?;
// Deposit funds
engine.deposit(&alice, Asset::iusd(), Amount::new(1000, 0))?;
// Transfer through CommitmentGate pipeline
let result = engine.transfer(TransferRequest {
from: alice.clone(),
to: bob.clone(),
asset: Asset::iusd(),
amount: Amount::new(250, 0),
memo: Some("payment".into()),
permit_id: None,
idempotency_key: Some("inv-001".into()),
})?;
// Verify receipt
let receipt = engine.get_receipt(&result.receipt_id)?;
assert!(engine.verify_receipt(receipt)?);
// WorldLine integrity check
assert!(engine.verify_worldline());Start Building
Apache 2.0 licensed. Fork, extend, and deploy your own financial infrastructure.