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:| Example | What it shows |
|---|---|
quickstart.rs | Clear local execution with named inputs. |
local_mpc_named_inputs.rs | Recommended local MPC smoke test using Share values with named inputs. |
local_mpc_client_input.rs | Recommended ClientStore smoke test using local client slots. |
quickstart_mpc.rs | Direct secret int64 argument example; useful for reading, but the Share and ClientStore examples are the more reliable current smoke tests. |
bytecode_roundtrip.rs | Save bytecode, load it back, and execute. |
network_config.rs | Generate and parse network deployment TOML. |
observability.rs | Tracing, metrics, server health, and error categories. |
onchain.rs | On-chain coordinator handle setup. |