General runtime builtins
The standard library includes object, array/list, closure, local storage, formatting, assertion, and output helpers.print is variadic: it formats arguments, joins them with spaces, and writes one line through the VM’s configured output sink.
In StoffelLang, prefer method syntax where the language exposes it:
Share builtins
Share values represent MPC secret shares. The VM exposes these canonical share operations:
Batch operations
Use batch operations when a program naturally computes or returns several shares.Share.batch_mul is the VM builtin for batched share multiplication; use it when the algorithm already has aligned share arrays and should consume MPC multiplication material in batch form.
ClientStore builtins
ClientStore bridges external client input material into a Stoffel program. VM-level client slots are ordinal positions in the configured/sorted client roster, not necessarily raw network client IDs.
Example:
Mpc builtins
Mpc exposes runtime metadata, readiness, capabilities, and public randomness helpers.
Mpc.rand and Mpc.rand_int produce local public randomness. For jointly generated secret-shared randomness, use Share.random or Share.random_int.
Capability names include:
Mpc.has_capability(...) accepts common aliases such as mul, rbc, open-exp, and preproc-store.
Example:
MpcOutput builtins
UseMpcOutput.send_to_client when a program should deliver share outputs to client slots through the coordinator/output path.
It accepts a client slot and either a single share or a non-empty homogeneous array/list of shares:
Share.send_to_client(client_slot) is also available for single-share output flows.
Lower-level protocol helper modules
The VM also registers module-style helpers used by advanced protocol and cryptographic examples:
Treat these as lower-level integration surfaces. Prefer checked examples in
crates/stoffel-lang/examples/ before documenting production-facing patterns around them.
Current AVSS helper names: