Solving the Trust Issue with Online Gambling
Provably Fair lets you independently verify every game result using public algorithms and seeds.
The core of provably fair is the player's ability to prove and verify that results are fair and untampered. This is achieved through a commitment scheme together with cryptographic hashing.
The commitment scheme ensures players influence the generated result; cryptographic hashing ensures the platform stays honest to its commitment. Together they form an auditable, reproducible online gambling environment.
This can be simplified to:
fair result = operators input (hashed) + players input
Random Number Generation
For each verifiable bet, the client seed, server seed, nonce and cursor are used as input parameters for the random number generation function which utilizes the HMAC_SHA256 cryptographic hash function to generate bytes which are then used as the foundation for our provably fair random result generation.
// Random number generation based on following inputs: serverSeed, clientSeed, nonce and cursor
function byteGenerator({ serverSeed, clientSeed, nonce, cursor }) {
// Setup cursor variables
let currentRound = Math.floor(cursor / 32);
let currentRoundCursor = cursor;
currentRoundCursor -= currentRound * 32;
// Generate outputs until cursor requirement fullfilled
while (true) {
// HMAC function used to output provided inputs into bytes
const hmac = createHmac('sha256', serverSeed);
hmac.update(`${clientSeed}:${nonce}:${currentRound}`);
const buffer = hmac.digest();
// Update cursor for next iteration of loop
while (currentRoundCursor < 32) {
yield Number(buffer[currentRoundCursor]);
currentRoundCursor += 1;
}
currentRoundCursor = 0;
currentRound += 1;
}
}
Server Seed
The server seed is generated by our system and is a random 64 character hexadecimal string. Before you place a bet, we provide you with the encrypted hash of that server seed. We provide the encrypted form of the server seed to ensure that the casino operator cannot change the unhashed server seed and prevent players from calculating results in advance.
To reveal the server seed from its hashed version, the player must rotate the seed which triggers the replacement of the old seed with a newly generated one.
After rotation and disclosure, open the Unhash Server Seed page, enter the 64-character hexadecimal hash from that round, and query the disclosed corresponding server seed plaintext (cannot reverse lookup via hash before rotation/disclosure); you can also view the current pair and rotation in the in-game fairness modal Seeds tab.
Client Seed
The client seed belongs to the player and is used to ensure the player can influence the randomness of the generated result. Without this part of the algorithm, the server seed would have complete control over the outcome of every bet.
All players are free to edit and change their client seed regularly to create a new chain of random results. This ensures the player has full control over the generation of the result, similar to cutting the deck at a real casino.
When registering, your browser generates a client seed for you to ensure your initial experience on the site is smooth. While this randomly generated client seed is considered suitable, we strongly suggest that you choose your own seed so that your own influence is incorporated into the randomness; you can change it in the in-game fairness modal.
Nonce
The nonce is simply a number that increments with every bet. Due to the nature of the SHA256 cryptographic function, this creates a completely new result each time, while still having the ability to generate a new client seed and server seed pair.
The implementation of the nonce ensures we remain committed to your client seed and server seed pair, while generating new results for each bet.
Third-Party Verification
All QKG Originals games on the QKG platform can be verified on the Calculation page, or through third-party websites; some sites open-source their verification process. You can search on your own, or refer to: