Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: SlickTheNick on February 01, 2013, 03:48:49 PM



Title: What is a good, solid way to make a betting game provably fair?
Post by: SlickTheNick on February 01, 2013, 03:48:49 PM
I see serveral BTC gambling sites are "provably fair". What is a good method for making a provably fair/trustworthy system for a simple betting game?


Title: Re: What is a good, solid way to make a betting game provably fair?
Post by: markm on February 01, 2013, 06:42:37 PM
The way they do it seems to be working fine, do you see any problems with it?

-MarkM-


Title: Re: What is a good, solid way to make a betting game provably fair?
Post by: FreeMoney on February 02, 2013, 12:30:48 AM
MyriadCoins uses a salt, timestamp and hash to commit to our guess when the player arrives, lets the player enter their own guess and a win or loss is determined by the distance between the guesses.


Title: Re: What is a good, solid way to make a betting game provably fair?
Post by: SlickTheNick on February 02, 2013, 02:26:14 AM
The way they do it seems to be working fine, do you see any problems with it?

-MarkM-

No, im just mostly interested in hearing peoples thoughts/ideas.

Quote
MyriadCoins uses a salt, timestamp and hash to commit to our guess when the player arrives, lets the player enter their own guess and a win or loss is determined by the distance between the guesses.

Thats cool, is that what the hash displayed at the bottom of the page is?


Title: Re: What is a good, solid way to make a betting game provably fair?
Post by: PrintCoins on February 02, 2013, 03:59:55 AM
When you "roll" you could use the current value of the s&p, an image of a tree in your back yard blowing in the wind or the static in the radio as a seed for random function and present it as something indepentently verifyable. Just be sure you have the most up to date seed otherwise your users might scoop you.


Title: Re: What is a good, solid way to make a betting game provably fair?
Post by: paybitcoin on February 02, 2013, 05:56:13 AM
When you "roll" you could use the current value of the s&p, an image of a tree in your back yard blowing in the wind or the static in the radio as a seed for random function and present it as something indepentently verifyable. Just be sure you have the most up to date seed otherwise your users might scoop you.
Depending on how you implement it, a tree blowing in the wind or radio static is not necessarily independently verifiable, since you'd have no way of knowing whether the site operator is reusing tree images or creating their own special winning static.

Basically, start off with some random data, hash it, and publish those hashes ahead of time in public (like the blockchain, or in the page itself like MyriadCoins.) Then use the random data and bet data (optional) as inputs to a cryptographically-strong hash during the game to get a randomly distributed output. Release the random data after some period of time after the game, so users can verify it.

The strength of this comes from the strength of the hash functions used (very good assuming lots of entropy in the random data) and the security of the random data up to the point where it is used (depends on your development skills, and hax0rs.)

Also, if you haven't yet, read up on how SatoshiDice implements the verification - it is a good writeup.

If you are talking about other games, like proving a sports bet was paid out fairly, that's a whole other topic...