Skip to content

Instantly share code, notes, and snippets.

@RHavar
Last active October 20, 2019 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save RHavar/285c295f7906e03369cd66580a1b5f45 to your computer and use it in GitHub Desktop.
Save RHavar/285c295f7906e03369cd66580a1b5f45 to your computer and use it in GitHub Desktop.
Bustadice Provably Fair Overview

Bustadice uses a unique provably fair system, designed to give strictly improved guarantees compared what is currently in use by established casinos. While bustadice's provably fair system introduces some additional complexity; from an end-users perspective the verification procedure is largely the same.

There are three parties:

  • the client, i.e. an end user playing bustadice,
  • the game server, which is run by bustadice itself, and
  • the seed server, which is run by Ryan and used to provide extra guarantees.

The high level guarantees offered:

  • The client can verify that the games are determined completely fairly (even if the seed server and game server were conspiring!)
  • The seed server can verify the legitimacy of all bets (e.g. to protect investors against a malicious or hacked game server)
  • The game server can verify that neither the client or the seed server is able to cheat. Even if they were conspiring.

Guarantees that can not be offered:

  • Investors need to trust that the game server and seed server are not conspiring. Should they conspire, they could undetectibly drain the bankroll (same as any other casino, except this requires two different parties).

How this works at a high level:

  1. Game Server picks a secret (Game-Server-Seed)
  2. Game Server hashes the secret (Seed-Server-Hash) to provably commit to it and sends to the Seed Server
  3. Seed Server picks a secret. (Seed-Server-Seed)
  4. Seed Server hashes the secret (Seed-Server-Hash), and gives it to the Game Server to provably commit to it.
  5. Game Server sends the client a commitment to both the Seed-Server-Seed and Game-Server-Seed (called the Server-Seed-Hash), by sending a hash of the Game-Server-Seed, combined with the Server-Seed-Hash.
  6. Client takes note of the Server-Seed-Hash and picks a Client-Seed and sends to the server.

At this point, the stage is set. Note: From a pure clients perspective, this is the same as standard provably fair. They get a server-seed-hash and pick a client seed.

Now the client is free to bet as much as they like.

From a technical level, when the client makes a bet:

  1. Client makes a bet and sends to Game Server
  2. Game server mixes in the next nonce, and sends to Seed Server
  3. The Seed Server hashes it's Seed-Server-Seed with the nonce (Seed-Server-Bet-Hash), and gives the result to the Game Server
  4. The Game Server hashes the Seed-Server-Bet-Hash with it's Game-Server-Seed along with the Client-Seed and the Nonce. It uses this final hash to determine the game outcome

After a client has finished with their gambling session and wants to verify all games:

  1. Client requests the Seed-Server-Seed and the Game-Server-Seed, which invalidates them for future use
  2. Client verifies that the Seed-Server-Seed and Game-Server-Seed combine to give the original Server-Seed-Hash
  3. Client uses the Seed-Server-Seed, Game-Server-Seed, Client-Seed and runs through all the nonces to generate all game results
  4. Client compares the game results with what they saw, and verifies they were not cheated

But instead of just the client verifying the games, the Game-Server also sends the Game-Server-Seed to the Seed Server (and in fact the Seed Server will not reveal the Seed-Server-Seed without it). What this allows the Seed-Server to now do, is verify all games, and see what outcome the client should have got. It uses this information to know what the site profit/loss should be, and can alert for any discrepencies.

The astute reader will note, the Seed-Server is only able to verify games if a client has reset their seeds (to verify). For this reason, bustadice comes with one minor caveat typically not seen: Before using their money (tipping, transfering, investing) bustadice requires users to reveal their seeds. This gives them the chance to check their games, but importantly gives the Seed-Server that opportunity too.

As the Seed-Server is run by the same person (Ryan) who holds 1-key of the multisig cold storage, it is important he is able to verify the games before authorizing a potentially large deduction from storage.

@dooglus
Copy link

dooglus commented Jan 24, 2018

Game Server hashes the secret (Seed-Server-Hash)

Typo? Should say 'game' not 'seed'.

@dooglus
Copy link

dooglus commented Jan 24, 2018

by sending a hash of the Game-Server-Seed, combined with the Server-Seed-Hash

I think Server-Seed-Hash should be Seed-Server-Hash here probably.

@FreeBitcoins-com
Copy link

FreeBitcoins-com commented Oct 20, 2019

Weird. You don't call your shit provably-fair for investors here like you do on Bitcointalk (https://i.imgur.com/BrvmH54.png) & google search engines (https://i.imgur.com/sB6TRbr.png).

I would like to point out that this is absolutely not "provably-fair" for investors despite the attempt at "allegedly" layering ownership... even though I likely don't need to do that here because you don't run your mouth around dooglus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment