Skip to main content
All CollectionsProvably Fair
Provably Fair - Commitment Schemes
Provably Fair - Commitment Schemes
Updated over a week ago

What is a commitment scheme:

A commitment scheme is a function that allows a player and the platform to securely commit to a chosen secret value while keeping it hidden from others.

These values can be revealed afterward so third parties can check that the commitment agrees with the value revealed. A commitment scheme ensures that the casino is verifiable.

A commitment scheme has two phases, a Commit and Reveal phase.

Commit Phase:

The goal of the commit phase is to commit/lock up certain values created by the player and operator to generate game outcomes.

In a simplified explanation, 3 values are committed and used to generate the output of a game. Once values are committed, they cannot be changed until the reveal phase. During commitment, hashing is carried out to prevent tempering.

  1. Active Client Seed

  2. Active Server Seed (Unhashed)

  3. Nonce

Output = Commit(Active_Client_Seed, Active_Server_Seed, Nonce)

Active Client Seed: is unhashed, and it is a value determined by the player.

Active Server Seed (unhashed): is kept secret, and created by the server. This secret value is hashed. Only the hashed value is shown to the operator and player.

Nonce is originally set to 0 because no game is played. It will increase with every gameplay.

A combination of these 3 variables ensures that the output of the commit is always different

Reveal Phase:

In the reveal phase, the goal is to reveal the un-hashed server seed. With the un-hashed seeds and nonce known, the user can then verify his or her result.

If a player would like to verify his or her results, the player will first need to rotate his server and client seed pair.

When this is done, the platform will un-hash and display the previously active server seed. Now, the players and operator and any third party will know all of the 3 information, client seed, server seed, and nonce.

By inputting the known Client seed, Server Seed, and the Nonce of the round, we will always be able to prove the results/outcome of the particular game and round.

Server Seed

The server seed is generated by your system as a random 64-character hex string. This seed undergoes SHA-256 hashing processes. The hashed value is displayed. Hashing serves two purposes:

  1. Preventing cheating: It is computationally impossible for a user to find the original unhashed server seed from the hash (first pre-image resistance), preventing players from cheating.

  2. Preventing manipulation: It is computationally impossible to find two same unhashed input that give the same hashed output given the collision resistance property of SHA-256, preventing the operator from cheating the player.

Only when the game is complete and the user rotates the client seeds, the casino will then unhash the server seed for verification.

Client Seed

The client seed belongs to you, the player to ensure that you influence the randomness of the outcome of every game.

Initially, the client seed is randomly generated for you by your browser, however, you are encouraged to edit the client seed to a value of your preference. This ensures that you as a player will have a say in the outcome of the game result.

Nonce

In cryptography, the Nonce refers to “number once”. It is a number that increases in value every time a new bet is placed with the same set of Server and Client seeds.

This ensures that the combination of server seed, client seed, and nonce is different in every game, and the output of the commitment scheme is different.

Read more about how these values are implemented in code.

Did this answer your question?