Skip to main content
Import the SDK through the stoffel crate name:
The Cargo package is stoffel-rust-sdk, but the library crate is stoffel.

Program entry points

For app integrations, prefer stoffel build followed by Stoffel::load_file(...) so Rust code executes the same .stflb artifact that the CLI checked and built.

Builder configuration

Common settings: Supported AVSS curves include Curve::Bls12_381, Curve::Bn254, Curve::Curve25519, Curve::Ed25519, Curve::Secp256k1, and Curve::Secp256r1. See MPC Protocols for backend selection guidance.

Inputs

Named function inputs:
ClientStore inputs:
with_client_input(0, &[42_i64]) supplies values read by StoffelLang calls such as ClientStore.take_share(0, 0).

Execution

Clear execution is synchronous and skips MPC. Use it for fast logic checks:
Local MPC execution is async and runs a local MPC test network on your machine:
Named-function local MPC execution:

Runtime and bytecode helpers

Program metadata

A loaded runtime exposes program metadata used by generated bindings and debugging tools:

Network configuration

The SDK can generate network configuration files for deployments where MPC nodes run separately from input/output clients:
For most application developers, start with CLI builds and .execute_local().await? before using network configuration directly. Use MpcBackend::Avss { curve: Curve::Bls12_381 } for AVSS network/client experiments that use the current SDK off-chain client I/O path. Other AVSS curves are selectable for bytecode/runtime paths and curve-aware StoffelLang examples; validate the client/network path before relying on a specific curve.

Errors and observability

See also