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 portable public dependencies by default. A local checkout is a separate, nonportable framework-development workflow and is allowed only when explicitly requested.
Use when
Use this playbook when a developer or coding agent needs the shortest path from an empty directory to a working Stoffel app.Current source of truth
Use the public docs when available, then verify against the current 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
Mandatory portability contract
Apply these rules before installing dependencies or creating files:- Discover and confirm the project root from the current working directory and repository markers such as
Stoffel.toml,Cargo.toml, or.git. Do not invent or require a machine-specific path such as/workspace/.... - Resolve Stoffel and related project dependencies from public, reproducible sources in this order: the current crates.io release, then the official GitHub repository pinned to a full immutable commit SHA when the needed change is not published.
- Never use a floating branch or require a local path, sibling checkout, or other external filesystem checkout for the default app path.
- Use a local Stoffel checkout only when the user explicitly requests framework development. Label that workflow nonportable and keep it separate from the default instructions below.
- If no suitable public dependency is available, stop and report the missing dependency and attempted public sources. Do not silently replace it with a local path.
Prerequisites
- Rust stable and Cargo.
- The
stoffelCLI from the documented installation path. - Crates.io dependencies for Rust SDK work.
Install
Install the CLI:Create the first app
.stfl source. Run the wrapper too:
Know the app shape
A new app normally includes: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
For client-owned private input in a multi-user or networked application, first complete the trust architecture in Stoffel Full App Golden Path. Each participant-owned client should submit directly to the separately deployed MPC service; the application control plane must not receive or persist plaintext. Then use Stoffel App Network and Off-Chain Integration for the direct client path and runtime capability gate.- CLI-only path: mostly
.stflsource and trusted 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 workflows that need real local party execution before network/off-chain work; local fixture injection is not production private-data-plane evidence.
- Network/off-chain path: advanced client/server/coordinator integration after the local smoke passes.
Fast examples to inspect
- At the full immutable official GitHub commit selected by the portability contract, inspect clear language basics under
crates/stoffel-lang/examples/local_control_flow,local_collections, andlocal_text_processing. - Inspect the first private input flow at
crates/stoffel-lang/examples/mpc_client_private_scorein that same official source revision. - Inspect the ClientStore gallery under
crates/stoffel-lang/examples/bits/secret/*,matrix/secret/*,polynomials/secret/*,number_theory/secret/*, and the app-levelmpc_*algorithm examples in that revision.
# 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 app development, use the public dependency precedence in the portability contract; do not recommend a local path dependency.
- Do not confuse browsing examples in an official source revision with requiring that repository as a sibling checkout.
- 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.