Skip to main content
This page describes the stoffel CLI. The stoffel binary is a Cargo-like project tool for creating, checking, building, running, and iterating on Stoffel apps. It is the developer-facing entry point for local MPC workflows.

Core workflow

Use stoffel --help to see the installed command set. Current commands are:
  • init / new: create a project from a template.
  • check: validate source and MPC configuration without writing bytecode.
  • compile: compile a project, source directory, or .stfl file to .stflb bytecode, or disassemble existing bytecode.
  • build: build project bytecode under target/.
  • run: run a project, .stfl source file, or .stflb bytecode through local or network MPC execution.
  • dev: watch a project and rerun it on local MPC when files change.
  • test: run no-argument Stoffel test functions.
  • status / doctor: show project health and environment status.
  • clean: remove generated build artifacts.
  • update / upgrade: check or update the CLI and project dependency files.

Creating projects

--lib cannot be combined with --template. Use stoffel init --help for supported template names.

Project structure

The default template currently creates a Rust-backed Stoffel project:
Other templates place the Stoffel program under a nested stoffel/ directory and include the host-language scaffold for Python, Rust, Foundry, or Hardhat.

Stoffel.toml

Stoffel.toml is the project manifest. The CLI reads package, build, and MPC settings from this file. A minimal shape looks like:
Use command-line overrides while developing:
Do not pass project Stoffel.toml to stoffel run --config. --config is for an MPC network/off-chain client TOML file; pass the project path as the positional PATH instead.

Checking and compiling

Stoffel bytecode uses the .stflb extension. Optimization flags accepted by compile, build, and source-compiling run include:

Running programs

For programs that use ClientStore.take_share, provide client-provided private inputs by numeric slot:
Local MPC is the default unless --network or --config is set. A local run spawns several MPC nodes/processes on your machine using the configured parties and threshold.

Development watch mode

stoffel dev runs a project through local MPC, then watches Stoffel.toml and source files for changes:
For scripts and CI, run once and exit:
Tune watch latency with --poll-ms:

Testing

stoffel test runs no-argument test functions from a project or test file. By default it searches recursively under tests/.
Use local MPC execution for tests that need several local MPC nodes instead of the embedded no-network test runner:

Status, clean, and update

Debugging tips

  • Run stoffel check --print-ir before investigating runtime behavior.
  • Run stoffel run --program-info to inspect function and instruction metadata.
  • Use stoffel compile --disassemble <file.stflb> to inspect bytecode.
  • Use the Rust SDK wrapper when you want application code to compile and run the same Stoffel program.

Next steps