Cycle chain
A streak's runs are fixed by one secret, drawn when the streak is registered. Run n of the chain (n from 0: the first cycle's runs are 0 to 27, the next cycle's 28 to 55, and so on) gets its seed from the secret and n; a random cycle's order of ships comes from the secret and the cycle's place in the chain. The secret's SHA-256 is public from the start, the secret itself once the streak has ended, so anyone can work out the whole chain again, as far as they like, and see that no seed or ship was picked afterwards.
Everything here is worked out in your browser (Web Crypto: SHA-256 and HMAC-SHA256); nothing is sent anywhere. SHA-256 of the secret's 32 bytes is the commitment. Run n's seed is the first 4 bytes of HMAC-SHA256(secret, "seed:n"), big-endian, the top bit cleared (0 becomes 1). Cycle k's ships (k from 0) in a random cycle are the game's order (Kestrel A … Crystal B) shuffled: for j from 27 down to 1, place j swaps with place (first 4 bytes of HMAC-SHA256(secret, "order:k:j")) mod (j+1). In a cycle by choice the player picks each ship (read here from the codes the server gave); the seeds are fixed all the same. A code holds the settings, the ship and the seed. Streaks begun before 2026-11-26 drew a new secret for each cycle: there every cycle is the first of its own secret.
| Run | Chain | Ship | Seed | Code | Code the server gave |
|---|