Author

Topic: How to make a provably fair coinflip site (Read 1073 times)

legendary
Activity: 1498
Merit: 1000
June 18, 2013, 08:31:21 PM
#9
I'm looking into making my own gaming site, does anyone know how to make a PROVABLY fair coinflip site?
Or would a random.org number generator suffice?

The only way to do this and prove fairness would be to present the user with two options A and B - one of them wins and one loses.

It would be difficult (or impossible) to prove fairness if they only had one button to choose from (such as "FLIP").

Generate a string, such as

A=WIN|B=LOSE--lots-of-random-characters-$*(#$*9*($#$
or
A=LOSE|B=WIN--lots-of-random-characters-$*(#$*9*($#$

Then show the user a sha256 hash of that string and let THEM decide which button to press, A or B.

After they have clicked a button, you can show them the secret string, and they can match it to the hash to prove fairness.


In PHP?

6BTC
hero member
Activity: 630
Merit: 500
In PHP?

Oh, you want us to develop the entire site for you? Smiley I think I gave you a good start.

PHP would be fine for writing the code.

You can use functions like mtrand() and hash().
sr. member
Activity: 476
Merit: 250
What do you call a fish with no eyes? A Fsh!
I'm looking into making my own gaming site, does anyone know how to make a PROVABLY fair coinflip site?
Or would a random.org number generator suffice?

The only way to do this and prove fairness would be to present the user with two options A and B - one of them wins and one loses.

It would be difficult (or impossible) to prove fairness if they only had one button to choose from (such as "FLIP").

Generate a string, such as

A=WIN|B=LOSE--lots-of-random-characters-$*(#$*9*($#$
or
A=LOSE|B=WIN--lots-of-random-characters-$*(#$*9*($#$

Then show the user a sha256 hash of that string and let THEM decide which button to press, A or B.

After they have clicked a button, you can show them the secret string, and they can match it to the hash to prove fairness.


In PHP?
legendary
Activity: 3416
Merit: 1912
The Concierge of Crypto
A coin flip is basically 50/50 on any of the dice sites. Right? (minus house edge)
hero member
Activity: 630
Merit: 500
I'm looking into making my own gaming site, does anyone know how to make a PROVABLY fair coinflip site?
Or would a random.org number generator suffice?

The only way to do this and prove fairness would be to present the user with two options A and B - one of them wins and one loses.

It would be difficult (or impossible) to prove fairness if they only had one button to choose from (such as "FLIP").

Generate a string, such as

A=WIN|B=LOSE--lots-of-random-characters-$*(#$*9*($#$
or
A=LOSE|B=WIN--lots-of-random-characters-$*(#$*9*($#$

Then show the user a sha256 hash of that string and let THEM decide which button to press, A or B.

After they have clicked a button, you can show them the secret string, and they can match it to the hash to prove fairness.
legendary
Activity: 1498
Merit: 1000
No, you probably want to use the blockchain time as a seed so you know it is random.

Do you know how I can do it?  I'm a newbie kinda still!  Wink

https://github.com/fireduck64/BitcoinTimestamp
sr. member
Activity: 476
Merit: 250
What do you call a fish with no eyes? A Fsh!
No, you probably want to use the blockchain time as a seed so you know it is random.

Do you know how I can do it?  I'm a newbie kinda still!  Wink
sr. member
Activity: 476
Merit: 250
What do you call a fish with no eyes? A Fsh!
I'm looking into making my own gaming site, does anyone know how to make a PROVABLY fair coinflip site?
Or would a random.org number generator suffice?
Jump to: