Fair play: check the dice yourself

At STAR HALL you don't have to take our word for it: you can check the dice, cards and numbers of every game yourself.

Before the first roll a “code” appears on the table, and after the game you get that game's “key”. If the two match, no die or card was changed during the game.

Enter STAR HALL

How it works: like a sealed envelope

Check a real game yourself

  1. In the lobby, tap “Game history”.
  2. Open a finished game and go to the “Fairness proof” section; the code, key and public seed are there.
  3. Tap “Check right here”: the dice are rebuilt from the key and compared with your game. In backgammon you also see each player's number of rolls, doubles and turns with no legal move.
  4. Or tap “Share check” to open this page filled in with that game's code and key; you can send it to others too.
The “Fairness proof” section in game history with the code, key and public seed
Step 2: tap “Code & key” to see that game's code, key and public seed (this screen is in Persian).
Result of “Check right here”: the key and the dice both match
Step 3: after “Check right here” you see a green tick and both players' dice (sample code and key).

Check by hand, without our site

If you don't want to trust even the tool on this page: paste the “key” (not the code) into any SHA-256 tool with text input. The result must be exactly the code.

How each backgammon die is made: compute HMAC-SHA256 with the key over “public seed:roll number”. Take the first eight characters of the result as a number, divide it by 2 to the power 32, multiply by 6, take the whole part and add one. Roll numbers start at 0 and each turn uses two; the opening roll repeats until the two dice differ.

Run these lines in Node.js (put in your own game's key and seed):

const c = require("crypto");
const key = "KEY", seed = "PUBLIC_SEED";
const die = n => 1 + Math.floor(parseInt(c.createHmac("sha256", key)
  .update(seed + ":" + n).digest("hex").slice(0, 8), 16) / 2 ** 32 * 6);
console.log(c.createHash("sha256").update(key).digest("hex")); // must equal the code
console.log([0, 1, 2, 3, 4, 5].map(die)); // the dice in order

FAQ

Can the site change the dice during a game?

Not without it showing. The code is shown and recorded before the first roll; different dice mean a different key, and a different key has a different code.

Why do you give the key only after the game?

If the key were known before the game, anyone would know the dice and cards in advance. So we show only its fingerprint (the code), which does not reveal the key but later proves it was the same key.

Which games does this cover?

Backgammon (every die), Hokm, Chaharbarg and 21 (card order), Daberna (number order), the dice game (every throw) and billiards (ball rack). The 21 dealer table in “Quick start” and snooker do not have this code.

What about billiards and snooker?

Billiards has no dice; the ball rack comes from the key, and each shot is calculated on the server from the angle and power you choose. Snooker has no code yet.

Do I contribute to making the dice?

In the dice game, yes: your own browser adds a number to how the dice are made. In the other games the server makes the key and seed before the game and locks them by showing the code; from then on no die can be changed.

Can I see other people's keys?

No. Each game's key is only for the players at that table, unless they send you the check link themselves. The link contains no names or personal details.

Does the tool on this page send anything to the server?

No. The check runs entirely in your browser; once the page has loaded it works even offline.

Is the site in English?

The lobby, game rooms and rules are available in English (switch the language in the lobby menu ☰ → Settings). Some in-game screens are still in Persian.

More at STAR HALL

نسخهٔ فارسی