Provably Fairness
We operate provably fair systems to ensure that players can verify and trust that their results are fair and not manipulated.
We apply the widely known algorithm for encryption, keccak-256, which is a SHA-3 standard, and the CSPRNG for initial random number generation, to guarantee transparency in all processes and results.
Game codes and validation
Ultimate Dice is similar to the classic dice game but with the difference that you can set the range for predictions in two places: the minimum value and the maximum value.
To ensure the security and fairness of the game result generation algorithm, we provide the ability to change the server seed and client seed.
Users can verify the fairness of the game result through a combination of the server seed, client seed, and nonce input.
Game result generation algorithm:
- The server seed, client seed, and nonce are hashed using keccak256.
- The resulting value is converted into a BigNumber format, and then it is used in the game result by taking the remainder when divided by 10,000, which falls within the required range for a random value in the game.
const seedStringUtf8Bytes: Uint8Array = toUtf8Bytes(`${serverSeed}:${clientSeed}:${currentNonce}`);
const hashValue: string = keccak256(seedStringUtf8Bytes);
const resultRandomNum: number = new BigNumber(hashValue).mod(10000).toNumber();
The server seed is the initial value of a random number generated and kept secret by the game server.
The client seed is a random sequence made up of characters chosen by the user (or generated automatically by the user's browser).
The nonce is a value used during the process of generating the game's results by combining the server seed and client seed. This number starts at 0 initially and increases by 1 after each bet.
Algorithm Characteristics
- Ensuring the Randomness of the Initial Seed: We guarantee randomness by generating the initial seed (Genesis) using Linux's /dev/urandom source, which is based on a Cryptographically Secure Pseudo-Random Number Generator (CSPRNG).
- Using a Widely Recognized Public Domain PRNG: We convert the initial seed into a seed using the SHA-3 standard keccak256 hash algorithm.
- Providing a Fair Seed: The client seed and nonce values are disclosed to the user, and the client seed can be changed at any time.
- The server seed is encrypted using the AES algorithm and stored in an independent database. The hash value of the server seed, obtained through keccak256, is disclosed to the user.
- Using Salt Values to Ensure Fairness: Each time a game is played, the nonce value automatically increments by 1 and is used as the salt value for hashing to create RNG random numbers for single-play.
- When the client seed is reset, the nonce value is also reset. This means that neither the user nor the operator can arbitrarily change it.
Providing Games with Verifiable Fairness:
Changing the client seed also changes the server seed, and the previous server seed is disclosed. Anyone can verify whether previous games were conducted using fair RNG random numbers by hashing with the previous server seed.
Seed Creation Stage
A random number for seed creation is generated using CSPRNG. Here, the CSPRNG technique utilizes the built-in library of nodeJS, crypto.randomBytes.
crypto.randomBytes is a function based on OpenSSL's RAND_bytes, and RAND_bytes utilizes the CSPRNG of Linux, /dev/urandom.
The client seed is a combination of alphanumeric characters (both uppercase and lowercase) with a length ranging from 10 to 32 characters, while the server seed consists of a 64-character hexadecimal value.
The nonce is a number that increases by one with each game round and acts as a salt for randomness.
The client seed and nonce are disclosed to the user, while the hashed server seed is disclosed to the user hashed by keccak256.
RNG Creation Stage
The server seed, client seed, and nonce are combined and hashed using keccak256 to create the RNG random number.
The generated RNG random number is applied to the game.
Generate a random number with a value in the range of 0 to 1.
Verification Stage
The client seed can be changed at the user's discretion. When changed, the server seed also changes, and the previous server seed is disclosed.
The new server seed is the value hashed using keccak256 of the previous server seed.
The client seed can be changed at any time by the user.
When the client seed is changed, the previous server seed is disclosed without hashing. Users can use this to combine the client seed, nonce, and server seed to confirm whether the previous game used a fair RNG random number.