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
Mines is a single-player game that progresses as players flip tiles on a 5x5 grid to collect candies.
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.
- It derives 25 hash values from the above values and shuffles them twice by assigning each number to its corresponding hash value and sorting them.
- The array is set as the bombs based on the number of mines the user selected before betting.
To verify a game result, you can use our external tool, available here.
createNums = (allNums, hash) => {
const nums = [];
let h = keccak256(toUtf8Bytes(hash)).slice(2);
allNums.forEach((c) => {
nums.push({ num: c, hash: h });
h = h.substring(1) + h.charAt(0);
});
nums.sort(function (o1, o2) {
if (o1.hash < o2.hash) {
return -1;
} else if (o1.hash === o2.hash) {
return 0;
} else {
return 1;
}
});
return nums;
}
const seedStringUtf8Bytes: Uint8Array = toUtf8Bytes(`${serverSeed}:${clientSeed}:${nonce}`);
const seed: string = keccak256(seedStringUtf8Bytes).slice(2);
const allNums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25];
let finalNums = createNums(allNums, seed);
seed = keccak256(toUtf8Bytes(seed)).slice(2);
finalNums = createNums(finalNums, seed);
const shuffleNums = finalNums.map((m) => m.num.num);
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.