Provably Fair Giveaways: How to Run a Draw Anyone Can Verify
Run provably fair giveaways in three moves: hash the entrant list, commit to a future drand round, and pick the winner with a formula anyone can rerun.
Updated November 2, 2026
- 33,987,412
- The drand quicknet round used for the example draw
- 3 seconds
- Between two drand quicknet rounds
- 1,200
- Quicknet rounds in one hour
Twelve example entrants, one prize, and the formula picks lumen.ash. You can recompute that yourself in about a minute without trusting us, because the list, the random value and the formula are all on this page. In a real draw they would also be published before anyone could know the result. That is what a provably fair giveaway is: a draw where every step is published, in the right order, so anyone can rerun it and land on the same name.
The method needs no special platform. You need a list, SHA-256, a public random value from a beacon, and a formula you announce in advance. The rest of this page walks through one complete draw with real values.
What do you publish, and when?
Order matters more than any single step. If you publish something after the random value is known, you could have tried variations until one gave the winner you wanted. So the sequence runs like this:
- Close entries and freeze the list. Decide the exact text format: one entry per line, a fixed order, UTF-8, no trailing newline.
- Publish the list and its SHA-256 hash.
- In the same post, name the random source precisely: the beacon, the chain and the round number, plus a fallback if that round is missing.
- Publish the formula that turns the list hash and the random value into a winner index.
- Wait for the round, then compute and announce the result with every input attached.
Steps 2 to 4 together form the commitment. The underlying idea, fixing a value by publishing its fingerprint first, is the same one provably fair games use, explained under commit-reveal schemes.
Which random value should you commit to?
One that does not exist yet and that you cannot influence. A public randomness beacon fits. We used drand's quicknet chain, which publishes a new round every 3 seconds from a network of independent operators, each round signed with a threshold BLS signature. The random value is the SHA-256 hash of that signature, so anyone can check it.
Quicknet started at Unix time 1,692,803,367, and round r is published at that time plus 3 × (r − 1) seconds. That lets you pick a round for a specific moment. For this example we chose round 33,987,412, which falls at 18:00:00 UTC on November 15, 2026. A real draw would publish that round number before that moment; ours is reconstructed after the fact for illustration, so treat it as a demonstration of the arithmetic, not as a committed draw.
The overview of provably fair draws compares drand with the NIST Randomness Beacon, which works on the same principle with one pulse about every minute.
How does the formula pick a winner?
Our formula hashes three things together, the list hash, the beacon value and a winner counter k, then reads the result as one large number and takes the remainder after dividing by the number of entrants. The remainder is a position in the list, counting from 0.
list hash = SHA-256(entries joined by "\n")
h = SHA-256(list hash + ":" + beacon randomness + ":" + k)
winner = entries[ h as a 256-bit integer mod N ] (k = 1 for the first winner)
Including the list hash in the formula ties the result to the exact list. Including k lets you draw a second or third winner from the same round without reusing the same number.
The remainder step is where small random ranges cause bias, as dice and roulette designers know. Here it is harmless: h is a 256-bit number, so the difference between the most and least likely entrant is at most one value in about 2256 ÷ N, which for any realistic giveaway is far beyond anything measurable.
The worked draw, value by value
The twelve entrants, in the published order:
Swipe the table
| Index | Entrant | Index | Entrant |
|---|---|---|---|
| 0 | amber.fox | 6 | gus_the_cat |
| 1 | bluejay_42 | 7 | harbor.lights |
| 2 | cedar-lane | 8 | ivy_marsh |
| 3 | delta.rose | 9 | juniper.k |
| 4 | echo_park | 10 | kite_runner9 |
| 5 | fern.and.co | 11 | lumen.ash |
Joined with newlines and hashed, the list gives:
list hash = b8bf4838051d14afff1553836074ce858cefcc1a020eb5b1467d005af7a30d8b
drand quicknet round 33,987,412 has this randomness value, returned identically by two separate public relays when we fetched it:
randomness = e4ae0b153d6c867b5df42652b236606b08f545762529f21b041d480c9c351db6
Plugging both into the formula with k = 1:
h (k = 1) = 4b4aff44d12ef87edaaf7aad96b1eff3a7187c590f1a4062df270569f997f3ff
h mod 12 = 11 → lumen.ash
h (k = 2) = 7d637065f4576c9d273a599df12ebe5572d850df3a67c0d190e9de10b3900589
h mod 12 = 1 → bluejay_42 (runner-up)
Here is the whole computation in Node.js, using only the built-in crypto module. Save it as a file ending in .mjs and run it with node to get the same lines:
import { createHash } from 'node:crypto';
const sha256 = (s) => createHash('sha256').update(s, 'utf8').digest('hex');
const entrants = ['amber.fox', 'bluejay_42', 'cedar-lane', 'delta.rose', 'echo_park', 'fern.and.co',
'gus_the_cat', 'harbor.lights', 'ivy_marsh', 'juniper.k', 'kite_runner9', 'lumen.ash'];
const listHash = sha256(entrants.join('\n'));
const randomness = 'e4ae0b153d6c867b5df42652b236606b08f545762529f21b041d480c9c351db6'; // drand quicknet round 33987412
for (const k of [1, 2]) {
const h = sha256(`${listHash}:${randomness}:${k}`);
const index = Number(BigInt('0x' + h) % BigInt(entrants.length));
console.log(k, h, index, entrants[index]);
}
Can you keep entrant names private?
Sometimes you should. A list of email addresses has no business on a public post, and even usernames can be sensitive. The commitment still works if each line of the list is a fingerprint instead of a name.
One way is to give every entrant a ticket number and a random salt when they enter, and put SHA-256(salt + ":" + handle) on each line instead of the handle. Each entrant can recompute their own line and confirm it is in the published list, while nobody else can read who is on it. The draw formula runs on the list of fingerprints exactly as before, and the winning line points to one ticket. The winner proves it is theirs by revealing their salt.
The trade-off is that outsiders can no longer count duplicate entries by eye. If the eligibility rules matter, say one entry per person, someone trusted still has to check the plain list, and you should say who.
Where should the commitment be posted?
Somewhere with a timestamp you do not control. A post on a public social account, a commit to a public code repository, or an email to all entrants each leave a time record that is hard to backdate. Editing the post afterward should be visible, so a platform that shows edit history is better than one that does not. Post the round number with plenty of margin: at quicknet's 3-second pace, a round chosen an hour ahead is still 1,200 rounds away.
What happens if someone edits the list?
The winner changes, and nobody can predict to whom. Remove gus_the_cat and rerun the same formula with the same beacon value: the list hash becomes 9789e9e1…f253, the remainder of h divided by 11 is 7, and the winner is ivy_marsh. An organizer who wanted a particular winner would have to guess, before the beacon round, which edit would produce them, and the beacon value is exactly the thing they cannot know.
Formatting counts just as much as content. Adding a single trailing newline to the same twelve names produces the hash 8568b5f2…77d7 instead of b8bf4838…0d8b. That is why step 1 above fixes the text format, and why the published list should be the exact bytes that were hashed. How SHA-256 hashing works shows why one byte changes the whole fingerprint.
What should a checker look at first?
Anyone verifying the draw needs four things: the published list, its hash, the beacon round and the formula. Hash the list and compare. Fetch the round from a beacon relay and compare its randomness value with the one in the announcement; for drand you can also check the signature against the chain's public key. Then run the formula.
The step people skip is the timestamps. A perfect calculation proves nothing if the list and the round number were posted after the round appeared, so look at when the commitment went up, preferably on a platform that shows edit history. A draw can also be technically clean and still unfair upstream, through duplicate accounts or a list that quietly left people out; the limits of provably fair apply here too.
Sources
References behind this guide.
6 references
- 01 drand public API, quicknet chain info (opens in a new tab)
- 02 drand public API, quicknet round 33987412 (opens in a new tab)
- 03 drand documentation, Cryptography (opens in a new tab)
- 04 NIST CSRC, Interoperable Randomness Beacons project (opens in a new tab)
- 05 NIST FIPS 180-4, Secure Hash Standard (opens in a new tab)
- 06 Node.js documentation, crypto module (opens in a new tab)
Keep reading
- Fair draws Fair Draws Commit-reveal and public beacons such as drand and the NIST beacon make a verifiable random draw possible, so raffle and giveaway winners can be checked. Read guide
- How it works Commit-Reveal How the commit-reveal scheme behind provably fair games works: the sealed-envelope idea, publishing the seed hash first, rotation, reveal and hash chains. Read guide
- How it works SHA-256 and HMAC How SHA-256 and HMAC-SHA256 work in provably fair games: fixed 64-character hashes, preimage resistance, the avalanche effect and why the seed is the key. Read guide