Bitcoin Forum
May 24, 2024, 07:20:16 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Creating verifiable rolls with PHP  (Read 141 times)
bukz (OP)
Newbie
*
Offline Offline

Activity: 154
Merit: 0


View Profile WWW
September 02, 2018, 03:34:02 AM
 #1

Hey guys I'm working on a gambling site for my community members to play around and invest in. Does anyone know how I can create rolls that are verifiable? I've found some old code from the old coindice script but it's not working fomr some reason. Cheers!
adaseb
Legendary
*
Offline Offline

Activity: 3766
Merit: 1718



View Profile
September 02, 2018, 06:17:30 AM
 #2

Its very easy for a dice style game and you have basically many options to work with.

What you do at first is generate some random seed such as
"01234567890"

and then you run a hash thru it such as SHA256
SHA256('01234567890')= EE29EB4A8725678278AC439CF7ABFD2A849CDC7378A6B6316017B81C51D720E7

Then you can simply add a nonce and client seed to that seed if you want and it would increment for everybet.

At first you show the gambler the hashed seed "EE29EB4A8725678278AC439CF7ABFD2A849CDC7378A6B6316017B81C51D720E7" and when he is done playing you need to give them the unhashed seed "01234567890" so they can verify their bets.

There are many ways to do this and if you program it correctly it would be impossible for either party to cheat.
bukz (OP)
Newbie
*
Offline Offline

Activity: 154
Merit: 0


View Profile WWW
September 02, 2018, 01:39:52 PM
 #3

Thanks!
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!