Post
Topic
Board Project Development
Re: If I wanted to start a Bitcoin casino... [will pay for help]
by
grue
on 26/02/2012, 02:53:22 UTC
card based games: the card order is hashed prior to a game, and the hash is presented to the user
dice/roulette: hash of the outcome is presented to the user prior to the game
the data in each of the cases probably will have to be padded with some random data to prevent someone from bruteforcing the results to gain an advantage.

ie. its pretty easy to detect a user using double bet attack, and let them succeed a few times, before locking them in for a 50x lost bet.
Don't even need to try, https://en.wikipedia.org/wiki/Martingale_%28betting_system%29

In the real world slot machines are required to display their current payout pct, and it needs to be above xx%, but still if noone verifies the machine/script, you could print 99% payout pct and in fact payout less than that.

If users cannot trust that they are being treated as fairly as any other real life casino, I dont see it taking off bigtime.
After some thinking, I came up with this. It should be cheat-proof from both parties, and is fully auditable.

Every day, generate a table with n + 1 columns (n being the number of "wheels" in the slot machine), and a very large number of rows. Now fill all of it with random numbers. Those random numbers will represent the outcome of a slot machine play. For example, column 1 will represent the position of where the first "wheel" will land, the second will represent the second "wheel", etc.. Now, hash each row's data + some random padding, and save the hash in the last column. Now publish the table, with only the last column. When a user plays, he/she will be allowed to choose from any hash he/she wants. After 36 hours, publish the entire table. Now anyone can audit the table to ensure that the game is indeed fair, and since another table has been generated for the day, no one can cheat. The casino can't cheat in this case because the hash has already been published prior to play, so there's a very low chance the results has been tampered with.