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, preferstoffel 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
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:
--client-input 0=42 is the client slot. Repeating the same slot appends inputs for that client slot in order.
Watch mode
--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:.execute_local().await? runs local MPC testing by spawning several MPC nodes/processes on your machine.
When to use direct VM APIs
Use directVirtualMachine / 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.
Debugging checklist
- Use
stoffel check --print-irbefore bytecode generation. - Use
stoffel compile --disassemble ...to inspect instructions. - Use
stoffel run --program-infoto inspect loaded functions and metadata. - For MPC programs, confirm
parties,threshold, client inputs, and--expected-output-clientsmatch the program’sClientStoreand output behavior. - Use VM hooks or direct VM construction only when CLI/SDK-level inspection is not enough.