Provably Fair by Wolf.Bet - nucleare/DeepSearch_HashGames GitHub Wiki
Fairness
Wolf.bet uses a cryptographic provably fair algorithm which allows users to check and analyze the legitimacy of every bet and confirm they are not manipulated. Our random numbers are generated through the use of two seeds (a server seed and a client seed) and nonce number.
Server seed
After registration user is provided with an encrypted hash of that generated server seed. We provide you the hashed server seed to ensure that it cannot be changed by casino provider and that the player cannot calculate result beforehand. To verify your previous bets you have to reveal the server seed from its hashed version by generating new server seed in "Session" menu.
Client seed
The client seed is used to ensure the player also has influence on the randomness of the bets results. Player is free to change their client seed anytime to create a new chain of random upcoming results. This ensures the player has absolute control over the generation of the result.
Nonce
The nonce is simply a number that increments every new bet and it is reset back while the server seed is changed. This value allows to create a completely new result each time, without having to generate a new client seed and server seed.
Implementation
Dice
To create a roll number, Wolf.bet uses a multi-step process to create a roll number 0-99.99. Both client and server seeds and a nonce are combined with hmac-sha256(serverSeed, clientSeed_nonce) which will generate a hex string.
The nonce is the # of rolls you made with the current seed pair. First five characters are taken from the hex string to create a roll number that is 0-1,048,575. If the roll number is over 999,999, the process is repeated with the next five characters skipping the previous set. This is done until a number less than 1,000,000 is achieved.
In the astronomically unlikely event that all possible 5 character combinations are greater, 99.99 is used as the roll number. The resulting number 0-999,999 is applied a modulus of 10^4, to obtain a roll number 0-9999, and divided by 10^2 to result in a 0-99.99 number.
const verify = (server_seed, client_seed, nonce) => {
const hash = CryptoJS.HmacSHA256('
server_seed,
`${client_seed}_${nonce}`,
).toString();
let index = 0;
let lucky = parseInt(hash.substr(index, 5), 16);
while (lucky >= 1000000) {
lucky = parseInt(hash.substr(index, 5), 16);
index += 5;
}
return (lucky % 10000 / 100).toFixed(2);
}
Example: https://jsfiddle.net/diceVerify/
Limbo
To create a bet result, Wolf.bet uses a multi-step process. Both client and server seeds and a nonce are combined with hmac-sha256(serverSeed, clientSeed_nonce_0) which will generate a hex string.
The nonce is the # of every bet you made with the current seed pair. First eight characters are taken from the hex string to create a sum number that is 0-1. Then sum is multiplied by maximum possible multiplier to create float number which is normalized. Normalized float is multiplied by the house edge. Then, in order to generate a game event that has probability distribution, we divide the maximum possible multiplier by the result of the first step to create the crash point.
const verify = (server_seed, client_seed, nonce, sub_nonce) => {
const betHash = CryptoJS.HmacSHA256(
server_seed,
`${client_seed}_${nonce}_0,
).toString();
const floats = new Array(4).fill(0).map((el, index) => {
return parseInt(betHash.substr(index * 2, 2), 16);
});
let sum = 0;
floats.forEach((float, index) => {
sum += round((float / Math.pow(256, index + 1)), 10);
});
// Sum multiplied by the maximum possible multiplier
const float = sum * 1e8;
// Make sure float is not zero
const normalizedFloat = Math.max(float, 0.01)
const floatPoint = 1e8 / normalizedFloat * 0.99
// Make sure floatPoint is not higher than required
const clampedFloatPoint = Math.min(floatPoint, 9900000)
// Crash point rounded down to required denominator
const crashPoint = Math.floor(clampedFloatPoint * 100) / 100;
// Consolidate all crash points below 1
return Math.max(crashPoint, 1);
}
Example: https://jsfiddle.net/limboVerify/
Hilo (High Low)
To generate series of cards, Wolf.bet uses a multi-step process to draw randomized cards stream. Both client and server seeds with a nonce and subnonce are combined with hmac-sha256(serverSeed, clientSeed_nonce_subNonce) which will generate a hex string.
The nonce is the # of every bet you made with the current seed pair. Subnocne is number which represents the position of the card in the stream. First eight characters are taken from the hex string to create a sum number that is 0-1. Then sum is multiplied by number of cards in tile, which is 52. Result rounded with floor function indicates card position from cards array.
const cards = ['♦A','♦2','♦3','♦4','♦5','♦6','♦7','♦8','♦9','♦10','♦J','♦Q','♦K','♥A','♥2','♥3','♥4','♥5','♥6','♥7','♥8','♥9','♥10','♥J','♥Q','♥K','♠A','♠2','♠3','♠4','♠5','♠6','♠7','♠8','♠9','♠10','♠J','♠Q','♠K','♣A','♣2','♣3','♣4','♣5','♣6','♣7','♣8','♣9','♣10','♣J','♣Q','♣K'];
const verify = (server_seed, client_seed, nonce, sub_nonce) => {
const betHash = CryptoJS.HmacSHA256(
server_seed,
`${client_seed}_${nonce}_${sub_nonce}`,
).toString();
const floats = new Array(4).fill(0).map((el, index) => {
return parseInt(betHash.substr(index * 2, 2), 16);
});
let sum = 0;
floats.forEach((float, index) => {
sum += round((float / Math.pow(256, index + 1)), 10);
});
return cards[round(sum * 52, 0, 'floor')];
}
Example: https://jsfiddle.net/hiloVerify/
Note from nucleare: Wolf.bet is certainly one of the smaller casinos in terms of what they have to offer for in-house considering there's only 3 games utilizing their provably fair algorithm. But, for reasons left unsaid, there are some features that they have to offer which none of the bigger brand casinos seem to offer. In any case, hopefully this answers anyone's question who may be wondering, "That's it?"