If you are into iGaming, then you must have seen the word Provably Fair quite often. What is it and how is it changing the iGaming industry?

In online gambling provably fair describes an algorithm which can be analyzed and verified for fairness on the part of the service operator. Provably fair algorithms are often used in the operation of an online casino.

Not long ago, offline casinos or classic online based casinos did not provide such verification functions. Then how did players have enough trust to play at those sites? 1. They simply did not care enough. 2. They trusted the name value of the brand. This was mainly how big casinos were able to keep their loyalty as they have proven to be trusted by many people previously.

This is extremely beneficial for players as they can immediately verify the fairness of the game for themselves. While a majority of players may never question that a game is fair, the small minority that do will have their concerns quickly addressed by putting in the random seed into the algorithm for themselves.

Example of Provably Fair

Let’s take an example with UC Casino’s Provably Fair algorithm.

The UC Casino Foundation is an organization that researches and realizes a fair platform that guarantees player security by using the Provably Fair concept and prevents manipulation by the suppliers. They have been deeply researching the concept of fairness for many years and have been operating and verifying our own service while continuously modifying it. They prolong to expand the platform to provide a fair and safe user experience in a wider variety of games.

UC Casino’s provably fair main image showing a hand and a watch in black and white

UC Casino Foundation’s random number generator (RNG) facilitates SHA256 hash function and uuid4.

First of all, for provable fairness, RNG generates the list of hashes. Each element in the list is the hash of the previous hash. The first hash is generated by uuid4. Then the list is reversed so that it provides the consecutively verifiable hash list, i.e. hashing the current hash outputs of the previous game’s hash. This reversed hash list is uncheatable and easily verifiable because no one can predict the next hash in the reversed hash list in the reasonable time and anyone can verify the current hash is valid by hashing the current hash.

Each game uses a random number for its own use. For example, Baccarat uses a random number to shuffle the eight-deck shoe. Please refer to https://github.com/UCCasinoFoundation.

Implementation

function verifyBaccarat(hash, salt): gameResult {

const hashList = makeHashList(hash, salt);

const eight-deck-shoe = makeShoe(hashList);

const gameResult = simulateBaccarat(eight-deck-shoe);

return gameResult;

}

When the makeHashList() function is called, given the hash and salt, it generates 52 * 8 hashes by hashing the previous hash. Then, makeShoe() function makes the shuffled eight-deck shoe with the hash list using the well-known Fisher–Yates shuffle algorithm. When the simulateBaccarat() function is called, it proceeds throughout the multiple steps until the shoe ends. For verification of a game result with your hash and salt, please refer to Verify Baccarat.

function verifyDragonTiger(hash, salt): gameResult {

const hashList = makeHashList(hash, salt);

const eight-deck-shoe = makeShoe(hashList);

const gameResult = simulateDragonTiger(eight-deck-shoe);

return gameResult;

}

When the makeHashList() function is called, given the hash and salt, it generates 52 * 8 hashes by hashing the previous hash. Then, makeShoe() function makes the shuffled eight-deck shoe with the hash list using the well-known Fisher–Yates shuffle algorithm. When the simulateDragonTiger() function is called, it proceeds throughout the multiple steps until the shoe ends. For verification of a game result with your hash and salt, please refer to Verify DragonTiger.

void roulette_random_init(int Seed)

{

int ii = 0;

int mj, mk;

```
// Initialize our Seed array.
int subtraction = (Seed == int.MinValue) ? int.MaxValue : Math.Abs(Seed);
mj = MSEED - subtraction;
_seedArray[55] = mj;
mk = 1;
for (int i = 1; i < 55; i++)
{
// Apparently the range [1..55] is special (Knuth) and so we're wasting the 0'th position.
if ((ii >= 55) ii -= 55;
_seedArray[ii] = mk;
mk = mj - mk;
if (mk < 0) mk = _seedArray[ii];
}
for (int k k < 5; k++)
{
for (int i i < 56; i++)
{
int n + 30;
if (n >= 55) n -= 55;
_seedArray[i] -= _seedArray[1 + n];
if (_seedArray[i] < 0) _seedArray[i] = 21;
```

}

int get_random_value()

{

int retVal;

int locINext locINextp (++locINext >= 56) locINext = 1;

if (++locINextp >= 56) locINextp = 1;

```
retVal = _seedArray[locINext] - _seedArray[locINextp];
if (retVal == MBIG) retVal--;
if (retVal < 0) retVal += MBIG;
_seedArray[locINext] = retVal;
_inext = locINext;
_inextp = locINextp;
return retVal;
```

}

Pseudo-random numbers are chosen with equal probability from a finite set of numbers. The chosen numbers are not completely random because a mathematical algorithm is used to select them, but they are sufficiently random for practical purposes. The current implementation of the random algorithm is based on a modified version of Donald E. Knuth’s subtractive random number generator algorithm. For more information, see D. E. Knuth. The Art of Computer Programming, Volume 2: Seminumerical Algorithms. Addison-Wesley, Reading, MA, third edition, 1997.

SHA-2 (Secure Hash Algorithm 2) is a set of cryptographic hash functions designed by the United States National Security Agency (NSA) and first published in 2001. They are built using the Merkle–Damgård structure, from a one-way compression function itself built using the Davies–Meyer structure from a (classified) specialized block cipher.

The Fisher–Yates shuffle is an algorithm for generating a random permutation of a finite sequence — in plain terms, the algorithm shuffles the sequence. The algorithm effectively puts all the elements into a hat; it continually determines the next element by randomly drawing an element from the hat until no elements remain. The algorithm produces an unbiased permutation: every permutation is equally likely. The modern version of the algorithm is efficient: it takes time proportional to the number of items being shuffled and shuffles them in place.

- Write down the numbers from 1 through N.
- Pick a random number k between one and the number of unstruck numbers remaining (inclusive).
- Counting from the low end, strike out the kth number not yet struck out, and write it down at the end of a separate list.
- Repeat from step 2 until all the numbers have been struck out.
- The sequence of numbers written down in step 3 is now a random permutation of the original numbers.

Random Number Generator

The UC Casino Foundation evaluated UC Baccarat’s Random Number Generator (RNG) and found that the RNG complies with the relevant standards and passes Marsaglia’s “diehard” tests for statistical randomness. The UC Casino Foundation also evaluated the random number’s usage in the logic of UC Baccarat.

The UC Casino Foundation evaluated UC Dragon Tiger’s Random Number Generator (RNG) and found that the RNG complies with the relevant standards and passes Marsaglia’s “diehard” tests for statistical randomness. The UC Casino Foundation also evaluated the random number’s usage in the logic of UC Dragon Tiger.

The random number generation tests were conducted on large samples enough to give the calculations sufficient statistical power. The UC Casino Foundation has found that each game’s random number sequences are statistically unpredictable, non-repeatable and uniformly distributed.

Hash Verification

The following are example of the Hash Verification function from UC Casino Foundation.

60 Seconds Baccarat — London

Dragon Tiger — Yellow / Huang (黃)

Contact : contact@uccasino.org

Website : https://uccasino.org

## Comments 0