Bitcoin Forum
May 11, 2024, 05:24:45 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to make a provably fair coinflip site  (Read 1057 times)
fishy (OP)
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


What do you call a fish with no eyes? A Fsh!


View Profile
June 19, 2013, 12:03:57 AM
 #1

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?

\   \  \ \\\\\\\\\\\\\\\\◥◣◢◤//////////////// /  /   /
Win88.me ❖ Fair, Trusted Online BTC Gambling ❖
/   /  / ////////////////◢◤◥◣\\\\\\\\\\\\\\\\ \  \   \
1715448285
Hero Member
*
Offline Offline

Posts: 1715448285

View Profile Personal Message (Offline)

Ignore
1715448285
Reply with quote  #2

1715448285
Report to moderator
1715448285
Hero Member
*
Offline Offline

Posts: 1715448285

View Profile Personal Message (Offline)

Ignore
1715448285
Reply with quote  #2

1715448285
Report to moderator
1715448285
Hero Member
*
Offline Offline

Posts: 1715448285

View Profile Personal Message (Offline)

Ignore
1715448285
Reply with quote  #2

1715448285
Report to moderator
Whoever mines the block which ends up containing your transaction will get its fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715448285
Hero Member
*
Offline Offline

Posts: 1715448285

View Profile Personal Message (Offline)

Ignore
1715448285
Reply with quote  #2

1715448285
Report to moderator
1715448285
Hero Member
*
Offline Offline

Posts: 1715448285

View Profile Personal Message (Offline)

Ignore
1715448285
Reply with quote  #2

1715448285
Report to moderator
1715448285
Hero Member
*
Offline Offline

Posts: 1715448285

View Profile Personal Message (Offline)

Ignore
1715448285
Reply with quote  #2

1715448285
Report to moderator
fishy (OP)
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


What do you call a fish with no eyes? A Fsh!


View Profile
June 19, 2013, 12:14:12 AM
 #2

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

\   \  \ \\\\\\\\\\\\\\\\◥◣◢◤//////////////// /  /   /
Win88.me ❖ Fair, Trusted Online BTC Gambling ❖
/   /  / ////////////////◢◤◥◣\\\\\\\\\\\\\\\\ \  \   \
gweedo
Legendary
*
Offline Offline

Activity: 1498
Merit: 1000


View Profile
June 19, 2013, 12:15:24 AM
 #3

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
Cyberdyne
Hero Member
*****
Offline Offline

Activity: 630
Merit: 500



View Profile
June 19, 2013, 12:22:50 AM
 #4

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.
Dabs
Legendary
*
Offline Offline

Activity: 3416
Merit: 1912


The Concierge of Crypto


View Profile
June 19, 2013, 01:05:25 AM
 #5

A coin flip is basically 50/50 on any of the dice sites. Right? (minus house edge)

fishy (OP)
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


What do you call a fish with no eyes? A Fsh!


View Profile
June 19, 2013, 01:20:49 AM
 #6

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?

\   \  \ \\\\\\\\\\\\\\\\◥◣◢◤//////////////// /  /   /
Win88.me ❖ Fair, Trusted Online BTC Gambling ❖
/   /  / ////////////////◢◤◥◣\\\\\\\\\\\\\\\\ \  \   \
Cyberdyne
Hero Member
*****
Offline Offline

Activity: 630
Merit: 500



View Profile
June 19, 2013, 01:29:00 AM
 #7

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().
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!