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
- Commit ahead of time. Before entries close, publish the
serverHashyou'll use. Most teams pin it in a Discord or X post with a timestamp. - Collect entries. Lock the list when the draw closes. Number each entry 1..N.
- 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.
- Draw the winner.
curl "https://api.provable.io/api/ints?clientSeed=PUBLIC_SEED&count=1&min=1&max=N" - Publish the proof. Share the
clientSeed, theserverHash, 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."