ChainTycoon

Provably fair dice

How every roll is made so that nobody, including the server, can pick the result, and how to check a finished game yourself.

Every roll at an online table can be checked after the game. The server can't choose a result, because each roll depends on a secret it committed to before the game and on a seed from your own device that it only sees when you roll.

How a roll is made

  1. Before the game the server picks a secret seed and publishes its fingerprint: sha256(serverSeed). Changing the seed later would change the fingerprint.
  2. When you sit down your browser sends a client seed. All players' seeds are mixed into the game salt.
  3. When you press Roll dice your browser sends a fresh roller seed. The roll's randomness is HMAC-SHA256(serverSeed, gameSalt : rollNumber : rollerSeed).
  4. Dice values are read from those bytes without bias: a byte of 252 or more is thrown away and the next one used, so every face has exactly the same chance.
  5. After the game the server reveals the seed. Anyone can now recompute every roll and every card draw, and replay the game with the same rules engine.

Check a game

At the end of an online game, open Provably fair and press Check this game. Your browser:

You'll see "Verified: all N rolls match and the winner is correct", or what didn't match.

The full record of any finished table is public at /api/tables/<table id>/record, so you can also check it with your own code. The rules engine that replays it is the same code the game runs.

What this doesn't cover

Practice tables against bots run entirely in your browser, so there's nothing to check there. The proof covers the dice and cards, not the choices players make.