Drawing a winner with the blockchain

Mike D'Argenio
boxswap
2 min readFeb 24, 2019

--

BoxSwap will be using the blockchain to perform all giveaway drawings moving forward. By doing this, we offer transparency in the selection process.

How we choose a winner transparently and fairly

The selection of a winner will be composed of a 3 step process…

1. A list of all players will be created and posted at the end of the entry period with the number of the entry block.

Our entry block is chosen as the last mined block when we publish the list to our #raffle channel. This block number will be posted with the list of all entrants.

2. Wait for drawing block, 100 blocks after the entry block, to be mined.

The drawing block is chosen by taking number of the entry block and adding 100 to that number.

3. Calculate the winner index using the drawing block hash number.

To choose the winner, we will use https://www.rapidtables.com/convert/number/hex-to-decimal.html to convert the block hash into a decimal, which we will then use with a process called the modulo operation. We use the last nine digits of the decimal and divide by the number of entrants to get a remainder, our index. This index number is the position of the winner in the list of entrants published at the end of entry period.

Announcing the winner

After we have determined a winner, we will publicly post his/her name into our discord to allow them to claim their prize. They will be given the option to choose any of the three rewards listed. The winner will have approximately 36 hours to claim the prize before we choose a new winner.

The second drawing will use the last mined block at the end of the previous claim period. The second claim period will be reduced to 24 hours and the process will be cycled until someone claims the reward.

Remember to enter our weekly raffle using SwapBot in our discord!!

Follow us on Twitter: https://twitter.com/boxswapio
Join us on Discord: https://discord.gg/mdAZ7ef

--

--