Bitcoin Forum
May 09, 2024, 06:31:27 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Fair Randomization  (Read 723 times)
GueurK (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
May 30, 2013, 11: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 !!

"Bitcoin: mining our own business since 2009" -- Pieter Wuille
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715279487
Hero Member
*
Offline Offline

Posts: 1715279487

View Profile Personal Message (Offline)

Ignore
1715279487
Reply with quote  #2

1715279487
Report to moderator
1715279487
Hero Member
*
Offline Offline

Posts: 1715279487

View Profile Personal Message (Offline)

Ignore
1715279487
Reply with quote  #2

1715279487
Report to moderator
GueurK (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
May 30, 2013, 02:59:12 PM
 #2

I feel alone ^^
deslok
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250


It's all about the game, and how you play it


View Profile
May 30, 2013, 03:37:42 PM
 #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)

"If we don't hang together, by Heavens we shall hang separately." - Benjamin Franklin

If you found that funny or something i said useful i always appreciate spare change
1PczDQHfEj3dJgp6wN3CXPft1bGB23TzTM
grue
Legendary
*
Offline Offline

Activity: 2058
Merit: 1431



View Profile
May 30, 2013, 08: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.

It is pitch black. You are likely to be eaten by a grue.

Adblock for annoying signature ads | Enhanced Merit UI
GueurK (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
May 31, 2013, 11:50:24 AM
 #5

Thank's for your answers !
I'm gonna have a try.
I don't want to be accused of scam.

Razick
Legendary
*
Offline Offline

Activity: 1330
Merit: 1003


View Profile
May 31, 2013, 02:06:20 PM
 #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.

ACCOUNT RECOVERED 4/27/2020. Account was previously hacked sometime in 2017. Posts between 12/31/2016 and 4/27/2020 are NOT LEGITIMATE.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!