DiceStrats / Blog / The math
The math

How Stake dice generates a roll, and what seed rotation really does

Published 29 August 20266 min read

Every Stake dice roll is computed from three inputs you can see: a server seed (hashed in advance), a client seed you control, and a nonce that counts up. That makes the game verifiable after the fact — and it also settles a lot of arguments about 'hot seeds'.

The three inputs

  • Server seed — a random secret Stake generates per seed pair. Before you bet, you only see its SHA-256 hash, so Stake can't change it later without the hash mismatching.
  • Client seed — a string you set (Stake generates one by default, you can type your own). Stake can't predict it.
  • Nonce — starts at 0 for a new seed pair and increments by 1 every bet.

From inputs to a roll

  1. Compute HMAC-SHA256(key = server seed, message = client seed : nonce : round).
  2. Take the first 4 bytes of the digest. Convert each to a fraction and sum them as b₀/256 + b₁/256² + b₂/256³ + b₃/256⁴ → a float in [0, 1).
  3. Multiply by 10001, floor, divide by 100 → a number from 0.00 to 100.00 (Stake displays 0.00–99.99 for dice).

"Roll under 49.5" wins if that number is below 49.50; "roll over 50.5" wins above 50.50. The payout is 99 / chance — see the house-edge math.

Verifying a roll

When you rotate to a new seed pair, Stake reveals the previous server seed. You can then plug (server seed, client seed, nonce) into Stake's fairness page — or any offline HMAC calculator — and reproduce every roll you made under that pair. If any roll doesn't match, Stake cheated; in practice this has never been shown, which is the whole point of the scheme.

What changing your client seed does

It changes the sequence of rolls you're going to get. It does not change the distribution: every seed pair produces rolls that are uniform over 0–99.99, and the roll at nonce n tells you nothing about the roll at nonce n+1. Concretely:

  • A seed that just produced 15 losses is not "cold". The next roll is still a fresh HMAC output with the same odds.
  • Rotating mid-streak doesn't reset anything except the nonce. The new sequence has exactly the same probability of continuing the streak.
  • Nobody can find a "winning seed". The server seed is unknown until you rotate away from it, so you can't precompute the rolls you'd get.

Why DiceStrats has auto seed rotation then

Three practical reasons that have nothing to do with luck:

  1. Verification hygiene. Rotating every N bets means each server seed is revealed regularly, so you can verify rolls in manageable chunks instead of a 50,000-nonce block.
  2. Nonce size. Some strategies and tools handle very large nonces poorly. Rotating keeps them small.
  3. People want it. Plenty of runners have a ritual — new seed every 500 bets, or after 10 losses. It's harmless, so the run screen has new seed every N bets / losses / wins fields and the bridge calls Stake's rotate endpoint for you.

Just don't build a strategy around it. Bet sizing, stop-loss and vault are what determine how a session ends; seeds are cosmetic. The strategy guide covers the parts that matter.

One caveat: "provably fair" ≠ "fair odds"

Provably fair proves the rolls weren't manipulated. It says nothing about the payout, which is set at 99/chance — a 1% edge on every roll, fully disclosed and fully verifiable. The system guarantees you get honest randomness; it also guarantees that honest randomness loses 1% of turnover over time.

Run it, don't hand-roll it.
DiceStrats is a free side-panel extension that runs dice strategies on your own Stake account — plus a marketplace of creator strategies with live leaderboards.
Get the extension →