fairnessFairness
  • Provably Fair

Overview

Wayyy's random number generator (RNG) facilitates SHA256 hash function and uuid4. First of all, for the 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 the previous game's hash. Each game uses a random number for its own use. For example, Space X uses a random number to calculate the payout, and so on.

Implementation

Verify Space X

const N_BITS = 52;

function verifySpaceX(hash, salt) {
    const seed = sha256.hmac.update(salt, hash).hex();
    const hex = seed.slice(0, N_BITS / 4);
    const parse = parseInt(hex, 16);
    const hashValue = big(parse).div(big(2).pow(N_BITS));
    const temp = big(param).div(1000000);
    const bust = big(returnPercent).div(big(temp).minus(hashValue)).div(100).round(2, 0);
    return Math.min(Math.max(1, Number(bust)), maxBust);
}

Input ( seed ) is a hash from the reversed hash list. Input (salt) is for updating the seed hash. With the updated hash, we use 52 most significant bits out of 256 bits from the SHA256 hash function. Then its integer value becomes [0; 1) real number. This uniformly distributed random number between 0 and 1 is used to calculate the payout/bust.

Verify Dice

function verifyDice(hash, salt) {
    const seed = sha256.hmac.update(salt, hash).hex();
    const hex = seed.slice(0, N_BITS / 4);
    const parse = parseInt(hex, 16);
    const hashValue = big(parse).div(big(2).pow(N_BITS));
    const rtpMutiplier = big(100).div(rtp+1);
    const finalVal = hashValue.times(rtpMutiplier).times(100).round(2, 0);
    if (type === 'over') {
        const result = finalVal.sub(big(100).mul(rtpMutiplier).sub(100)).round(2, 0);
        if (result.lte(0)) {
            return big(0.01);
        }
        if (result.gte(99.99)) {
            return big(99.99);
        }
        return result;
    } else {
        const result = finalVal;
        if (result.lte(0)) {
            return big(0.01);
        }
        if (result.gte(99.99)) {
            return big(99.99);
        }
        return result;
    }
}

The result of Dice is determined by Salt and Hash. During the game, two values are used to draw a random number between 0.00 and 99.99. Players can choose their goal range and payout in advance. If the the drawn number falls in the player's goal range, the player will win the payout set in advance. Payout must be between 1.01 and 9900.

Verify Boom

function verifyBoom(hash, salt){
    const seed = sha256.hmac.update(salt, hash).hex();
    const hex = seed.slice(0, N_BITS / 4);
    const parse = parseInt(hex, 16);
    const n = Number(big(parse).div(big(2).pow(N_BITS))); 
    return Math.floor(n * 4) + 1
}

Boom's game logic is similar to that of Space X. In Boom, every game has a salt and a hash. These two values generate an integer from 1 to 4 which is the number you can choose to survive from the bomb. The winning probability is 75%. You can add up your payouts as long as you survive.

Verify Roulette

function verifyRoulette(hash, salt) {
    const TOTAL_NUMBERS = 37;
    const seed = sha256.hmac.update(salt, hash).hex(); 
    const hex = seed.slice(0, N_BITS / 4);
    const parse = parseInt(hex, 16);
    const hashValue = Big(parse).div(Big(2).pow(N_BITS)).times(TOTAL_NUMBERS).round(0, 0);
    return Number(hashValue).toString();
}

The result of Roulette is determined by Salt and Hash. During the game, two values are used to draw a random number between 0 and 36. If the the drawn number falls in the player's goal range, the player will win the payout set in advance.

Chat iconChat
menu

Menu

chat

Chat

casino

Casino