Skip to main content
Use this quickstart when you want the smallest runnable Rust app before the larger tutorial apps. It is shaped like a 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:
Use it to see the SDK handoff without the extra domain logic in matchmaking, lottery, or Battleship.

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

Read the files in this order:
  1. src/domain.rs: see the ordinary proposal, round, voter roster, and decision types.
  2. src/client.rs: see how each voter owns a client slot and private approval bit.
  3. src/main.stfl: see the private tally and single reveal point.
  4. src/app.rs: see the Rust SDK boundary that validates input shape, attaches client inputs, runs local MPC, and persists the opened decision.
  5. tests/quickstart.rs: see app-layer behavior and the trusted-server baseline.

Run it

From the tutorial repository root:
Expected app output:
Then run the Stoffel project directly:
Expected CLI output: 2 or a result list containing 2, depending on the installed CLI display format.

Try a different cohort

The Stoffel program uses ClientStore.get_number_input_clients(), so the local run can use any contiguous client slots starting at 0:
Keep the slots contiguous. The tutorial source loads slots 0..n; a missing slot means the app cannot know which private input belongs to which public voter.

Next steps

After this quickstart, use Build a private matchmaking service to see the same SDK boundary inside a richer app-shaped tutorial. Use Rust SDK App Integration when you want the reusable pattern without a tutorial domain.