Provably Fair


Provably fair is a transparent way for us to guarantee as the operator that we are providing true randomness without manipulation.
In a land-based gambling and casino games, this could be by the turn of a card, the roll of a dice, or even the spin of a roulette wheel, but when it comes to online gambling, this type of functionality needs to be handled within the programming of our service.
To ensure operating honestly, the provably fair algorithm is implemented to provide a completely transparent and verifiable solution to the handling of pre-determined bet outcomes. This in short means that, as a player you have complete power over your gambling experience, and can be assured there is true randomness when you play our games.



For each verifiable bet, a client seed, a server seed and a nonce are used as the input parameters for the random number generator (0-99.99). Bytes are generated using the HMAC_SHA512 function. This function creates 64 random bytes (0-511) from a given server seed and a message. The message is created using the client seed and the nonce. The message is then created by concatenating the client seed, a dash and the nonce. Each game use the result number (0-99) in a different way to map it to the game values.

Client Seed:

This is a passphrase or a randomly generated selection of text that by default is determined by the server, but it can be determined by the player or randomly. This can be edited and changed regularly (if desired) to create a new chain of randomness.

Server Seed and Server Hash:

The server seed is generated by our system as a random 64-character hex string. You will then be provided with an encrypted hash (server_hash) of the server seed before you place any bets. The seed is encrypted to ensure that the outcome cannot be calculated by the player beforehand, but still provide the guarantee that the outcome has been pre-determined and not changed after the bet has been made.
To reveal the hashed server seed, the seed must be rotated by the player,which triggers the replacement with a newly generated seed. From this point you are able to verify any bets made with the previous server seed to verify both the legitimacy of the server seed with the encrypted hash that was provided, but also with the outcomes of each bet placed on the games when it was active.

Nonce:

The nonce is simply a number that increments as every new bet is made. This generates a unique input per game, without having to generate a new client seed and server seed each time you play.


Wheel of Fortune:

The wheel is divided in 30 slices (0-29). Each slices has a prize assigned. The random result (0-99) is mapped to an angle (0-360). Then the angle is divided by 12, and the result is the number of slice.

RGBSlot:

There are three wheels. Each Wheel is divided in 6 slices. Each wheel has a diferent distribution of colors (Red, Green and Blue) for the slices. The game takes three consecutives nones as a random results. Each value (0-99) is mapped to an angle (0-360). These angles are mapped to corresponding color for each wheel. The combination of three colors will give the prize for each spin.

Where is Nakamoto?:

The board of this game is shared by all players, the client seed is the same for all users. Client seed can not be changed or rotated by users. It is used as a seed to shuffle the prizes on diferent cards. Once each round is finished, you can verify the card number of all prizes of last finished round. You can save the server hash of current round to validate the seeds when current round is finished.

MiniRoulette:

The wheel is divided in 13 slices (0-12). Each slices has a number assigned. The random result (0-99) is mapped to an angle (0-360). Then the angle is divided by 27.692307692, and the result is the number of slice.

Unlock:

Each new level use the number of random numbers to fill the valid locks. The nonce is increased every valid block selected. Each level has 12 locks, so the random result is mapped from 0-100 to 0-11, and the result is the lock assigned as a valid lock.

Lightning Balls:

Two pairs of keys are used in this game. One for ball prizes and one for balls positions and type of ball (red or green):

PRIZES:

There are 30 balls in each game, and the balls have a "secret" prize assigned. This prizes are different for every player, so player can rotate client and server seeds. The random result (0-99) is mapped to the 30 (number of prices) and each price is assigned to one ball based on the results.

POSITION AND TYPE:

Each ball has a position on the board, and can be on of two types: green (positive prize) or red (negative prize). The board of this game is shared by all players, the client seed is the same for all users. Client seed can not be changed or rotated by users. It is used as a seed to get positions and types for all balls. Once one player finish a game new positions and types are calculated.

Memory:

Memory it's mainly a hability game, so random factor is not the key of the game.


You can verify your previous result. Copy your client seed, server seed, server hash, and last nonce from game you played, and fill the verifier form:

verifier form

You can verify games results in your own machine running this node js script: (download from github])



//lngames.net Provably Fair verifier script (2019)
//Based on https://cyberdice.net/fairness 
// fill client seed, server seed and nonce with your values, and run it: 
// node faircheck.js

const crypto = require('crypto');

const clientSeed = "client_seed";
const serverSeed = "server_seed";
const lastNonce = 9;

const server_hash = crypto.createHash('sha512').update(serverSeed).digest('hex');
console.log("ServerHash: "+server_hash)

for(var i=0;i<=lastNonce;i++){
  console.log(i+': '+get_random_num(serverSeed, clientSeed, i));
}


function get_random_num(serverSeed, clientSeed, nonce) {
  const crypto = require('crypto');
  const text = clientSeed + '-' + nonce;
  const hash = crypto.createHmac('sha512', serverSeed).update(text).digest('hex');
  let index = 0;
  let numResult = parseInt(hash.substring(index * 5, index * 5 + 5), 16);
  while (numResult >= Math.pow(10, 6)) {
    index++;
    numResult = parseInt(hash.substring(index * 5, index * 5 + 5), 16);
    if (index * 5 + 5 > 128) {
      numResult = 99.99;
      break;
    }
  }
  numResult %= Math.pow(10, 4);
  numResult /= Math.pow(10, 2);
  return numResult;
}

                   

HTML tutorial