The problem

Picking a raffle winner with Math.random() on your server is asking your community to trust you. Even if you're honest, you can't prove it.

The recipe

  1. Commit ahead of time. Before entries close, publish the serverHash you'll use. Most teams pin it in a Discord or X post with a timestamp.
  2. Collect entries. Lock the list when the draw closes. Number each entry 1..N.
  3. Use a public client seed. Use something deterministic and observable — for example, the SHA-256 of the next Bitcoin block at a known height, or a tweet ID from your account at a fixed time.
  4. Draw the winner.
    curl "https://api.provable.io/api/ints?clientSeed=PUBLIC_SEED&count=1&min=1&max=N"
  5. Publish the proof. Share the clientSeed, the serverHash, and the outcome. Anyone can hit /verify to confirm the result.

Why this works

Because the serverHash was committed before entries closed and the clientSeed couldn't be known in advance, you couldn't have steered the outcome. Independent verification turns the raffle from "trust me" to "check for yourself."

Next steps