16 Crates · 321 Tests · Pure Rust

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.

terminal
$ 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-types

Amount(i128), Asset, IDs, errors

Core Banking

openibank-ledger

Double-entry journal, holds, idempotency

openibank-wallet

4-compartment wallets, Ed25519 keys

openibank-permits

SpendPermit authorization, budget tracking

openibank-commitment

CommitmentGate state machine

openibank-worldline

SHA-256 hash-chain event log

openibank-receipts

Ed25519 signed receipts, canonical JSON

Trading

openibank-matching

BTreeMap orderbook, maker/taker fees

openibank-clearing

Multilateral netting, clearing cycles

Chain

openibank-chain

Private chain node, genesis, tokens

Integration

openibank-core

BankingEngine composing all subsystems

openibank-api

Axum REST server with 9 endpoints

Bot Framework

bot-core

Agent identity, lifecycle, fleet management

bot-brain

Brain trait: Rule / ML / LLM / Hybrid

bot-strategies

DCA, Grid, Market Maker, Arbitrage, Portfolio

bot-safety

Budget, rate limit, anomaly, kill switch

REST API

Axum 0.7 server exposing the full BankingEngine over HTTP. JSON request/response with proper error codes.

MethodEndpoint
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.

main.rs
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.