How the schemes work · 03 / 23
What the server seed, client seed and nonce each do
A seed-based game result is a keyed hash of three inputs. The operator supplies one in secret, you supply one in the open, and a counter supplies the third.
Short answer
The server seed is the operator's secret, committed to by a hash shown before you bet. The client seed is a value you supply, so that the operator cannot know the result when it commits. The nonce is a counter that makes each bet under one seed pair different. Together they are the input of a keyed hash whose output becomes the game result.

Key facts
- Server seed: secret during use, revealed on rotation, checked against its SHA-256 hash (FIPS 180-4).
- Client seed: public and changeable by you. It does its job only if you set it after the hash was shown.
- Nonce: rises by one with each bet.
- In the common scheme the three are combined with HMAC-SHA256 (RFC 2104).
- A server seed is not a wallet seed phrase, and no game needs the latter.
- Server seedChosen by the operator and kept secret while in use. Its SHA-256 hash is shown to you first.
- Client seedChosen by you, or suggested by the page and accepted by you. Not secret.
- NonceA counter that goes up by one with every bet under the same pair of seeds.
- HMAC-SHA256A keyed hash of client seed and nonce under the server seed. The output is 32 bytes.
- ResultThe first bytes of the output, converted to a number by the rule of the game.

| Input | Who chooses it | When you see it | What it prevents |
|---|---|---|---|
| Server seed | The operator | After you ask for a new seed pair | You computing results in advance, since the key is secret during play |
| Server seed hash | Follows from the server seed | Before the first bet | The operator replacing the seed after it has seen your bets, if you saved the hash yourself |
| Client seed | You | Always visible to both sides | The operator picking a server seed with full knowledge of every input |
| Nonce | The protocol, by counting | In each bet record | Two bets sharing a result, and gaps or repeats going unnoticed in a record you keep yourself |
The server seed and its hash
The server seed is a random string, often written as 64 hex digits. Before your first bet the game shows its SHA-256 hash. The hash fixes the seed, because no practical method is publicly known for finding a second input with the same SHA-256 value. The hash also hides the seed, provided the seed is long and random, because the hash cannot be run backwards.
Some game pages speak of a hashed and an unhashed server seed. The hashed one is the commitment you see during play. The unhashed one is the seed itself, shown after it has been replaced. Until then no bet under it can be verified, and after that every one of them can. The hash checker compares the two.
The client seed
If the operator chose every input, it could generate many server seeds, look at the results each would give, keep the one it liked and commit to that one. Every later check would pass. A value that comes from you after the commitment is on screen removes this option, because the operator had to commit before knowing your value.
This works under two conditions. The server seed hash was shown before you set the client seed, and the operator could not predict the client seed. A default client seed produced by the operator's own page code may be known to the operator before it commits. Replacing the default with text of your own costs nothing and settles the question.
The client seed does not let you steer the result. You cannot see the server seed, so from your side every client seed is as good as any other. No client seed wins more often.
The nonce
The nonce is a number used once. It counts the bets made under one pair of seeds, so that each bet hashes a different message and gets its own result. Because it counts, a gap or a repeat is visible in a record you keep yourself. The history page of the game is under the operator's control and is weaker evidence. Whether the counter starts at 0 or at 1 is a detail of the implementation, and it matters when you verify a bet by hand.
Why seeds are rotated
Revealing a server seed ends its use, since anyone who knows it can compute every future result under it. So in the usual design the game replaces the seed at the moment it reveals the old one: a new hash appears, and the old seed becomes public. You decide when to ask for this. A seed pair that is never rotated is never revealed, and its bets can never be checked.
Rotating seeds does not change the odds of the game. It changes only when you are able to check. To run the check with all intermediate values, use the provably fair verifier. To see the same idea with two parties who both commit, read the page on commit-reveal schemes.
What happens to the three values over the life of a seed pair?

| Moment | Server seed | Client seed | Nonce |
|---|---|---|---|
| A new pair starts | Generated by the operator. Only its hash is shown | Suggested by the page or typed by you | Starts at its first value |
| You bet | Secret | Unchanged | Used for this bet, then raised by one |
| You bet again | Secret | Unchanged | The next number |
| You rotate | Revealed. A new seed takes its place, shown as a new hash | You may set a new one | Starts again |
| Afterwards | Public, and usable for checking every bet of the old pair | Public | Listed with each bet in the history |
What do the values look like in an example?
In test vector V1 of this site the server seed is reference-test-server-seed-0001 and its hash is 9088b0a58305a44b0ec72f1af9ef3e2e4927d17a516fdbf805707fdebdf69107. The client seed is reference-client and the nonce is 0. The keyed hash of these begins with the bytes 253, 63, 156, 101, and the result for a range of 10000 is 9892.
Change the nonce to the next number and the digest changes completely, which is why two bets under one pair do not share a result. Real seeds are long random strings, and the ones in the example are readable on purpose. The provably fair verifier shows every step.
What makes a good client seed?
Any value the operator could not have predicted when it committed. It does not need to be secret or long. A few characters typed by you after the hash appeared are enough, because the purpose is not to hide anything. The purpose is that the server seed was already fixed when your contribution arrived. A default generated by the operator's page fails this test, since whoever wrote the page may know how the default is made.
Which mistakes are common?
- Never rotating, so that no server seed is ever revealed.
- Checking the revealed seed against a hash copied from the history afterwards. The point is the copy you saved before betting.
- Confusing the server seed hash with the server seed. The seed hash checker turns one into the other, in one direction only.
- Thinking that a new client seed changes luck. It changes which results come, not their odds.
- Typing a wallet secret phrase where a client seed is asked for.
Which terms does this page use?
- Server seed hash
- The SHA-256 hash of the server seed, shown before play as the commitment.
- Seed pair
- One server seed and one client seed, in use together for a series of bets.
- Rotation
- Replacing the seed pair. The old server seed is revealed at that moment.
- HMAC-SHA256
- The keyed hash that turns seeds and nonce into 32 bytes.
- Commitment
- A value published in advance that fixes a secret without showing it. See commit-reveal explained.
- Provably fair
- The scheme as a whole. Its form at Bitcoin casinos is on the page provably fair at a Bitcoin casino.
Questions people ask
Should I change my client seed?
Yes, once, to text of your own, after the server seed hash is displayed and before you bet. After that, changing it again gives no further advantage.
Can the operator see my client seed?
Yes. It is not a secret and does not need to be. Its job is to be fixed by you after the operator has committed.
Is a server seed the same thing as a wallet seed phrase?
No. They share a word and nothing else. A server seed is a value the operator reveals for checking. A wallet secret phrase controls funds and must never be typed into any game page or verifier.
What does it mean when a game has no client seed?
Then the operator controls all inputs to the hash, and the commitment alone does not rule out a seed selected in advance. Some designs replace the client seed with another value the operator cannot know, such as data from a later block. The page on on-chain randomness covers that case.
What is a server seed?
A secret random value generated by the operator. Together with your client seed and the nonce it determines the result of each bet. Its hash is shown before you bet, and the seed itself after you rotate.
What is a client seed?
A value on your side of the input. It can be anything, and it matters only that you set it after the server seed hash was shown.
What is a nonce in a provably fair game?
A counter that goes up by one with every bet under the same seed pair, so that each bet has its own input and its own result.
What is a server seed hash?
The SHA-256 hash of the server seed. It fixes the seed without revealing it, and is what you compare the revealed seed with afterwards.
What is an unhashed server seed?
The server seed itself, as revealed after rotation, in contrast to the hash shown beforehand.
How often should I rotate my seed pair?
Whenever you want to check the bets made so far. Rotation does not change the odds.
Why is HMAC used instead of hashing the seeds joined together?
HMAC is the standard way to combine a secret key with a message (RFC 2104). A plain hash of joined strings leaves it open where one part ends and the next begins, so two different sets of inputs could give the same text to hash.
Sources
- RFC 2104, HMAC: Keyed-Hashing for Message Authentication (IETF, February 1997). Defines HMAC as
H(K XOR opad, H(K XOR ipad, text))and says that keys longer than the hash block are hashed first. Checked . - FIPS 180-4, the NIST standard that specifies SHA-256. We link to the NIST publication page for the standard. The known answer for the input
abcin our test vectors is recomputed with Node on every build. Checked .
How we checked: statements about a named body link to that body's own page and carry the date we read it. Numbers in worked examples are computed by the site's build from the formulas shown, with routines covered by its test suite.