
Provably fair, explained simply
How can you be sure an online game does not cheat? On LilyFrog, every game is set before you play and you can recompute it yourself. Here is how, with a worked example.
The problem: trusting the server
In an online game, the server draws the results. Without proof, nothing would stop a site from changing a result at the last moment, for instance making the croc show up just as your pot gets big. Provably fair makes such cheating impossible to hide.
The three ingredients
- The server seed: a long secret code drawn at random by the server. Before you play, you see its hash (SHA-256). The hash reveals nothing about the seed, but it commits to it: another seed would give another hash.
- The client seed: a text of your own, which you can change whenever you like on the Provably fair page. So the server cannot pick the results alone.
- The nonce: the number of your game with this seed (0, 1, 2…), and the cursor, which says which draw of the game it is (for instance 100 + n for the jump of row n, 300 + n for its weather; in Infinite Pad, 1,000,000 + n for the jump of row n).
The formula
Each draw is computed this way: HMAC-SHA256(server seed, “client seed:nonce:cursor”). The first 52 bits of the result (the first 13 hexadecimal characters) give a number between 0 and 1. The jump holds if this number is lower than the odds of the pad chosen, set by the settings of the game. The layout of the pads, the weather, the special pads and every jump are drawn the same way, each with its own cursor.
A worked example
With seeds made up for the example (they are not real seeds of the game):
- Server seed: c032094037df1d053e66fcdaefe7813049e8fd4847d39a887bac56513d7571b0
- Its hash, shown before playing: 0abaecdc59735436da02f5fcef6e7a2ec6d5cda856804dd88db6576b4b31f668
- Client seed nenuphar, game no. 7, jump of row 3 (cursor 103): the message is nenuphar:7:103.
- HMAC-SHA256: 1525ee90e73c835b61aeb70508c5f09e60b76b1122b512570bb931ba80fcc96f
- The first 13 characters, 1525ee90e73c8, divided by 252, give 0.08261004483868994.
Anyone with the same seeds finds exactly this number. Had the server cheated, the sums would not add up.
Checking a real game
- In My account, open the history: every game has a “Verify” link.
- On the Provably fair page, tap “Change seed”: the old server seed is revealed, and a new one takes its place for your next games.
- Compare: the hash of the revealed seed must be the one you saw before playing. The site then recomputes all the games you played with it, and you can redo the sums yourself below.
Compute it yourself, without us
This calculator runs entirely in your browser: it sends nothing to our server. Paste a revealed seed, your client seed, the nonce and the cursor. For one of your games, the “Verify” link of the history shows the revealed seed, the client seed and the nonce of that game; the list of cursors, Infinite Pad and the daily challenge included, is on the Provably fair page.
What it guarantees, and what it does not
- Guaranteed: the numbers drawn in a game are set before you play: they depend neither on your bet nor on the pad you pick, and anyone can recompute them. The rules of a game are frozen when it starts.
- Not guaranteed: winning. Like any gambling game, LilyFrog keeps a margin, stated in the game rules (the return to player). Play for fun and set yourself limits (responsible gambling).