Dice guide
Moon Dice: commit, reveal and seed rotation
Moon is a page title here, not a separate product. This guide explains the life cycle of the seeds behind hash-verifiable number dice: how they are committed, used for many rolls in turn, and finally revealed.
The life cycle of a server seed
- The service generates a secret server seed and shows you only its SHA-256 hash. That hash is the commitment.
- You set or accept a client seed. The service cannot know your choice in advance if you change it yourself.
- Each roll uses the same seed pair and a nonce that counts up by one: 0, 1, 2 and so on.
- When you rotate (ask for a new seed pair), the old server seed is revealed and a new commitment is shown.
- You hash the revealed seed. If it matches the old commitment, you can recompute every roll made with it.
For the seed moon-srv-a91b77, the commitment is 6324d9766cd8ebbbe230a669a44ae7bb31795291c86e48e0505f05846b54d2d4. Changing a single character of the seed gives a completely different hash, so the service cannot swap seeds after showing the commitment without the mismatch being plain to see.
Five rolls from one seed pair
The table computes five consecutive rolls with client seed moon-client-3. Each row uses the next nonce. The roll comes from the first 8 hex digits of the HMAC digest, read as a number, divided by 2 to the power 32, multiplied by 10,000, floored and divided by 100.
| Nonce | Message | First 8 hex digits | Roll |
|---|---|---|---|
| 0 | moon-client-3:0:0 | 1ef253e5 | 12.08 |
| 1 | moon-client-3:1:0 | 92a2bfcf | 57.27 |
| 2 | moon-client-3:2:0 | d3047148 | 82.42 |
| 3 | moon-client-3:3:0 | d0b9f66a | 81.53 |
| 4 | moon-client-3:4:0 | efa7ca33 | 93.61 |
One common construction, shown for teaching. Real services publish their own message format.
Nothing in one row hints at the next. Consecutive nonces give unrelated digests, which is what makes the sequence unpredictable while the server seed stays secret.
Why rotation matters
While a server seed is in use, you cannot check it, because it is still hidden. You can only check rolls after the seed is revealed. So the habit worth building is to rotate the seed pair from time to time and actually verify a few of the revealed rolls. A commitment no one ever checks protects no one.
Rotation also limits how many rolls depend on one secret. If you set a fresh client seed at each rotation, the service had to commit to its server seed before it knew your seed. That ordering is the core of the scheme.
What the scheme does not do
Commit-reveal shows that rolls were not altered after the fact. It does not lower the house edge, and it does not make any roll more predictable for you. At a 1% edge, a 50% bet still pays 1.98x and still loses 1% of each stake on average. For the full method, see the hash fairness guide.