stoffel init project with normal Rust application code around the Stoffel program.
The example is a private approval tally for a feature launch. The app owns the proposal, requester, public voter roster, approval threshold, and persistence. Each voter contributes one private yes/no bit through ClientStore. Stoffel opens only the aggregate yes-vote count, and the Rust app maps that opened count into a launch decision.
Runnable source:
What this teaches
This is the minimal app-shaped SDK path:Privacy boundary
The app learns the count it needs to decide whether the threshold passed. It does not need every voter’s ballot in the repository, logs, support tools, or analytics jobs.
Code map
src/domain.rs: see the ordinary proposal, round, voter roster, and decision types.src/client.rs: see how each voter owns a client slot and private approval bit.src/main.stfl: see the private tally and single reveal point.src/app.rs: see the Rust SDK boundary that validates input shape, attaches client inputs, runs local MPC, and persists the opened decision.tests/quickstart.rs: see app-layer behavior and the trusted-server baseline.
Run it
From the tutorial repository root:2 or a result list containing 2, depending on the installed CLI display format.
Try a different cohort
The Stoffel program usesClientStore.get_number_input_clients(), so the local run can use any contiguous client slots starting at 0:
0..n; a missing slot means the app cannot know which private input belongs to which public voter.