Checking a seed pair, one step at a time
"Provably fair" games publish enough to let you redo the arithmetic behind a result. The proof only works if you actually redo it, so this sheet walks through each step with your own numbers.
Before you play, the site shows a hash of a secret server seed. Each result comes from mixing that seed with your client seed and a bet counter. When the site later reveals the server seed, two checks matter: its hash must equal what was shown at the start, and recomputing each bet must give the results you saw.
The computation, with your numbers
Many sites use a scheme shaped like the one below, but the details differ: which seed is the HMAC key, how the message is joined, how many bytes are read and how they become a game result. Read the exact recipe on the site you play at and adjust. The model here is for learning how the check works, not a copy of any one operator's method.
Hash the revealed seed
Put the seed you were finally shown through SHA-256; the output must reproduce the value you were shown before betting. If it does not, the site could have swapped seeds once your bets were in.
Build the message
Client seed, a colon, then the bet number. The bet number goes up by one for every bet made with the same pair, so no two bets share an input.
Run HMAC-SHA256
The server seed is the key, the message is the data. The output is 32 bytes, written as 64 hexadecimal characters.
Read the first four bytes
The first eight hex characters form a whole number between 0 and 4,294,967,295 (that is, 232 − 1).
Scale to a roll
Dividing by 232 yields a number at least 0 and below 1. Times 100, cut to two decimals, that becomes a roll between 0.00 and 99.99.
Why a hash can serve as a sealed envelope
Change a single character of the seed and roughly half of the 256 output bits flip, in a pattern that cannot be steered. That is why publishing the hash early locks the site in without giving the seed away. The grid compares the hash of your seed with the hash of the same seed with its last character changed; lit squares are bits that differ.
Your next ten bets
The same pair produces a fixed list of results, one per bet number. If the site's history shows different numbers for these bets, the recipe it uses is not this one, or something is wrong.
| Bet number | First 8 hex | Roll |
|---|
What the check proves, and what it does not
A matching hash shows the server seed was settled ahead of your bets. It does not prove that the game's payouts are generous, that the stated house edge is the real one in every game, or that the site will pay a withdrawal. Those are separate questions with separate evidence.
Two habits make the check meaningful: set your own client seed rather than accepting the default, and change the pair now and then so the old server seed is revealed and can be checked.
Where these facts come from
- RFC 2104 (HMAC) and FIPS 180-4 (SHA-256) define the two functions; this page's own code is tested against RFC 4231 test case 2 and the FIPS 'abc' vector, and against Node.js's built-in crypto, on every build.