A draw by block, driven by the Bitcoin timechain. Version 1.0.0.
A single-file web page that picks giveaway winners from Bitcoin block hashes, so nobody has to trust the person running the draw. Vertical 1080×1920 stage, made for screen recording.
index.html: neutral version. The only thing to edit is theBRANDblock at the top of the script.quietkeys.html: same code, QuietKeys branding (the file used for QuietKeys draws).verify.py: recomputes the winners without the web page (Python 3, standard library only).example-entries.txt,example-excluded.txt: demo data.
No build step, no dependencies, fonts embedded. Open the HTML file in a browser.
- Before the draw, publish: the numbered list of participants, the excluded accounts, the number of winners, and the block heights that will decide (H, H+1, H+2). Heights must be in the future when you publish.
- Wait until the blocks are mined (and confirmed).
- Take each block hash as shown by block explorers (64 hex characters, leading zeros included).
- Winner 1:
int(hash_H, 16) mod N, where N is the number of participants. The resultris a zero-based position in the list: winner = entry numberr + 1. - Winner 2 and 3: remove the previous winner from the list, keep the order, renumber, and apply the same formula with the hash of H+1, then H+2.
- Participants are normalized: leading
@added, duplicates removed (case-insensitive, first occurrence kept), excluded accounts removed before numbering.
Why it is fair: the hash of a block that does not exist yet cannot be known or chosen by anyone, including the organizer, and the list is frozen before it exists. Anyone can recompute the result.
python3 verify.py --entries entries.txt --exclude excluded.txt --hashes HASH_H HASH_H1 HASH_H2
Check the hashes on any block explorer (mempool.space, blockstream.info) with the announced heights. Demo with the three first Bitcoin blocks:
python3 verify.py --entries example-entries.txt --exclude example-excluded.txt --hashes \
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f \
00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048 \
000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd
Expected: @judy_pgp, @frank_hodl, @dave_multisig.
C: config panel.→/ space: next step.←: back.F: fullscreen. Close the config panel before recording.- Paste participants, excluded accounts and the height H. "Fetch hashes" asks mempool.space (fallback blockstream.info) from your browser, so those services see your IP address. To avoid that call, paste the three hashes by hand.
- "Load DEMO" fills the form with the genesis blocks and fake names. Never use it for a real draw.
- The name roulette on the winner screens is cosmetic. The result is fixed by the hash.
Winners are drawn from the numbered list above (published before the draw, N entries). Blocks H, H+1, H+2 decide winners 1, 2, 3. Winner k is entry number (int(block hash, 16) mod remaining entries) + 1, in the list with previous winners removed and renumbered. Verify with the open-source script: . SHA-256 of the page used: .
Publish the SHA-256 of the exact HTML file you film, and tag a release of the repository before the draw.
- Fairness depends on publishing the list and the heights before the block is mined. The page cannot enforce that.
- Wait for confirmations: a block can be replaced in a rare chain reorganization.
- Entries are only as honest as the list you publish (bots, duplicate accounts). Handle eligibility rules in your announcement.
Code: MIT (see LICENSE). Fonts: EB Garamond and JetBrains Mono, SIL Open Font License 1.1 (see fonts-licenses/).
The names, signature and visual identity in quietkeys.html (QuietKeys, kavsec.agency, colors, tagline) are trademarks and brand assets of KAVSEC Agency LLC and are not covered by the MIT license. Use index.html and your own branding for your own draws.
1db5d80d8e900380159038d4d56e661198752736c41a47edf250901e2ed4ff7d index.html
940b3dd2b15224dbb731f8d4eea81e02dc2433f2252efdb29da44a9537dceca4 quietkeys.html
38ee8bc57152529825df635081f41953c17529f3c03c98890ba32784b182416a verify.py