If I may answer with my stack overflow hat on...
Here's how I'd draw a random number in way that no participant can influence the result of.
Invite each player to pick a random number, x, and publish the hash(x). Once each hash has been published, each player should then reveal their x. With those x's, add them all together and hash the result. Use that final hash as the random value.
UPDATE: To work around the attack described in the comment below, use two rounds.
- Each player selects a randon number, x, and reveals hash(x).
- When all hashes have been revealed, each player reveals x.
- All x's are combined and hashed. y=hash(all x)
- Each player selects a new random number, z, and reveals hash(y+z).
- When all of the second round of hashes have been revealed, each player reveals z.
- All z's are combined and hashed. The result is used as the random value.
If the player has a prepared hash collision, they could only use it to select their prefered y value. This doesn't help because they would now need a way to find a collision where both inputs have the same prefix (y) which won't be known in advance. If you can do that in a timely manner, we all need a new hash function.
(I welcome comments. Its possible I've missed something else.)
1why off-topic? from the FAQ: " practical, answerable questions based on actual problems that you face". Seems pretty on-topic unless I am missing something. – browep – 2011-09-01T21:01:37.980
because it would be impractical to use Bitcoin for entropy in a gambling site. There are other easier ways to do this today. http://www.random.org/
– ripper234 – 2011-09-02T06:55:24.6671wouldn't "impractical" be up to me? The question is not about how to implement a gambling site, it's about using the blockchain as entropy. The use of it is irrelevant, it's still a valid question. And random.org doesn't solve all my problems. – browep – 2011-09-02T21:08:15.227
2This feels slightly off topic. – ripper234 – 2011-08-30T23:06:10.250
1
It may be a valid question, but it's not a particularly bitcoinish one--smells more like programming technique to me, which should go on Stack Overflow.
– eMansipater – 2011-09-06T20:23:10.237