# How FairLock cryptographic verification works

Category: [FairLock & Compliance](https://basecomp.io/help/transparency)
Updated: 2026-10-26

> FairLock seals instant win positions and the grand prize method before sales, then reveals everything after the draw so anyone can check nothing changed.

FairLock is Basecomp's system for proving that every draw is fair. Before a competition opens, the instant win positions are generated at random and sealed, so nobody knows which tickets will win them; the method for picking the grand prize winner is sealed too, but the winner cannot be known until the competition closes. After the draw everything is revealed, and anyone can check it matches what was sealed.

FairLock runs automatically on every competition you publish. There is nothing to switch on.

### When you publish

When you publish a competition, Basecomp:

- Picks a random ticket number for every instant win, across all the competition's tickets, using a cryptographically secure random number generator, and encrypts each one.

- If the competition has a grand prize, generates a random 128-bit seed, encrypts it, and publishes only its hash, SHA256(salt:seed) .

- Calculates a SHA-256 commitment hash over the instant win positions (with the prize at each), the seed's hash, the public random number source the grand prize will use, a salt and the competition ID.

- Publishes that hash on the competition's Verify page and sends it to OpenTimestamps, which records it in a Bitcoin block, usually within a few hours.

From then on, changing any position, prize or the seed would produce a different hash, and the change would be detectable. The OpenTimestamps receipt proves the hash existed at that time, without relying on Basecomp's own clock.

### During ticket sales

The positions and the seed stay encrypted for the whole sale. Instant win detection uses a keyed HMAC lookup that recognises a winning ticket at purchase without decrypting anything or revealing any other position. Neither you nor your customers can see which positions are winners. A win is found when the ticket is bought and shown to the customer when they reveal it.

Ticket numbers shown to customers are a scrambled one-to-one mapping of the underlying draw positions, so sales volume cannot be read off the numbers while tickets are on sale. The mapping is revealed after the draw.

### The draw

When the competition closes, FairLock waits until the ticket list is final: the latest of the closing time plus a 12-minute settlement window (so a checkout started just before the close can finish), the last ticket issued, and the last checkout hold expiring, plus a one-minute margin. It then takes the first random number published by drand after that moment. drand is a public randomness service run by independent organisations including Cloudflare, and every number is checked against drand's public key before it is used.

The seed is decrypted and combined with that number using SHA-256, and the result is divided by the number of valid tickets (refunded and voided tickets are excluded). The remainder says how far along the list of valid tickets, in draw-position order, the winner sits. Because the public number did not exist while tickets could still be bought, nobody, Basecomp included, could know the winner in advance.

The draw runs once. The commitment cannot be regenerated once a ticket has sold, and the drand round is recorded before its number is fetched, so a retried draw always uses the same round. Competitions published before 12 October 2026 used the seed alone.

Competitions with only instant wins have no seed and no grand prize draw: everything is decided by the sealed positions.

### Independent verification

Each competition has a Verify page. After the draw it opens with the winner and the winning ticket, shows a signed-in player every ticket they held in that draw and whether any of them won, and then lists the fairness checks in plain words: the rules were sealed before sales, every ticket had the same chance, and (when the competition had them) the grand prize number and the instant wins all match what was sealed. A check only shows as Passed when the published proof proves it, and a competition without instant wins never mentions them. Visitors who are not signed in see your next competition to close.

Behind the Verification Proof button is the full technical proof: the commitment hash and its timestamp, every instant win position (claimed and unclaimed), the seed and its salt, the drand round and its random number, the winner calculation, the ticket number mapping, and the full input string behind the commitment hash. Anyone can hash that input with any SHA-256 tool and check it equals the hash published before sales, or press Run the checks to have their own browser redo the maths. Before the draw, the page shows the sealed hash and its timestamp, and the remaining checks wait for the close.

See [Reading the commitment hash proof](https://basecomp.io/help/transparency/reading-the-commitment-hash-proof) for the steps, or [How FairLock Works](https://basecomp.io/blog/knowledge/how-fairlock-works) for the full technical explanation.

### The Basecomp Verified badge and what you can say

The **Basecomp Verified** badge in your footer means your competitions run on FairLock: the instant win positions and the draw method are sealed with a public commitment hash before sales open, the main prize uses a public drand random number published after sales close, and the full proof is published after the draw so anyone can check it. The badge links to [basecomp.io/fairlock](https://basecomp.io/fairlock), which explains this to your players.

- **"Provably fair draws"**: accurate, and it is the wording the badge itself uses. "Provably" means anyone can verify the result from the published proof without trusting you or us.

- **"Independently verified" or "audited"**: do not say this. The proof can be checked by anyone, but Basecomp's random number generation has not yet been certified by an independent testing lab. We will update this page when it is.

- Do not say winners are "predetermined" or "locked in" before sales. Only the method and the instant win positions are sealed; the main prize winner cannot be known until the competition closes.

### See also

- [Reading the commitment hash proof](https://basecomp.io/help/transparency/reading-the-commitment-hash-proof)

- [Setting up instant win prizes](https://basecomp.io/help/prizes-and-winners/setting-up-instant-win-prizes)

- [Scheduling draws: automated vs live](https://basecomp.io/help/competitions/scheduling-draws-automated-vs-live)
