What it is
Provably fair sweepstakes casinos run the same scheme: a server seed whose SHA-256 hash the player sees first, a client seed the player controls, and a nonce per bet. The weak point is who makes the server seed. When the casino makes it and publishes its own hash, players have to trust that nobody generated a few seeds and kept the one that suited the house.
With Provable.io, the server seed comes from a sealed commit: Provable.io generates it, returns it only to your live API key, and publishes its hash under a label you choose. There is one sealed commit per key and label, and anyone can list them with GET /api/commits?label=…, so a second, friendlier seed for the same label would be visible to everyone.
How a seed pair works
- Seal.
POST /api/commitwith{"sealed": true, "label": "casino:player:42:seed:7"}. Show the playerserverHash; keepserverSeedon your servers. - Bet. The player sets a client seed (for example with the client seed generator). Each bet is
HMAC-SHA256(serverSeed, clientSeed:nonce:round), derived in your stack. No API call per bet. - Rotate. When the player changes seeds,
POST /api/revealpublishes the old server seed with a permanent verification page. A sealed commit nobody reveals becomes public on its own after 7 days. - Verify. Players paste the seeds and nonce into the provably fair checker; auditors rerun whole sessions with provable-core.
Check one roll
This is what a player or auditor sees for a single 1–100 roll: the seeds, the hash committed first, and the result. The replay button recomputes it in your browser without calling Provable.io.
{
"clientSeed": "casino_player_42_seed_7",
"nonce": 0,
"serverHash": "4db878706a292f26b2df9961fc3c1a520957782afd004f33e731633b4fdfcdd0",
"outcome": {
"notation": "1d100",
"rolls": [27],
"modifier": 0,
"total": 27
}
}- Before the roll, the server commits to a seedPublish this hash before the roll, so the seed can't be swapped afterwards.
serverHash = sha256(serverSeed) = 4db878706a292f26b2df9961fc3c1a520957782afd004f33e731633b4fdfcdd0 - The roll is a pure function of both seeds
HMAC-SHA256(serverSeed, "casino_player_42_seed_7:0:0") → 1d100 = [27], total 27 - After the roll, the seed is revealed and anyone can replay it
serverSeed = c54936c24885a48555b0421fe1f2f0fdcbe39add65f20962c22bcf5616fd37b4
Integration snippet
// 1. New seed pair for a player (once per rotation, not per bet).
const headers = { "x-api-key": process.env.PROVABLE_LIVE_KEY, "content-type": "application/json" };
const commit = await fetch("https://api.provable.io/api/commit", {
method: "POST",
headers,
body: JSON.stringify({ sealed: true, label: `casino:player:${playerId}:seed:${n}` }),
}).then((r) => r.json());
// Show commit.serverHash to the player. commit.serverSeed stays on your servers.
// 2. Every bet: derive locally with the open-source library.
const { Provable } = require("@provableio/provable-core");
const [roll] = Provable(() => {})({
serverSeed: commit.serverSeed, clientSeed, nonce, cursor: 0,
}).floats(1);
const result = Math.floor(roll * 10001) / 100; // your game's own conversion, e.g. dice 0.00-100.00
// 3. The player rotates: publish the old seed, then start step 1 again.
await fetch("https://api.provable.io/api/reveal", {
method: "POST",
headers,
body: JSON.stringify({ commitId: commit.commitId, clientSeed, endpoint: "floats", params: { count: 1 } }),
});What an auditor can check
- Each label has exactly one sealed commit, and it was made before the bets on it.
- The revealed server seed hashes to the
serverHashthe player saw. - Every bet recomputes from the server seed, client seed and nonce.
- Every reveal is a live outcome, so it lands in that day's public transparency log, a Merkle root anyone can recompute. It can't be edited afterwards.
What stays with you
Provable.io is the commitment and verification layer, not a game provider. Game math and RTP certification, KYC, geolocation, coin redemption, official sweepstakes rules and prize fulfillment stay with your platform and your counsel. Running promotional drawings instead of games? See the sweepstakes API for winner selection.
Keys and volume
Sealed commits need a live (pk_live_) key. Restrict it to your servers' IP addresses in the dashboard, because that key can read unrevealed seeds. You make a commit and a reveal per seed rotation, so even a busy casino uses a few calls per player session. The default quota is 10,000 draws a day; email [email protected] if you need more.
FAQ
Do I need an API call for every bet?
No. You make one sealed commit per seed pair and derive every bet from it in your own stack with the open-source provable-core library. Bet volume never touches your quota.
Can Provable.io see my players' bets?
No. Provable.io sees the commit, its label and the reveal. Bets, stakes and balances stay in your system.
Does this make my sweepstakes casino compliant?
No. It gives you per-round records that a player, auditor or regulator can recompute. Licensing, game certification, KYC, geolocation, coin redemption and official rules stay with you and your counsel.
What happens if Provable.io is down?
Bets keep running on the current seed, because they are derived in your stack. Only rotating to a new seed waits until the API is back.
Can the casino keep a seed hidden forever?
No. An unrevealed sealed commit becomes public automatically 7 days after it was made, so rotate seeds within a week.