Skip to main content
All CollectionsFairness
Case battles - PvP
Case battles - PvP
Nootiih avatar
Written by Nootiih
Updated over a week ago

PvP uses a system of provable fairness whereby the public seed is not known to anyone until the bets have already been committed and the game has started. This ensures that nobody can know the result in advance, not even us, since a part of the seed used to generate the final result is completely unknown until all the bets have been committed.

We offer verification which allows users to check the integrity of every game and confirm that the results were not manipulated. Every randomly generated result is calculated from a three-part seed based on a seed pair and a nonce. The seed pair is made up of a public seed and a server seed. This pair is "nonced" with a unique number and the "Game Mode" to generate a random final result.

NONCE

For Case Battles, we use the numerical ID of the PvP bet ID as the nonce, this ID is a unique sequential number which is incremented each time a new PvP bet is made by anyone on the site. Each Case (or Box) in the Battle is treated as a single bet, and all of the bets for all of the boxes are committed by each user before the Battle begins. Each player has their own unique nonce for each round, which corresponds to their own PvP bet ID for that round. The nonces used are all published and committed to before the EOS Hash (public seed) is known to us. The nonces are visible in the Provably Fair modal found on the PvP Duel Page and can be seen before the Battle has begun or the public seed (EOS Hash) has been generated.

We also nonce the seed with the "Game mode", this is a precaution to ensure that different game modes (e.g. Case Battles and Unboxing) don't risk using the same exact seeds to produce exploitable results.

PUBLIC SEED (EOS HASH)

The public seed (EOS Hash) is known only when all of the players in the Battle have committed their bets. We achieve this by committing to an EOS Block that is not yet mined but will be in the near future, and we then use its hash as the public seed. This way, we can prove that we had no way of knowing what the seed would be in advance before the Battle starts.

SERVER SEED

The server seed is a random string which is generated for each player at the beginning of a new PvP Case Battle. We commit to this seed as soon as each player joins a Battle, and we immediately display the SHA256 hash of this seed. As soon as the rounds have all been played, we then reveal the unhashed version of the players' seeds. You can confirm that the server seeds for each player were unmodified and no manipulation was done on our end by comparing the original SHA256 hash (the one that was displayed at the beginning) with the revealed seed shown after. This can be verified independently in a programming language such as JavaScript, by applying the SHA256 hashing function to the revealed seed and comparing the output with the hash which was shown earlier. It can also easily be confirmed online using tools such ashttps://xorbin.com/tools/sha256-hash-calculator

INDEPENDENT VERIFICATION

Each unboxing result in the Battle can be verified independently using the algorithmic formula that we use to generate the result. 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. Just edit the code to pass in the three parts of the seed mentioned above (the EOS Hash, the server seeds and the nonces). These elements are all best retrieved from the Provably Fair popup dialog found on the PvP Duel page, as you can easily copy and paste each of them.

const crypto =require('crypto');// --- BEGIN: Fill these values// Hash (ID) of the mined EOS block in the future (assigned at the start of the game)const clientSeed ='0f2dc7fdc888572ac7ef496269ac60b3d8ce0cfe4c9a8f689a3e487cc69f0dcd';// Numeric ID of the specific PVP bet (used as the nonce)const pvpBetId =9999;// Server seed created when new game is createdconst serverSeed ='41c563068047ec52294131d39ae39ae7694e4baa998218b55a9e19f91b1f93e8';// --- END: Fill these values// With example values ^ it will output `Roll value: 35864249`// Turn this on if you want to see all the messagesconst verboseMode =false;// Get seedconst game ='PVP_BOX';const seed =getCombinedSeed(game, serverSeed, clientSeed, pvpBetId);// Get random roll value using provided informationconst max =1e8;const rollValue =getRandomInt({ max, seed }); console.log(`Roll value: ${rollValue}`);/** * 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('-')}

Note:Our Random Number Generator algorithm was updated on 19th Oct 2022.
For all games playedbefore PvP Round ID#201,649,576, please usethe previous versionfor independent verification instead.

Note: Our Random Number Generator algorithm was updated at 10:57 PM UTC, 28th September 2021
โ€‹For all games played before PvP Round ID #15829596, please use the previous version for independent verification instead.

If you have any further questions about our provably fair system, please do not hesitate to contact our support team for more help and information.

Did this answer your question?