Working on the ~AGORA [GIVEAWAY]s I thought it could be useful to have a tool to randomly pick winners for various types of events held here on SN. So here you go, a simple tool to give more transparency and credibility to bitcoin giveaways, raffles, tombolas, draws, and similar. It will simply help you randomly pick winners fairly.
How to useHow to use
- Bulk register unlimited participants (one per line)
- Randomly pick number of winners (max 210)
- Select future block number for the draw to be executed
- Get a sharable link to share results with all participants
- Have results easily verified, simply hit “Submit” to start the verification
- Save and share the results in a unique URL
Repo: https://github.com/4G0R4/giveaway/
Demo: https://4G0R4.github.io/giveaway/
Try it:
- Go to this link, it will load the data encrypted in the link
- click Submit button
- View who are the 3 picked random stackers from today top[1] excluding hiding stacker
Results should look like this:
How it worksHow it works
As the blockhash is just a number, its last 6 digits is converted to decimal using this function:
var decimal = parseInt(blockhash.slice(-6), 16);Now we have an integer (0 to 16777215) from the blockhash.
After dividing this decimal by the number of participants, we use the modulo operator (%) to get the division remainder becomes the index_number.
This index_number is applied in the participants' list, to get the position of the winner.
var index_number = decimal % participants.length;
var winner = participants[index_number];For additional winners, the past winners are removed from the list and one more digit is added from the blockhash. A maximum 210 was added to avoid working with big numbers.
@siggy47 @BlokchainB @ek @optimism @Undisciplined @Scoresby @SimpleStacker @grayruby @Public_N_M_E @stackingharder @lunin @Coinsreporter @billytheked @k00b @jakoyoh629 @Kayzone @cryotosensei @orto @freetx @kepford @denlillaapan @stack_harder @oliverweiss @Daedalus @OT @didiplaywell @plebpoet @realBitcoinDog @WeAreAllSatoshi @StillStackinAfterAllTheseYears @standard_sats @jbschirtzinger @bitcal @Bell_curve ↩
Can you do this on mobile?
Of course, the page is responsive and here's how it looks on mobile
Tested it and the winner is always first entry
The results are tied with the block number. If you don't like the results, you can change the order in the list of participants or select another block to change the entropy.
Can you share the link? (click Share button to generate the link) - So I can verify your setup
Cool! I like how you can share the configuration which lets you easily prove the result to anyone.
yes, that was the main goal, giving more transparency and credibility to giveaways here in SN, specially from honest newbies.
Giveaways can now have their results easily verified, thanks to bitcoin block hash, used to derive the winner(s).
Great work!! Thank you for sharing this :)