Provably fair gaming

By: David Marc
Updated: December 4, 2017

Provably fair gambling harnesses some of the same cryptographic proofs utilized in bitcoin transaction authentication and mining to show, beyond doubt, that a dice or deck has not been stacked against the player, that the casino and the player are equally unsure of the outcome of any particular game of chance. There are two methods by which this is done. First, we detail the so-called “off-chain” method, most notably utilized by PrimeDice and Bitzino. Next, we look at the on-chain method, popularized by now-legendary Satoshi Dice. For those who would like to skip the details, check out our three favorite provably fair casinos below.

Off-chain Proof of Fairness

Before diving into the specifics of off-chain proof, it is useful for a quick primer in cryptographic hash functions. (Don’t worry, we’ll explain it simply). A cryptographic hash function is a process by which different inputs, each of which is comprised of an assortment of letters and numbers, are run through a process which generates a single output. The most important point for our current discussion is that the output cannot be reverse engineered – there is simply no way that the inputs can be determined by the output. However, if the same inputs are combined they will always result in the same output. On the other hand, if a single digit of any of the inputs were to be changed, it would result in a “waterfall effect” by which the output would bear no resemblance to its previous appearance.

One of the inputs, generated by the casino, is called the “server seed”, and looks something like this:

w30025f34532edge13246677443344ded3434355656780912354sdedsw2132

The server seed is shown to the player prior to the hand taking place, and prior to the introduction of the second input, the “client seed”. The client seed is a string of letter and/or numbers input by the player. These inputs are then run through a hash function, the output of which is used determine the dice roll, spin or deal, as the case may be.

The output is used in different ways depending on the particular game. For example, in bitcoin dice the output is used to determine a single number, representing the dice roll. In bitcoin blackjack, on the other hand, the seed is comprised of a deck’s worth of numbers, and hashing this deck against the client seed serves to shuffle the deck. The method works not only for card games but conceivably for any particular game – roulette, for instance, could simply assign a number to each particular ball, with the first number after the hash function representing the spin. The logic – the introduction of a player generated variable to a predetermined casino generated constant – assures that neither the casino nor the player can be aware of the result of a particular game until after it has been completed.

Now, the super attentive readers amongst you might have wondered how the casino itself is protected – if the player knows the server seed, could he not quickly check what the output would be against a particular client seed before making his next bet? The server seed itself is shown to the user as a hash, thus disguising the actual number against which the client seed will be input into a hash function. The raw server seed is only revealed to the user after a particular playing session ends, at which point the user can check that the output matches.

There is often a third element used as an input known as a nonce. The nonce is generally the spin, roll or deal within a particular session – such that the first spin is one, the second is two, and so on. This allows players to play within a particular provably fair session without continuously changing the server and client seed, allowing for different outputs while maintaining the same provably fair assurance.

On-Chain provably fair gaming

On-chain games use similar hashing functionality, but with only two inputs – a bitcoin transaction ID, generated when bitcoin is sent to the operators wallet, and a secret daily key. The secret key is released the following day for confirmations to be made. So again, there is a variable input unknown to the operator, and a constant input published and verifiable the following day. A hash is made between these two inputs using SHA512, which outputs a hex string. The first few digits of the hex string, just as the case off chain, are converted to decimal numeric format, and the resulting number (or the number resulting from the division of the resulting number) constitutes the dice roll, panchenko drop, or ticket number.

Cryptos
  • Bitcoin
  • Ethereum
  • Bitcoin Cash
  • Litecoin
  • Dash
  • Monero
  • Zcash
  • Dogecoin
Target Market
  • Global
Currencies
  • Crypto Only
Deposit
  • Bitcoin

Provably fair gambling harnesses some of the same cryptographic proofs utilized in bitcoin transaction authentication and mining to show, beyond doubt, that a dice or deck has not been stacked against the player, that the casino and the player are equally unsure of the outcome of any particular game of chance. There are two methods by which this is done. First, we detail the so-called “off-chain” method, most notably utilized by <a href=”http://www.primedice.com/?ref=bitreview” target=”_blank” rel=”nofollow”>PrimeDice </a>and Bitzino. Next, we look at the on-chain method, popularized by now-legendary Satoshi Dice. For those who would like to skip the details, check out our three favorite provably fair casinos below.

Off-chain Proof of Fairness

Before diving into the specifics of off-chain proof, it is useful for a quick primer in cryptographic hash functions. (Don’t worry, we’ll explain it simply). A cryptographic hash function is a process by which different inputs, each of which is comprised of an assortment of letters and numbers, are run through a process which generates a single output. The most important point for our current discussion is that the output cannot be reverse engineered – there is simply no way that the inputs can be determined by the output. However, if the same inputs are combined they will always result in the same output. On the other hand, if a single digit of any of the inputs were to be changed, it would result in a “waterfall effect” by which the output would bear no resemblance to its previous appearance.

Instant payouts

A notable aspect of bitcoin gambling in general is the speed at which cashouts are made to players. Generally speaking, withdrawals are processed within 10 minutes, or after a certain number of confirmations have been made that the initial deposit was, in fact, legitimate. The withdrawal speed of on-chain sites amplify withdrawal speeds – as a matter of fact, winnings are instantly transferred back to a user. How can on-chain sites transfer bet wins back to a user prior to confirming that the deposit was legitimately done? Is this not a huge risk for double spending? The cashout is based on the deposit transaction directly, including within it the bitcoins sent. If a player were to double spend the coins, the payout would include coins not in possession of the operator – and thus the cashout would be declared invalid. Of course, there is the risk that players who lose will rush to spend lost coins elsewhere, and some might on very rare occasion, be successful. Chalk it up to the cost of doing business as an on-chain casino.

Blockchain bloat

On-chain games have had the effect of sending an incredible number of small transactions to the blockchain, resulting in a fair bit of bloat. While there are definitely some very high rollers that play on-chain games, the vast majority of transactions are fractional and players place bets rapidly – which explains how bitcoin gambling could account for 50% of the transactions on the blockchain. For those concerned about being good bitcoin citizens, perhaps off-chain solutions would assuage any guilty conscience.

Check out all the ways you can now gamble with bitcoin.