Fair play

How a winner is picked, how to check it, and what organisers need to know.

The short version

The finishing order is drawn and sealed before any duck moves. The race you watch is an animation of that sealed result. After the finish, the result and a secret key are revealed so anyone can prove it wasn't changed.

Step by step

1. The entry list is locked

When you start a race, the entries are numbered 1 to N in the order you gave them. A fingerprint of the list (its SHA-256 hash) is recorded, so the list can't be edited afterwards.

2. The finishing order is drawn

The whole finishing order, from winner to last place, is drawn with a cryptographically secure random number generator (crypto.getRandomValues) using an unbiased Fisher–Yates shuffle. Every entry has exactly the same chance of every position. In the live service this happens on our server; in the current test version it happens in your browser.

3. The result is sealed

A random 32-byte secret key (the "salt") is generated, and the seal is calculated as the SHA-256 hash of the race ID, the time the entries were locked, the entry-list fingerprint, the race settings, the finishing order and the salt. The seal is shown before the race starts. The order and salt stay secret.

4. The race is animated to the sealed order

The race planner works backwards from the sealed order to make an exciting race that lands on it exactly: overtakes, power-ups and a photo finish. Things that don't affect the result (the starting grid, each duck's look, the power-ups and the camera) come from a separate seed derived from the salt.

For big fields, knockout gates keep the top 10% of the field each time, until about 10 finalists are left. Who goes through is decided by the sealed order, so a duck's chance of winning is the same as in a single straight draw.

5. The result is revealed

After the finish, the order and the salt are published with the race record. If a race is abandoned part-way, its result is still revealed and recorded; a race can't be re-run to get a different winner.

Check a race yourself

Press Verify result under any finished race, or open its replay link and check the banner. The check confirms that:

You don't have to trust our button: Copy record gives you the full record as JSON, and you can recompute the SHA-256 seal with any independent tool. The seal is the hash of these values joined with a vertical bar: raceId|lockedAt|entryListHash|settings|order|salt, where settings is the settings object as canonical JSON (keys sorted) and order is the entry numbers joined with commas.

For organisers of draws and competitions

This is general information, not legal advice. Rules depend on where you are and how your promotion works.

Duck Racers picks winners fairly, but you're responsible for making sure your draw, giveaway or competition is lawful and run in line with its own terms. In Great Britain, for example:

The Gambling Commission publishes guidance on lotteries, prize draws and competitions. If you're unsure, take advice before you take money.

Entrants' names

The race record contains the entry list, because that's what makes the result checkable. Anyone with a replay link can see the names. If that matters for your draw, use first names, initials or ticket numbers.