Altair fixes the entire sequence of results before anyone bets, and proves it with a pre-committed hash chain. This document explains the scheme, how to verify it yourself and — honestly — which attack is still open.
Spanish version: FAIRNESS.es.md.
The root is derived from the secret with sha256(CHAIN_SECRET) and chained forward:
h[0] = root h[k] = sha256(h[k-1]) k = 1..L
h[L] — the commitment — is published before the first round. Rounds consume the chain in reverse order:
| Round | Seed | Its serverSeedHash is… |
|---|---|---|
| 1 | h[L-1] | h[L] = the published commitment |
| 2 | h[L-2] | h[L-1] = the seed of round 1 |
| n | h[L-n] | the seed of round n-1 |
The crash point comes from HMAC-SHA256(seed, clientSeed:nonce), with the configured RTP (97 % by default).
Before the chain, the seed was generated at the start of each round and only its hash was published. Since the client seed was public and fixed, nothing stopped an operator generating a thousand candidate seeds, computing the crash point of each, keeping the worst one for the player and publishing its hash. Everything checked out afterwards: the hash matched and the crash point derived correctly. The player had no way to detect it.
With the chain, the seed of round n must satisfy sha256(seed_n) = seed_{n-1}, and that value is already published. Producing a different seed that fits requires inverting SHA-256. The whole sequence is nailed down before the first bet.
# 1. The commitment, the length and the rounds consumed
curl https://api.starfallxgames.com/fairness
# 2. The seed of a finished round
curl https://api.starfallxgames.com/fairness/42
For each round, check two things:
sha256(serverSeed_n) === serverSeedHash_n, and that value is the serverSeed of round n-1. Chaining backwards gets you to the commitment.HMAC-SHA256(serverSeed, "clientSeed:nonce") reproduces the published crash point.The game already performs check (1) in the browser, using Web Crypto.
GET /rounds returns the last 500 finished rounds with their seeds, so a player can verify any of them — not only the ones they happened to watch live. That endpoint is rate limited more tightly than the rest (12 requests a minute): it is the most expensive one on the server, not because the data is sensitive.
About gaps. If the server restarts mid-round, that seed was consumed but the round never got saved. /fairness/<n> reveals any finished seed so you can chain without breaks. The round in progress is never revealed: doing so would let anyone compute its crash point and cash out just before it busts.
| Who provides it | When it is fixed | |
|---|---|---|
serverSeed | The pre-committed chain | Before the very first bet |
| salt | A future Bitcoin block | When that block is mined |
clientSeed | The players in the round | When betting closes |
The client seed that gets stored is literally salt:playerContribution, with both halves in plain sight so anyone can see where each one came from.
When the chain is created, a block height that does not yet exist is declared (by default the current one + 2, roughly 20 minutes) and published alongside the commitment. When that block is mined, its hash becomes the salt for the whole chain.
That closes chain selection by cryptography rather than by trust: at the moment the commitment is published, that hash does not exist — not for the operator, not for anyone — so a thousand chains cannot be generated and the cheapest one kept.
It also covers a gap the player seeds leave open: in a round with no bets the contribution is sin-apuestas:<n>, a value the operator knows in advance. With the salt, those rounds cannot be cherry-picked either.
The game does not run without salt. While the block does not exist, rounds refuse to start and the server says so on every retry. That is deliberate: a round without salt would not carry the guarantee we advertise.
The client seed is the sha256 of the seeds of everyone who bet, sorted and deduplicated. Order matters: if they were concatenated in arrival order, the operator could change the result simply by delaying the processing of one bet.
Each player generates their own in the browser and it is stored for them, so they can write it down and check afterwards that it was included. If nobody bets in a round, sin-apuestas:<round> is used — deterministic, and with nobody to harm.
This is why the crash point is computed when betting CLOSES, not when it opens. Computing it earlier would make the player contribution pure decoration: the result would already have been decided.
With this, at the moment of publishing the commitment the operator does not know the seeds the players will bring, and therefore cannot compute any future result nor pick a chain that suits them.
An operator that withholds its reveal. Every bet commits to sha256(seed) while betting is open, and the seed itself only arrives once betting has closed. That removes the unbounded version of the attack: at the moment of committing, an operator sees other people's hashes and nothing else, and a hash lets it evaluate nothing. There is no outcome to try seeds against.
What it does not remove is one bit. An operator running the server watches the reveals arrive, and still chooses one thing last: whether to reveal its own seed or stay quiet. A bet that does not reveal contributes its commitment instead of its seed, so those are two different rounds and it can take the one it prefers. One bit per betting account; 2^k with k accounts.
Why a non-revealer contributes its commitment rather than nothing. Dropping it would be worse. The operator would then be choosing between "my seed counts" and "my seed does not count" at no cost, and an honest player whose connection dropped would silently lose their influence over a round they had paid to enter. Falling back to the commitment at least fixes the value at commit time.
Why the last bit cannot be closed. Any input the operator supplies after seeing the others is grindable, and on its own server the operator can always move last. Removing it would need reveals that are simultaneous and enforceable, and a server cannot enforce that against itself. What is genuinely out of its reach are the inputs fixed before it could see anything: the pre-committed chain and the Bitcoin salt.
What using the bit costs. Every commitment is public in the round's bet list from the moment the bet is placed, and the round record stores each commitment next to whatever it revealed. An account that commits and then repeatedly goes quiet is visible in the history — and it is precisely the pattern a lab audit looks for.
A player cannot do any of this. Individual seeds are never published before the crash point is fixed; what gets published is the combined client seed, once the round is already running. With no access to anyone else's seed there is nothing to evaluate, so for anyone not running the server the attack is closed outright.
Honest summary: chain + Bitcoin salt make it impossible to choose results in advance. Commit-reveal takes the operator's remaining move from unbounded seed grinding down to a single bit per account, closes it outright against players, and leaves that bit recorded in the history instead of hidden.
| Generate a chain | npm run chain:new |
| Secret | CHAIN_SECRET in the environment — never in the repository. Any string of 16+ characters works: the root is derived with sha256, so on Render it is Render that generates it (generateValue) and the secret never passes through a terminal or a clipboard |
| Length | CHAIN_LENGTH, 250,000 by default (~43 days at 15 s per round) |
| Status | GET /fairness (includes the salt's height and hash) |
| Salt margin | CHAIN_SALT_MARGIN, 2 blocks by default. 0 voids the guarantee and startup aborts in production |
| Rotate | POST /operator/rotate-chain with the header x-operator-key: ADMIN_KEY |
Each chain is an epoch of the same CHAIN_SECRET: the root comes from sha256(secret:epoch). Rotating requires neither touching the secret nor restarting — which is precisely the manoeuvre where a mistake used to break verification of everything already played.
Rotation is not applied when requested but when the next round starts: switching chains mid-round would leave that round played with a seed that no longer chains to the published commitment. On starting a new epoch:
/rounds history starts from zero, because it is scoped to the current chain so that two rounds never show the same number.When a chain runs out (~43 days) rotation is automatic: previously the game stopped dead and asked for manual intervention.
Publish the commitment with a timestamp — a tweet, the README, the site itself — before opening the game. That timestamp is what proves the sequence was fixed in advance; without it the scheme is cryptographically sound but proves nothing to a third party.
Rules that startup enforces on its own:
CHAIN_SECRET, the server does not start.