Post
Topic
Board Gambling
Topic OP
999xCrash game in Telegram fairness verification and salt decision notification
by
TopGame
on 29/08/2024, 12:34:47 UTC
Hello world,

We are about to launch a Crash game in Telegram. In order to provide an absolutely fair game, we will now announce the formula for fairness verification and how to determine the salt:

GAME RESULT FORMULA:
Code:
const gameResult = (seed, salt) => {
    const nBits = 52; // number of most significant bits to use

    // 1. HMAC_SHA256(message=seed, key=salt)  
    const hmac = CryptoJS.HmacSHA256(CryptoJS.enc.Hex.parse(seed), salt);
    seed = hmac.toString(CryptoJS.enc.Hex);

    // 2. r = 52 most significant bits
    seed = seed.slice(0, nBits / 4);
    const r = parseInt(seed, 16);

    // 3. X = r / 2^52
    let X = r / Math.pow(2, nBits); // uniformly distributed in [0; 1)
    X = parseFloat(X.toPrecision(9));

    // 4. X = 90 / (1-X)
    X = 90 / (1 - X);

    // 5. return max(trunc(X), 100)
    const result = Math.floor(X);
    return Math.max(1, result / 100);
  };
 
GET SALT:
Prior to being used for calculation, each game hash is salted with the lowercase + hexadecimal string representation of the hash from pre-selected TON Masterchain block 40,009,999. This block has not been mined yet as of this post, proving that we have not deliberately selected a mined block with a hash that could be favorable to the house. Once block 40,009,999 has been mined, the results will be posted to this thread as a reply.
[/quote]