Tower Legend · Provably Fair Verifier
Everything is computed in your browser from the revealed seeds. Nothing is sent to any server.
Input
Output
- sha256(server_seed)
- -
- Self-test vector
- -
Compare the SHA256 above with the server seed hash shown in the game before you placed the bet.
| Row | hmac_sha256(client_seed:nonce:row, server_seed) | Safe tiles |
|---|
Final Result · Bottom row first
Algorithm
- Rules (columns, traps, rows): Easy 4/1/9, Medium 3/1/9, Hard 2/1/9, Extreme 3/2/6, Nightmare 4/3/6.
- Commitment: before the bet the game shows SHA256(serverSeed) as lowercase hex.
- For each row r = 0, 1, …: mac = HMAC-SHA256(key = serverSeed, message = clientSeed + ":" + nonce + ":" + r), as 32 bytes.
- Candidates = [1 … columns]. For j = 0 … columns − traps − 1: u = big-endian uint32 of mac bytes [4j, 4j + 4); index = floor(u × remaining / 2³²); remove that candidate — it is a safe tile.
- The removed candidates, sorted ascending, are the safe tiles of row r; the rest are traps. Tiles are numbered 1 → columns from left to right.
- Multiplier after n safe rows = floor(98 × columnsn / (columns − traps)n) / 100.
Source code: GitHub