stoffel repository at crates/stoffel-rust-sdk.
- Cargo package name:
stoffel-rust-sdk - Rust library crate name:
stoffel - Common import:
use stoffel::prelude::*;
Stoffel 0.1.0 Rust SDKThe Rust SDK is the primary application API for the 0.1.0 release. Validate security and deployment assumptions for your application before going live.
What the SDK does
The SDK gives Rust applications a single API for:- compiling Stoffel Lang source;
- loading compiled
.stflbbytecode; - running clear local checks;
- running local MPC testing;
- passing named function inputs;
- passing ClientStore-style local client inputs;
- saving, loading, and summarizing bytecode;
- generating network deployment configs;
- building server/client handles for networked experiments;
- collecting basic observability and error-category information.
Mental model

Stoffel::compile(...) when the Rust app owns source compilation. Use Stoffel::load(...) or Stoffel::load_file(...) when the app should load a .stflb artifact built by the CLI.
For app integrations, a common flow is to build bytecode with the CLI and load that artifact from Rust:
Clear local execution
Use clear execution to validate ordinary business logic quickly:Local MPC execution
Use local execution to test secret-value and MPC boundaries. The most reliable 0.1.0 smoke path usesShare inputs and opens only the intended output:
stoffel CLI workflows. It runs several MPC nodes/processes locally on the developer machine.
Core APIs
Compile and load
Inputs
Execution
MPC configuration
parties >= 4 * threshold + 1. The common developer default is five parties and threshold one.
Use MpcBackend::HoneyBadger when secret application values are field-compatible shares and the outside system consumes an opened result or client-output shares. Use MpcBackend::Avss { curve } when the output boundary needs public commitments, curve-encoded values, opened scalar responses, or signature-related artifacts. See MPC Backends for backend details.
Bytecode
Network and infrastructure surfaces
The SDK includes builders for network deployments and server/client handles. These APIs are useful for integration experiments and infrastructure planning:MpcBackend::Avss { curve: Curve::Bls12_381 } for AVSS network/client experiments supported by the current off-chain client I/O path. Use curve-specific AVSS examples when the external protocol fixes the curve or verifier-facing artifact.
Observability and errors
The SDK exposes tracing config, server metrics, health status, and error categories:Where to find examples
Examples are checked into the repository:quickstart.rslocal_mpc_named_inputs.rslocal_mpc_client_input.rsquickstart_mpc.rsfor the directsecret int64argument shapebytecode_roundtrip.rsnetwork_config.rsobservability.rs