colibri-stateless
Rust bindings for Colibri Stateless -- an ultra-light prover / verifier for Ethereum and OP-Stack chains.
- Cryptographically verifies every RPC response against Merkle / SSZ proofs -- no reliance on centralised RPC providers.
async/awaitAPI ontokio, usingreqwest(rustls) internally.- Same C core, same test fixtures as the Python / Dart / Kotlin / Swift bindings; nothing chain-specific lives in the Rust layer.
- Ships without vendored C sources on crates.io;
build.rsdownloads a matching prebuilt archive from the corresponding GitHub Release, or builds from source inside the monorepo.
Quick start
[]
= "0.1"
= { = "1", = ["rt-multi-thread", "macros"] }
use Colibri;
async
Local proof generation (no remote prover)
use Colibri;
use json;
let client = builder
.provers
.eth_rpcs
.beacon_apis
.build;
let balance = client
.rpc
.await?;
Features
| Verified RPC | eth_call, eth_getBalance, eth_getLogs, eth_getProof, eth_getTransactionReceipt, etc. |
| Multiple modes | Local, Remote, Hybrid, Proxy proof strategies |
| Pluggable storage | In-memory, file-system, or a custom Storage impl |
| Pluggable transport | Default reqwest handler, or your own RequestHandler |
| PAP privacy | Optional Pragmatic Adaptive Privacy mode (experimental) |
| Shared fixtures | Replays the monorepo test/data/* corpus via colibri_stateless::testing |
See the full API tour in the crate-level docs on docs.rs or the developer guide on GitBook.
Native library distribution
The Rust crate is a thin unsafe shim on top of the libc4.a C
static archive. Where that archive comes from depends on your build:
crates.ioinstall --build.rsdownloadscolibri-native-<target>.tar.gzfrom the GitHub Release matching the crate version. Supported targets:x86_64-unknown-linux-gnu,aarch64-apple-darwin,x86_64-apple-darwin,x86_64-pc-windows-msvc.- Monorepo checkout --
build.rsshells out to CMake and links the just-built archives. Requires CMake ≥ 3.20 and a C compiler. The CMake tree is placed inbuild-rust/<target>/at the repository root rather than undertarget/, because the vendored dependencies create paths that exceed Windows' 260-characterMAX_PATHlimit. Override the location withCOLIBRI_CMAKE_BUILD_DIRif even that is too long for your checkout. - BYO archives -- set
COLIBRI_LIB_DIR=/path/to/dir/with/archives; every static archive in that directory is linked. Handy for embedded or cross-compilation targets not covered by the Release matrix. - docs.rs -- the native build is skipped (
DOCS_RSenv var); only the API docs are produced.
Testing against shared fixtures
The same fixtures in test/data/* used by the C / Python / Dart /
Swift test suites are exposed as colibri_stateless::testing:
use Arc;
use ;
use ;
let root = find_test_data_root.expect;
let cases = discover_tests;
for tc in cases
Documentation
- Crate docs -- docs.rs/colibri-stateless
- User guide -- GitBook -- Rust bindings
- Core repository -- github.com/corpus-core/colibri-stateless
Feedback
Bug reports and feature ideas go into the
shared issue tracker.
Please label Rust-specific issues with bindings:rust.
License
Licensed under the MIT License (see LICENSE). Some
third-party libraries bundled with the C core carry their own
licenses -- see libs/*/LICENSE for details.