Provably Fair: Everything you need to know about this unique algorithm

Crypto casinos introduced the concept of provably fair gambling where the player doesn’t just bet and hope the results are fair but has the ability to verify his bets using a fair algorithm that works on encryption. If you have any doubts about the algorithm and how bets could be fair, we are going to clear all those doubts by the end of this guide.

We quickly moved from probably fair (the user had to hope the bets are fair) to the provably fair system where user can verify their bets and just like Bitcoins, eliminate the need for trust from gambling.

Components of the provably fair algorithm:

  1. Server Seed
  2. Client Seed
  3. Encryption function (usually SHA-256, a one-way function)
  4. Nonce

How is the result generated?

Consider a string that is made up of server seed followed by client seed which is then followed by a nonce. The string is then hashed and the function is applied which then generates the result eventually. Don’t worry we will discuss in detail what are all those components and how the house cannot cheat. One thing you must remember is that if you even change 1 character of the string, the SHA-256 function will generate a completely different result, this means if you alter the string at all, the result will be completely changed.

What is server seed?

A server seed could be anything but casinos usually use a 64-character hex string so that it is impossible for the players to guess the string and even brute-forcing is implausible. Casinos have an in-built system that generates a new string every time the user requests a new server seed.

Consider the server seed randomly generated by the casino is BTCGOSU. Now the casino cannot provide you the seed directly because the player would know all the results if they do so. To prevent the player from cheating while making sure the casino cannot change its server seed, they provide the user with the hash of the server seed.

The SHA-256 of BTCGOSU would be – 4ad34f67fcacc154455d69c63834ea9577181994c4b68bd5e23dccf21dd225ad

The above encrypted data is what is shown to the user.

Now the user knows that whatever the string was (it was BTCGOSU) they cannot change it because the sha-256 value would change if the casino changes any character of the server seed.

What is client seed?

It’s rather simple. You pick any string and enter it into the casino as client seed while you already know the hash of the server seed. This enables you to change the client seed whenever you want while the server seed remains the same, making it impossible for the casino to alter the results.

What is a nonce?

A nonce is simply the number of bets you made. Imagine if there is no nonce included, the result would be the same every time if the client (player) does not change his seed or the casino does not rotate the server seed after every single bet. With the help of nonce even if you don’t change the server seed and client seed, you can still get fresh results for every bet you make.

Let’s take an example to clarify things even more:

Suppose the casino uses the string in this manner {server_seed, client_seed, nonce}

The client seed is what you control and can change it anytime you want. The server seed is hidden but its encrypted data is given to you so later when the seed is revealed you can verify the encrypted data was indeed for the given seed (once you change the server seed, it is revealed and a new server seed is rotated in its place) and nonce is the number of bets made with the current client & server seed pair.

If we assume the server seed was BTCGOSU, the client seed is GOSU and the nonce is 1 then the string that would be hashed to generate the result would look like this {BTCGOSU, GOSU, 1} and each time you make a bet, the nonce will increase.

Can this system be cheated?

If the player is not careful, the system can be cheated as evident from some past events. There used to be a casino named that used to skip the winning nonce and would only give user the results with losing nonce.

You can think about this from the below example. Consider the result of following strings as:

{BTCGOSU, GOSU, 1} = lose

{BTCGOSU, GOSU, 2} = win

{BTCGOSU, GOSU, 3} = win

{BTCGOSU, GOSU, 4} = lose

{BTCGOSU, GOSU, 5} = lose

The casino simply skipped the winning nonces and displayed the bets with losing nonces, so the user would not see the bets with nonce 2 and 3 because those were his winning bets and the casino skipped winning nonces.

This was caught when a user carefully analyzed and found that the nonces are not regular and hence every gambler should verify their bets, no matter if you play at a trusted casino. If you have any doubts about the system, please ask in the comments below.

We have even created a special tool for gamblers to verify their bets: Provably Fair Verifier

Relevant news

1 thought on “Provably Fair: Everything you need to know about this unique algorithm”

Leave a Reply