Stoffel Local MPC Dev Loop
Scope: AI-agent-agnostic playbook for building applications with the Stoffel framework. This is not a maintainer guide for compiler, VM, protocol, or release engineering work. Dependency assumption: use the public 0.1.0 install snippets from these docs. When developing against a local checkout, make that source-based workflow explicit.
Use when
Use this playbook when an app needs local MPC smoke testing, ClientStore input runs, hot reload, or SDK local coordinator-backed execution.Goal
Give developers a repeatable local loop for testing private/MPC apps before any real network deployment.Current source of truth
crates/stoffel-cli/src/main.rscrates/stoffel-rust-sdk/README.mdcrates/stoffel-rust-sdk/src/runtime.rscrates/stoffel-lang/examples/README.mdcrates/stoffel-lang/examples/**/*.stfl
Runner setup
For source-based local development, build the runner from a local checkout:stoffel run --runner /path/to/stoffel-runstoffel dev --runner /path/to/stoffel-runSTOFFEL_RUN_BIN=/path/to/stoffel-run- SDK
.local_runner_path("/path/to/stoffel-run") - SDK
runtime.local_network().runner_path("/path/to/stoffel-run")
CLI local run
--network or --config is set.
Hot reload
--once for CI/smoke checks and default watch mode during interactive development.
Input paths
Named function args:--input-file and --client-input-file for .json, .csv, and .txt inputs. See Stoffel CLI App Workflow.
Use example run-args headers
Many secret examples include the exact local flags in the first source line:
--client-input 0=50 --client-input 0=20 maps to ClientStore.take_share(0, 0) then ClientStore.take_share(0, 1).
SDK local run
Recommended local loop
- Run
stoffel status --verbosefrom the app root. - Run
stoffel checkto catch syntax/config/type errors. - Run
stoffel build --program-infoto inspect bytecode and client IO metadata. - Run
stoffel run --timeout-secs 180with named inputs or documented# run-args:flags. - If using Rust, run
cargo checkandcargo runagainst the same bytecode/source. - Only then move to network/off-chain config.
Validation / done criteria
For app local-MPC work:Common pitfalls
- Compile-only success is not a local MPC smoke test.
- Increase
--timeout-secsbefore assuming protocol failure. - Avoid port/process collisions by serializing tests that spawn local party meshes.
- Keep
ClientStoreinputs separate from named function inputs. - Do not omit
--expected-output-clientsfor examples/programs that send client outputs. - AVSS support is backend/curve/input dependent; verify the current SDK boundary.