Skip to main content
Most developers should use stoffel run, stoffel dev, or the Rust SDK. These surfaces compile/load .stflb bytecode and run it through clear checks, local MPC testing, or configured network execution. Use direct stoffel-vm APIs only for VM tests, bytecode tooling, custom embedding, or runtime instrumentation.

Build bytecode

For projects, prefer stoffel build:
stoffel build reads Stoffel.toml and writes .stflb artifacts under target/debug/ or target/release/. For one selected source file, use stoffel compile with an explicit output path:

Inspect bytecode

Use these commands to inspect function metadata, generated instructions, bytecode shape, and runtime program information before debugging low-level behavior.

Run through the CLI

stoffel run uses the local MPC test network unless you pass --network and --config for a deployed network configuration. For ClientStore programs, provide client-slot inputs:
The first number in --client-input 0=42 is the client slot. Repeating the same slot appends inputs for that client slot in order.

Watch mode

Use --once for CI/scripts. Omit it while editing to rebuild and rerun when files change.

Run through the Rust SDK

Clear execution is useful for fast logic checks without MPC networking:
For app-shaped local MPC testing, load the bytecode that the CLI built:
.execute_local().await? runs local MPC testing by spawning several MPC nodes/processes on your machine.

When to use direct VM APIs

Use direct VirtualMachine / VMFunction APIs when you are:
  • writing VM unit tests;
  • building bytecode-generation tooling;
  • testing the instruction set directly;
  • experimenting with hooks or custom output sinks;
  • integrating a custom table-memory or local-storage backend.
Do not use direct VM APIs as the first path for application docs. For applications, build bytecode with the CLI and load it through the Rust SDK.

Debugging checklist

  • Use stoffel check --print-ir before bytecode generation.
  • Use stoffel compile --disassemble ... to inspect instructions.
  • Use stoffel run --program-info to inspect loaded functions and metadata.
  • For MPC programs, confirm parties, threshold, client inputs, and --expected-output-clients match the program’s ClientStore and output behavior.
  • Use VM hooks or direct VM construction only when CLI/SDK-level inspection is not enough.

See also