Skip to main content
Roll game
Nootiih avatar
Written by Nootiih
Updated over a week ago

For full details on how Roll spins are generated and for a list of Game History, including seeds and nonces, you can find all the information on the Roll Provably Fair Page.

The following JavaScript code can be used to independently verify the integrity of any roll, by simply passing in the publicSeed,serverSeed and nonce of the game that you want to verify.

INDEPENDENT VERIFICATION

You can independently verify any previous roll by using the code displayed below. Simply input the public seed, un-hashed server seed and nonce of your roll. You can execute this code yourself using Node.js, but we understand that for some of you, this may be beyond your technical know-how. So, we have created an easy way for you to execute this code directly from your browser. It runs the exact same code which is shown below, without the hassle of having to set up Node.js on your home computer.

Note: Our Random Number Generator code was updated on 19th Oct 2022. For all games played between Nonce 330,106 and Nonce 3,553,944, please use this code for independent verification instead.

Note: Our Random Number Generator code was updated on 9th May 2020.
For all games played between Nonce 58,960 and Nonce 330,105 on 9th May 2020, please use this code for independent verification instead.

Note: Our Random Number Generator code was updated on 26th Feb 2020.
For all games played before Nonce 58,960 on 26th Feb 2020, please use this code for independent verification instead.

const crypto =require('crypto');// --- BEGIN: Fill these valuesconst publicSeed ='62e6f8226d2ba36535e14dfdcaad058893f0765592a67a6b53c05cafcfc64fb9';const nonce =539;const serverSeed ='7691fe1923dcac39492132fa517b678a2ffcbd3cc6474b1b476e23eeb2c80505';// --- END: Fill these values// With example values ^ it will output `Spin value: 4`// With example values ^ it will output `Spin color: Red Bait`// Turn this on if you want to see all the messagesconst verboseMode =false;// Get seedconst game =undefined;const seed =getCombinedSeed(game, serverSeed, publicSeed, nonce);// Get random roll value using provided informationconst max =15;const rollValue =getRandomInt({ max, seed });const rollColor =getRollColor(rollValue); console.log(`Spin value: ${rollValue}`); console.log(`Spin color: ${rollColor}`);/** * Below this line are algorithmic functions used for calculating a roll value * ============================================================================= */functionlog(message){if(verboseMode){ console.log(message);}}functiongetRandomInt({ max, seed }){// Get hash from seedlog(`Seed value: ${seed}`);const hash = crypto.createHmac('sha256', seed).digest('hex');// Get value from hashconst subHash = hash.slice(0,13);const valueFromHash = Number.parseInt(subHash,16);// Get dynamic result for this rollconst e = Math.pow(2,52);const result = valueFromHash / e;return Math.floor(result * max);}functiongetCombinedSeed(game, serverSeed, clientSeed, nonce){// Add main parametersconst seedParameters =[serverSeed, clientSeed, nonce];// Add game parameter if neededif(game){ seedParameters.unshift(game);}// Combine parameters to get seed valuereturn seedParameters.join('-')}functiongetRollColor(rollValue){const colors =[];if(rollValue ===0){ colors.push('Green');}if(rollValue <=7&& rollValue >=1){ colors.push('Red');}if(colors.length ===0){ colors.push('Black');}if(rollValue ===4|| rollValue ===11){ colors.push('Bait');}return colors.join(' ');}
Did this answer your question?