stoffel-rust-sdk; the Rust crate you import is stoffel.
Stoffel 0.1.0 Rust SDKInstall the CLI for project commands. Add the Rust SDK when your app needs to compile, load, or run Stoffel programs directly.
Prerequisites
- Rust and Cargo, latest stable recommended
- The
stoffelCLI stoffel-rust-sdkfrom crates.io- A local checkout of
Stoffel-Labs/stoffelonly when you need source examples or local crate changes
Add the SDK from crates.io
Optional: use a local checkout
Use a path dependency when your app needs local SDK source changes:Verify clear execution
Createsrc/main.rs:
Verify local MPC execution
For an app-shaped local MPC check, build your Stoffel project first and load the bytecode from Rust:.execute_local().await? runs local MPC testing by spawning several MPC nodes/processes on your machine.
Current SDK surface
The SDK currently includes:Stoffel::compile(source)andStoffel::compile_file(path)for source compilation.Stoffel::load(bytecode)andStoffel::load_file(path)for bytecode loading.with_inputs(&[(name, value)])for named function inputs.with_client_input(slot, &[values])for ClientStore-style local MPC programs.execute_clear()for fast local logic checks.execute_local().awaitandexecute_local_function(name).awaitfor local MPC execution.parties(n)andthreshold(t)MPC configuration.- bytecode save/load and summary helpers.
- network deployment/config builders for multi-node experiments.
- observability and error-category helpers.
- on-chain coordinator handles for integration experiments.
Examples in the repository
The SDK examples live at:
Run an example from the repository: