Skip to main content
These examples match the Stoffel 0.1.0 SDK in the stoffel repository. Run examples from the repository root:

Clear local execution

Use clear execution for fast logic checks before moving to local MPC runs.
Expected output:
Repository file: crates/stoffel-rust-sdk/examples/quickstart.rs.

Direct secret int64 arguments

The repository includes crates/stoffel-rust-sdk/examples/quickstart_mpc.rs, which demonstrates direct secret int64 function arguments:
Use the Share and ClientStore examples below as local MPC smoke tests. They exercise explicit private inputs and deliberate reveal points.

Named Share inputs

Use this when the source function accepts share values directly and opens only the intended output.
Repository file: crates/stoffel-rust-sdk/examples/local_mpc_named_inputs.rs.

ClientStore local inputs

Use ClientStore.take_share when modeling local client slots.
Repository file: crates/stoffel-rust-sdk/examples/local_mpc_client_input.rs.

Bytecode round trip

Compile source, save bytecode, load it back, and execute with inputs.
Repository file: crates/stoffel-rust-sdk/examples/bytecode_roundtrip.rs.

Network configuration

Generate TOML configs for a local network deployment and build server/client handles from those configs.
Repository file: crates/stoffel-rust-sdk/examples/network_config.rs.

Observability and health

Repository file: crates/stoffel-rust-sdk/examples/observability.rs.

Choosing an input style

Program shapeSDK input APICLI equivalent
def main(a: int64, b: int64).with_inputs(&[("a", 1_i64), ("b", 2_i64)])--input a=1 --input b=2
def main(a: secret int64, b: secret int64).with_inputs(&[("a", 1_i64), ("b", 2_i64)]) plus .execute_local().await--input a=1 --input b=2 with local execution
ClientStore.take_share(0, 0).with_client_input(0, &[1_i64])--client-input 0=1

Next steps