ГСЧ randomness lab

Giveaways

Fair prize draw

The secret and the public hash before the draw — the result cannot be resubmitted unnoticed.

instant computed locally commit-reveal up to 20 winners
Step 1 · Publish the hash the secret is not created

The website generates a random secret of 16 bytes (32 hex characters) and shows its SHA-256. The hash is a promise: the secret can no longer be replaced unnoticed. Publish the hash before the start of application acceptance — in a channel, chat, or post.

commit
SHA-256 of the secret — published before the start —
Hash has not been created yet: click 'Create secret and publish hash'.
The secret is stored only in your browser (localStorage). You can close the page and return later: the hash and the secret will remain in place.
Step 2 · Draw and reveal source of entropy —
Fill in the list of participants and click 'Conduct the draw'
How is this checked? commit → list → reveal
  1. 1
    Commit — hash before start

    The organizer publishes the SHA-256 of the secret. As long as the secret is hidden, it is impossible to find it to match the desired hash: SHA-256 is irreversible.

  2. 2
    List of participants

    The list is recorded openly, one name per line. The line number is included in the formula, so the order must be the same during verification.

  3. 3
    Reveal — secret after

    After receiving the entries, the secret is revealed. Any participant can check its hash and recalculate the winners on the 'Draw Verification' page.

Formula h = SHA-256(secret + ":" + (index + 1) + ":" + name)
Nothing is sent to the server: the secret, the list, and the hashes are computed locally in the browser via WebCrypto. How the generator works.

Why the draw is fair

An ordinary random number generator lacks one main thing — proof. The result is only visible after pressing the button, and no one can confirm that it wasn't recalculated. The commit-reveal scheme solves this with two publications: a hash before the draw and a secret after it.

As long as the hash is published and the secret is hidden, the organizer is bound by a promise: it is impossible to come up with another secret with the same SHA-256. After the secret is revealed, any participant recalculates the winners using the open formula and makes sure that they match.

What is commit-reveal

Commit — obligation. A random secret is converted into a SHA-256 hash and published before the start. Reveal — reveal: after the draw, the secret is shown to everyone, and the hash can be checked with a regular SHA-256 calculator.

A hash is a 'fingerprint' of data: the same string always gives the same result, and any change, even one character, completely changes it. Therefore, a secret substitution is immediately noticeable: the SHA-256 of the new secret will no longer match the published one.

How to check the result in a minute

  1. Copy the secret from the giveaway protocol.
  2. Open the page giveaway checks.
  3. Insert the secret and the list of participants in the same order as in the protocol.
  4. Specify the number of winners and click 'Check'.
  5. Compare the winners and the secret hash with those published.

What the scheme does not guarantee

  • It does not protect against tampering with the list of participants: the list must be published before the secret is revealed.
  • It does not record the time of the hash publication — for this, an independent trace is needed: a post in a channel, a screenshot, an archived copy.
  • She does not run a lottery: tickets are not sold, the prize fund is not formed from contributions.
Frequently Asked Questions
Is it possible to forge the result?
No, if the hash was published before the draw. To 'resubmit' the result, a different secret is needed, and its SHA-256 will not match the published one. It is computationally impossible to pick a secret to match an existing hash.
Why publish the hash instead of the secret?
A hash is a commitment without disclosure. If you publish the secret in advance, you could count the winners and adjust the list of participants. A hash eliminates this possibility.
How many participants are supported?
Up to 2000 lines in the list and up to 20 winners per drawing. Each line is one participant; empty lines are ignored.
What will happen if there are fewer participants than prizes?
The number of winners will automatically be limited by the number of participants, and any extra prize names will remain unused.
Can we hold the drawing later?
Yes. The secret and the hash are saved in the browser's localStorage. If you return to the page, the hash will remain the same — the draw can be held on another day without breaking the commitment.
Is registration required and is data sent to the server?
No. Everything is calculated locally: the secret is generated by the browser's CSPRNG, SHA-256 is calculated by WebCrypto. Neither the list nor the secret goes to the server.
Is this a lottery?
No. This is a tool for randomly selecting winners. The organizer is responsible for complying with Federal Law No. 138-FZ 'On Lotteries' and Federal Law No. 38-FZ 'On Advertising'; the lottery website does not conduct the lottery, does not accept bets, and does not pay out prizes.
The hash only works if it was seen before the draw. Save the link to the post: without it, you won't be able to check the promised time.
↑↓ navigation Enter to open Esc close