The problem with regular RNG
In a typical online slot, the random number generator (RNG) lives on the operator's server. The player only sees the result. Even an honest operator cannot prove to a specific player that this particular spin wasn't rigged — you have to rely on certificates and reputation.
Provably-fair closes this gap: the operator "locks in" their secret in advance, and after the game reveals it, so anyone can recalculate the outcome independently.
commit-reveal scheme
Before a series of spins, the server generates a serverSeed and publishes only its hash — SHA-256(serverSeed). This is a "commit": the server has committed itself, but the seed itself is not yet revealed, so it cannot be changed retroactively.
The player adds their own clientSeed — it can be changed at any time. Each spin is numbered with a nonce counter. The outcome is calculated deterministically from three values: serverSeed + clientSeed + nonce.
When the serverSeed changes (rotation), the old serverSeed is revealed — "reveal". The player verifies that SHA-256(revealed seed) matches the previously published hash and recalculates all their past spins.
Why exactly HMAC-SHA256
From three seeds, a stream of random bytes is generated via HMAC-SHA256 — a cryptographically secure function: knowing the outcome, it is impossible to reverse-calculate the serverSeed, and changing any single bit of the seed completely alters the result.
An important detail is the absence of "modulo bias". If you simply take the remainder of dividing a random number by the reel size, frequent symbols get slightly more weight. A correct implementation uses rejection sampling: values from the "uneven tail" of the range are discarded, and the distribution remains strictly uniform.
How to verify your spin
In our engine, every spin has a fairness panel: nonce, clientSeed, hash(serverSeed) before the game and the revealed serverSeed after the round. The /api/fair/verify endpoint independently recalculates the outcome from these values — you get the same result you saw in the game.
This is what "provably-fair" means: you don't take it on faith — you verify it. The same mechanism works in Megaways mode and in cascade themes.