Author

Topic: Fair Randomization (Read 737 times)

legendary
Activity: 1330
Merit: 1003
May 31, 2013, 09:06:20 AM
#6
Hi there,

I'm building a new Bitcoin lottery.
The rule is very simple :
_ At the end of the round one user is selected randomly to win the pot.

The question : I want to make a fair randomization, like in other gambling websites.

Can someone give me clues about it ?

Thank's a lot !!



For something like that the built in psuedo-random number generator in your programming language should be fine. If you are using PHP just use $winner = rand(1,$numberOfEntries);

Or if you want to be provably fair, generate the random number in advance and publish a hash of it. You can then announce the winning number after the drawing and any user can compare the hashes.
newbie
Activity: 14
Merit: 0
May 31, 2013, 06:50:24 AM
#5
Thank's for your answers !
I'm gonna have a try.
I don't want to be accused of scam.

legendary
Activity: 2058
Merit: 1452
May 30, 2013, 03:22:21 PM
#4
Take a random number (generated using any choice you want), and publish its hash (maybe padded with additional data to prevent guessing). Keep the random number a secret. at the time of drawing, take the hash of the latest block, and concatenate that with your secret number and take the hash of that. Use that hash to seed whatever PRNG you want to use. To allow auditing, publish the exact PRNG implementation you used and your secret (plus padding if any). Any user should be able to re-create the results.
sr. member
Activity: 462
Merit: 250
It's all about the game, and how you play it
May 30, 2013, 10:37:42 AM
#3
you'd need a random number generator in hardware to be truly random, however without one of those a pseudo random number generator(easy enough in most programing languages) would be sufficient as long as the input was from a source you didn't directly control (something pulled from the blockchain such as the number of a randomly selected block in the past week would work well)
newbie
Activity: 14
Merit: 0
May 30, 2013, 09:59:12 AM
#2
I feel alone ^^
newbie
Activity: 14
Merit: 0
May 30, 2013, 06:24:37 AM
#1
Hi there,

I'm building a new Bitcoin lottery.
The rule is very simple :
_ At the end of the round one user is selected randomly to win the pot.

The question : I want to make a fair randomization, like in other gambling websites.

Can someone give me clues about it ?

Thank's a lot !!

Jump to: