Provably fair gaming explained

In the world of online gaming, fairness is crucial. Players need to trust that the games they play are genuinely random and not manipulated. bustabit uses a provably fair system to ensure that every game result is fair and verifiable by players. This page explains how bustabit's provably fair system works in simple terms.

Understanding hashes

At the heart of bustabit's fairness system is a concept called a hash. But what exactly is a hash?

What is a hash?

A hash is like a digital fingerprint for any piece of data. It's generated by a mathematical function called a hash function. When you input data into a hash function, it produces a fixed-size string of characters, which is the hash.

Two key properties of hash functions are:

Example of a hash function

Let's take the SHA-256 hash function as an example. If we input the phrase "red train" into SHA-256, we get the following hash:

a2691e176303122661d2551f627d8d2184e1e582ddab88cdabc63f95186e1ab9

If we change the input slightly to "red trains" (adding an "s"), the hash changes completely:

35464444d2b3fcb57e410e7215f78ab2b1c8c889fff1efee7284acd11fee64a4

This demonstrates the "avalanche effect" of hash functions, where even a small change in the input results in a vastly different hash.

The hash chain: ensuring fairness

Now that we understand hashes, let's explore how bustabit uses them to ensure fairness through a hash chain.

What is a hash chain?

A hash chain is a sequence where each hash is produced by hashing the previous hash. Here's how it works:

  1. Start with a secret initial value, known only to bustabit.
  2. Apply the hash function to this value to get the first hash.
  3. Hash the first hash to get the second hash.
  4. Repeat this process to create a long chain of hashes.
Hash Chain Diagram

Figure 1: Illustration of a hash chain

Why does this ensure fairness?

The hash chain ensures fairness because:

How bustabit uses the hash chain

bustabit generates a long hash chain to determine game outcomes. Here's the process:

  1. Creating the chain: bustabit starts with a secret seed and generates a chain of 100 million hashes by repeatedly applying the SHA-256 hash function.
  2. Assigning hashes to games: Each hash corresponds to a game, starting from game #1 up to game #100,000,000.
  3. Publishing the terminating hash: bustabit publishes the final hash in the chain (the terminating hash) before any games are played. This allows players to verify the chain's integrity.
bustabit Hash Chain

Figure 2: bustabit's hash chain structure

Precommitting to the game derivation code

To ensure complete transparency, bustabit publicly commits to the exact code used to derive the game results from the hashes. This means that:

By committing to the code during the seeding event (a public announcement where they publish the terminating hash and the game derivation code), bustabit sets everything in stone. This ensures that the entire system is transparent and trustworthy.

Code Commitment

Figure 3: Precommitting to game derivation code

Calculating game results

Each game's outcome (the crash point) is calculated using its assigned hash and the precommitted game derivation code. Here's how:

  1. Use the game hash: Take the hash assigned to the game.
  2. Convert to a number: Convert the hash into a decimal number between 0 and 1.
  3. Apply the precommitted code: Use the published code to calculate the crash point:

    Crash Point = max(1, floor((99 / (1 - X)) / 100))

    where X is the decimal number from step 2.

Since bustabit has publicly committed to this exact code, any deviation would be detectable. Players can use the same code to verify that the crash points are calculated correctly.

Enhancing fairness with ActuallyFair.com

To add an extra layer of security and fairness, bustabit collaborates with ActuallyFair.com, using their Vx service. Here's how it works:

Using unpredictable data

bustabit incorporates an unpredictable element called the game salt, which is the hash of a future Bitcoin block. Since no one can predict this hash before the block is mined, it adds true randomness to the game.

Generating a signature (vxSignature)

ActuallyFair.com uses their private key to sign a combination of the previous game's hash and the game salt. This signature, called the vxSignature, is unique and verifiable.

Combining everything together

For each game:

  1. Obtain vxSignature: Get the signature from ActuallyFair.com.
  2. Compute HMAC: Use the vxSignature as the key and the game hash as the message in an HMAC function.
  3. Calculate the crash point: Use the result of the HMAC in the precommitted code to calculate the crash point.
ActuallyFair.com Integration

Figure 4: Collaboration with ActuallyFair.com

This process ensures that neither bustabit nor ActuallyFair.com can manipulate the game outcomes, as it relies on unpredictable data and publicly committed code.

Verifying the fairness yourself

Players can independently verify that each game was fair. Here's how:

  1. Get the game data: Obtain the game hash, game number, vxSignature, and game salt from the game information page.
  2. Verify the hash chain: Starting from the game hash, hash it repeatedly to see if you reach the terminating hash. This confirms the hash is part of the original chain.
  3. Verify the vxSignature: Use ActuallyFair.com's public key and the game salt (Bitcoin block hash) to verify the signature.
  4. Use the precommitted code: Apply the publicly committed game derivation code to calculate the crash point.
  5. Compare results: Ensure that the crash point you calculated matches the game's actual outcome.
Verification Steps

Figure 5: Steps to verify game fairness

Why precommitting to code matters

Precommitting to the game derivation code is crucial because:

Conclusion

bustabit's provably fair system combines cryptographic hashes, hash chains, unpredictable data, and publicly committed code to ensure every game is fair and transparent. Understanding these components allows players to trust that the games are not manipulated and that they have a fair chance of winning.

Additional resources

For more technical details, you can visit bustabit's official Provably Fair page or check out their open-source verifier on GitHub.