Anyza Club
CreateSign in

← Bitcoin hash-based giveaway system

How the Bitcoin hash giveaway works

A truly fair giveaway doesn’t ask you to trust anyone. Here is the whole mechanism — what happens, in what order and the exact math — for anyone to check.

Run a free giveaway
Anyza mascot with the giveaway globe and a bitcoin coin

Step 1

The list is frozen

Step 2

We pick a Bitcoin block that doesn’t exist yet

Step 3

The math decides the winners

1. The list is frozen

When the organizer clicks “Draw”, the names are stored exactly in the order they were pasted, one per line: #1, #2, #3…

At the same moment we calculate the list’s fingerprint (SHA-256). Changing a single letter in a name changes the whole fingerprint — that’s why it appears on the page: any later change would be obvious.

The fingerprint is also recorded on Bitcoin by OpenTimestamps. The .ots file is the proof that this exact list already existed at that moment.

2. We pick a Bitcoin block that doesn’t exist yet

At freezing, we look at the network’s latest block (the tip) and fix block tip + 2 as the one that will decide the result.

A block’s hash is unpredictable: thousands of miners around the world compete to create it, spending real energy. Nobody — not the organizer, not Anyza — knows the hash before the block comes out.

We wait for the chosen block to come out and one more on top of it, to confirm. On average this takes 20 to 30 minutes.

3. The math decides the winners

With the block hash in hand, each winner comes from a simple calculation, the same for everyone:

  1. Build the text: block hash + “:” + giveaway code + “:” + k (k = 1 for the 1st winner, 2 for the 2nd…).
  2. Calculate the SHA-256 of that text and take the first 15 characters — it’s a number in hexadecimal.
  3. Divide that number by the number of names still on the list; the remainder is the position (remainder 0 = the first).
  4. The name at that position wins and leaves the list — so nobody wins twice. Repeat for the next k.
position = int( sha256(“block_hash:giveaway_id:k”)[0:15], 16 ) mod N

An example with real numbers

A real Bitcoin block, a sample giveaway code and a list of 40 names:

Block hash

00000000000000000000ba717add9e9ca88219ed055ab6a33fcb5a4a229036ef

Giveaway code

5c033623-67a6-4a4c-bd5b-1d0721e0b6e6

1st winner (k = 1, 40 names)

sha256("…a229036ef:5c03…b6e6:1")

→ 3c13c940ddd9060 → 270564059204391008

→ 270564059204391008 mod 40 = 8

Remainder 8 → position 8 counting from zero = entry #9 on the list wins.

2nd winner (k = 2, 39 names left)

sha256("…a229036ef:5c03…b6e6:2")

→ 0e74889ef2fd4a9 → 65100476880770217

→ 65100476880770217 mod 39 = 3

Remainder 3 in the list of 39 that remained → whoever is at that position wins.

Each giveaway’s code is different: the same block produces different results in different giveaways — and nobody picks the code after seeing the block, because it’s created at freezing.

The timeline that proves the order

Each giveaway’s page shows four moments, with date and time:

  1. List frozen and hash saved

    The names and the fingerprint are fixed — before the deciding block exists.

  2. List recorded on Bitcoin

    OpenTimestamps writes the fingerprint into a block: independent proof that the list already existed.

  3. The deciding block is mined

    Minutes later, the chosen block comes out, with the time recorded in the block itself.

  4. Result calculated

    With the block hash, the math points to the winners — always the same for anyone who redoes it.

If the list were changed after the block, the fingerprint wouldn’t match the one recorded on Bitcoin. If the block already existed before the list, the height would give it away: it was chosen as tip + 2 at freezing.

How anyone can check

  • Redo the math

    On the giveaway page, the “Redo the math here” button calculates everything in your browser: the list’s fingerprint and each winner.

  • Check the block

    The block’s hash and time are public on any Bitcoin explorer, such as mempool.space.

  • Upload the .ots file

    The “Upload the .ots file” button (or opentimestamps.org) checks which block the list was recorded in.

Automatic giveaways in Anyza Club communities

In communities, the math is the same — the list is the participants who met the rules (members, subscribers, those who attended the event, completed the lesson or made a post), frozen at closing. Two modes:

  • Fast mode: block tip + 2 at closing, as in the public giveaway.
  • Maximum proof: the first block after the list’s Bitcoin record is confirmed — the list provably existed before the deciding block.
Create my community for free

Frequently asked questions

Can the next block’s hash be predicted?

No. The hash depends on transactions and on a number that miners search for by trial and error, billions of times per second. If it were predictable, Bitcoin mining wouldn’t work.

Can Anyza or the organizer cheat?

Not without leaving a trace. The list and fingerprint are fixed before the block, the block is chosen at the same moment and the math is public. Any change would make the fingerprint or the result fail the check.

What if someone runs several giveaways until the result they want comes out?

Each giveaway has its own page and link, with the creation date. That’s why the organizer should publish the link before the result: a giveaway that wasn’t announced beforehand proves nothing.

What if the Bitcoin network reorganizes the block?

We wait for one confirmation (a block on top) before drawing. Two-block reorganizations are extremely rare; and the hash used is recorded on the page, so the math can always be redone.

Does the remainder favor anyone?

In practice, no. The 15 characters form a number of up to 60 bits; with up to 5,000 names, the difference in chance between positions is less than one in a trillion.

Does the order of the names change anything?

The order is fixed at freezing and is part of the fingerprint. Since the block hash is unpredictable, no position has an advantage.

Ready to run yours?

Free, no sign-up, with a link to share and the result by email.

Run a free giveaway

Trending communities on Anyza Club

See all

Upcoming events on Anyza Events

See all

New on Anyza Market — pay in crypto

See all

More free tools from Anyza

Anyza Classificados

Classifieds for people who pay in crypto

Cars, watches, bikes, apartments, services — verified sellers and prices in stablecoin, deal closed between you and the other person.

Open the Classifieds
Anyza Radar

Where bitcoin is already accepted

A map of shops, cafés and services that accept bitcoin, in 11 languages — built from BTC Map and OpenStreetMap.

Open the Radar
Anyza Events

Tickets with QR codes and door check-in

Meetups, conferences and online events. Buyers pay the organizer; the door works offline on any phone.

Open Events