Skip to main content
This guide gets you to a working Stoffel project. You will create the default Rust-backed project, check the StoffelLang source, build bytecode, run local MPC, and run the generated Rust wrapper.

Copy-paste path

Use this when you want the fastest default project check:
Success means the CLI creates the project, stoffel check validates src/main.stfl, stoffel build writes .stflb bytecode under target/, the local MPC run completes, and the Rust wrapper builds and runs.

Create a project

After installing the stoffel CLI, create and enter a new project:
The default template creates:
Start with these files:
  • src/main.stfl: the StoffelLang program.
  • Stoffel.toml: package, build, and local MPC settings.
  • src/main.rs: a Rust wrapper that calls the same Stoffel program.
  • src/stoffel_bindings.rs: generated program metadata used by the Rust wrapper.

Check and build

Validate the Stoffel source and project configuration:
Expected output includes the checked source path and discovered functions:
Build bytecode under target/:
Expected output includes the generated .stflb file:

Run local MPC

Run the generated program through local MPC:
Local MPC testing runs the compiled program by spawning several MPC nodes/processes locally on your machine. The default project uses five parties with threshold one unless you override those settings in Stoffel.toml or with command-line flags. For one-shot development runs, use:
stoffel dev checks the project, builds it, runs local MPC, and can watch the project when you omit --once.

Run from Rust

The generated src/main.rs calls the same src/main.stfl program from Rust application code. Build and run the wrapper:
Use the Rust wrapper when you are ready to call Stoffel from an application rather than only from the CLI.

Make one change

Open src/main.stfl, make a small change, then rerun the fast loop:
If the generated program asks for inputs, check the generated README.md and src/main.stfl:
  • use --input NAME=VALUE for ordinary named function inputs;
  • use --client-input SLOT=VALUE for programs that call ClientStore.take_share.

You now have

  • a Stoffel project created with stoffel init;
  • checked StoffelLang source;
  • compiled .stflb bytecode under target/;
  • a local MPC development run;
  • a Rust wrapper that calls the same program.

Use with AI coding agents

Delegating this quickstart to an AI coding agent? Complete the agent setup in Installation first so the agent has Stoffel skills and live docs access before it edits code. Require the agent to return real command output from:
  • stoffel --version
  • stoffel check
  • stoffel build
  • stoffel run or stoffel dev --once
  • cargo build or cargo run
Do not accept a code-only summary for a runnable app task. If a command fails, the agent should report the exact error and fix the root cause instead of inventing expected output.

Next steps

Choose the next step based on what you want to do: