Stoffel App Getting Started
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 a developer or coding agent needs the shortest path from an empty directory to a working Stoffel application.Current source of truth
Use the public docs when available, then verify against the 0.1.0 app-facing repo surfaces:README.mdcrates/stoffel-cli/src/main.rscrates/stoffel-cli/src/project.rscrates/stoffel-lang/examples/README.mdcrates/stoffel-rust-sdk/README.md
Prerequisites
- Rust stable and Cargo.
- The
stoffelCLI from the documented 0.1.0 installation path. - A local checkout of the
stoffelrepository for source-based 0.1.0 development. - For local MPC execution: a
stoffel-runhelper binary available throughPATH,--runner,STOFFEL_RUN_BIN, or the SDK builder.
Install
Preferred public flow after publication:Create the first app
.stfl source. For that wrapper, also run:
Know the app shape
A new app normally has:Stoffel.toml: app metadata, default source path, output target dir, and local MPC defaults.src/main.stfl: the Stoffel program.target/debug/*.stflb: compiled bytecode afterstoffel build.- Optional wrapper files (
Cargo.toml,src/main.rs,src/stoffel_bindings.rs) when using the default or Rust templates.
Stoffel.toml is a project/build config. It is not the network/off-chain client config passed to stoffel run --network --config.
Choose a development path
- CLI-only path: mostly
.stflsource and local smoke tests. - Rust SDK path: embedding compilation/execution, creating clients/servers, generating typed client IO bindings, or integrating with a Rust service.
- Local MPC path: private/secret programs that need real local party execution before network/off-chain work.
- Network/off-chain path: advanced client/server/coordinator integration after the local smoke passes.
Fast examples to inspect
- Clear language basics:
crates/stoffel-lang/examples/local_control_flow,local_collections,local_text_processing. - First private input flow:
crates/stoffel-lang/examples/mpc_client_private_score. - ClientStore gallery with run commands:
crates/stoffel-lang/examples/bits/secret/*,matrix/secret/*,polynomials/secret/*,number_theory/secret/*, and the app-levelmpc_*algorithm examples.
# run-args: header. Copy those flags when running the example locally.
Validation / done criteria
A first-app task is complete only when real output has been collected from:# run-args: flags and --expected-output-clients if present.
Common pitfalls
- For 0.1.0 development, prefer the documented source dependency or local path dependency.
- Do not describe
Stoffel VMinternals unless they explain public app behavior. - Do not claim local MPC works until a real run has completed.
- Do not treat
Stoffel.tomlas network/off-chain config. - Do not omit
--expected-output-clientswhen running examples that send outputs to clients.