Stoffel App Network and Off-Chain Integration
Scope: AI-agent-agnostic playbook for building applications with the Stoffel framework. This is not a maintainer guide for compiler, VM, protocol, or release engineering work. Dependency assumption: use the public 0.1.0 install snippets from these docs. When developing against a local checkout, make that source-based workflow explicit.
Use when
Use this playbook when an app moves beyond local runs and needs client/server builders, network config, off-chain coordinator integration, or typed ClientStore IO against real nodes.Goal
Guide advanced app developers from local bytecode to app-level network/off-chain integration using public SDK builders, while labeling lower-layer behavior with its 0.1.0 component status.Current source of truth
crates/stoffel-rust-sdk/README.mdcrates/stoffel-rust-sdk/src/runtime.rscrates/stoffel-rust-sdk/src/config.rscrates/stoffel-rust-sdk/src/client.rscrates/stoffel-rust-sdk/src/server.rscrates/stoffel-rust-sdk/src/coordinator/offchain.rscrates/stoffel-rust-sdk/examples/network_config.rscrates/stoffel-rust-sdk/examples/client_server.rs
Preconditions
Before network integration, verify local behavior:Runtime builders
The SDK runtime exposes app-level builders:Network config concepts
App-level network config must align on:- party id
- bind addresses and server addresses
- expected parties
- expected clients
- threshold
- backend and curve
- preprocessing sizes when required by the selected backend
- deployment-level mapping of party configs
- client slot and ClientStore IO shape
Off-chain ClientStore flow
- Compile/build app bytecode.
- Run local MPC with the same ClientStore inputs and expected output clients.
- Generate typed bindings from that bytecode.
- Build runtime from bytecode and generated manifest.
- Derive off-chain client config for a client slot.
- Attach coordinator address, node endpoints/RPC addresses, timestamp, and client identity material.
- Run or submit typed client inputs.
- Validate typed outputs and consensus/order evidence where applicable.
CLI network execution
The CLI can execute against a network config:--config is network/off-chain client config, not app Stoffel.toml.
Validation / done criteria
- Local smoke test passes first.
- Network config validates before starting servers/clients.
- Client IO metadata matches generated bindings.
- Real client/server run returns expected output or a concrete error with logs.
- Any coordinator/network assumptions are labeled with 0.1.0 component status and paired with deployment validation guidance.
Common pitfalls
stoffel run --configis network/off-chain config, not projectStoffel.toml.- Do not duplicate lower-level networking/protocol logic in app code.
- Do not bypass typed IO validation for ClientStore apps.
- Keep on-chain coordinator paths marked advanced until public docs and stable APIs exist.
- Present coordinator/network assumptions with explicit 0.1.0 status and deployment validation guidance.
- Do not move to network debugging until the local loop has produced a real passing or failing run.