πŸ”ŽProvably Fair

Fuyo leverages industry standard provably fair to ensure transparency and fairness to players

Provable Fair technology is used widely in the igaming industry and has become a standard on all casino, sports betting, and lottery platform, to ensure there are no manipulation to the results.

  • Fuyo generates random number before the game starts (E.g. 0 to 9),

  • Then, we hash the result with a secret seed by using SHA256

  • Share the hash publicly before the game starts

  • After the draw, reveal the secret seed and allow users to verify the draw was fair (via announcement).

Explanation how Provably Fair works

Here's an explanation of how "Provably Fair" systems work, where "randomness" determines outcomes. Components of Provably Fair:

  1. Seed Character:

    • This is a specific character (like "1" or "9") used to determine if a user's generated hash qualifies for the next game round. It's part of the randomness verification process.

  2. Seed String:

    • A clear, readable sentence stating the seed character, e.g., "The seed character is: "1". This string is crucial for users to verify the fairness after the game by checking the hash.

  3. Server Seed:

    • Generated before the game starts, this is a random sequence (like a hash) used in the calculation but kept secret until the game concludes. It adds unpredictability to the hash generation process that can't be manipulated and 100% fair.

How It Works with Step-by-Step Process:

  • Convert Seed String to UTF-8 Bytes:

    • Each character in the seed string (e.g., "The seed character is: "1") is converted into its UTF-8 byte representation. UTF-8 is a character encoding standard where each character can be represented by one to four bytes. For example, 'T' becomes 84 in ASCII/UTF-8.

  • Hash the Byte Sequence:

    • Use Keccak-256, a cryptographic hash function, to hash these byte decimals. Keccak-256 processes input through multiple rounds of bit manipulation to produce a fixed 256-bit (64 hexadecimal characters) output. This hash is unique for each unique input string, ensuring any change in the seed string will result in a completely different hash.

  • Generate Server Seed:

    • A server seed is created using strong random number generation, gathering randomness from various sources like "secret key", hardware RNG, CPU cycles and more. This seed is another layer of randomness.

  • Combine and Hash Again:

    • The hash from the seed string and the server seed are combined (with a space or some delimiter) and hashed once more using Keccak-256. This final hash is what's used to determine the game's outcome or if a user qualifies for a round.

  • Verification:

    • After the game, the server reveals the server seed. Players can then:

      • Reproduce the hash from the seed string.

      • Combine it with the now-revealed server seed.

      • Hash this combination to get the same final hash that was used to determine the game's outcome. If they match, it proves the game was not manipulated and 100% fair.

Why It's Fair:

  • Transparency: Players can verify results post-game.

  • Unpredictability: The server seed is unknown until after the game, making outcomes unpredictable before they happen.

  • Security: Any alteration or pre-knowledge of the hash would result in a different final hash, detectable by players.

This system ensures that the method by which 100% randomness is achieved is transparent and verifiable, thus "provably fair".

Technical explanation how Provably Fair works

Key components:

  1. Seed Character: This is the character that will be used to check if users generated hash is eligible for entering the next game(for example: β€œa”).

  2. Seed String: This is a normal sentence that states the seed character(for example: β€œThe seed character is: a”). Seed string will be enclosed to the user to check the provably after the game ends.

  3. Server Seed: This is a random value that generated before the game started, which will be enclosed with the seed string to check the provably after the game.

How it works:

  1. Compute the UTF-8 byte decimals of the seed string.

UTF-8 (Unicode Transformation Format 8-bit) is a variable-length character encoding system used to encode all characters in the Unicode standard. It represents each character as one to four bytes, where each byte is an 8-bit integer (0–255 in decimal). For above seed string β€œThe seed character is: a”, first character T has an ASCII value of 84. Similarly, every other character in the string is converted to its corresponding ASCII/UTF-8 value. Hence, the binary representation of the sequence is: 84, 104, 101, 32, 115, 101, 101, 100, 32, 99, 104, 97, 114, 97, 99, 116, 101, 114, 32, 105, 115, 58, 32, 97.

  1. Compute the Keccak-256 hash of the UTF-8 byte decimals above.

Keccak-256 is a cryptographic hash function based on the sponge construction, which processes input messages of arbitrary length to produce a fixed-length 256-bit output. It is widely used in blockchain systems, such as Ethereum, where it is the default hash function. It begins with an initialization phase where the internal state is set to all zeros, comprising 1600 bits organized into a 5Γ—5Γ—64 matrix. The absorbing phase follows, where the padded input message is divided into blocks of 1088 bits (rate), each XORed with the state and permuted. Padding ensures the input length aligns with the rate by appending a 1, followed by 0 bits, and ending with another 1. Based on above UTF-8 bytes decimals, the padded input message will be:

01010100 01101000 01100101 00100000 01110011 01100101 01100101 01100100 00100000 01100011 01101000 01100001 01110010 01100001 01100011 01110100 01100101 01110010 00100000 01101001 01110011 00111010 00100000 01100001 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001

Keccak uses a five-step permutation function, repeated for 24 rounds, including ΞΈ (Theta) for diffusion across rows, ρ (Rho) for bitwise rotations, Ο€ (Pi) for lane permutations, Ο‡ (Chi) for non-linear mixing, and ΞΉ (Iota) to add round constants. After absorbing all input, the squeezing phase begins, where the first 1088 bits of the state are output, and permutations are applied(ΞΈ -> ρ -> Ο€ -> Ο‡ -> ΞΉ, repeated for 24 rounds to ensure strong diffusion and mixing of the state). For Keccak-256, only the first 256 bits of the squeezed output are used as the hash value. The first 256 bits for above padded input message will be: 11d72d2fa98ede25df9660fc45293263c4994ead0161dc386506202b4cb52f8a. Keccak is computationally infeasible to find two different inputs that produce the same hash output, means if any small change in seed string above, it will compute totally different output from 11d72d2fa98ede25df9660fc45293263c4994ead0161dc386506202b4cb52f8a. In reverse, with 11d72d2fa98ede25df9660fc45293263c4994ead0161dc386506202b4cb52f8a it can ensure that the seed string never changed since the game started.

  1. Generate a server seed.

The server seed is generated cryptographically with strong random data.It gather entropy from various system sources like:

  • CPU cycle variations

  • Disk and network activity

  • Hardware RNGs

To seed a deterministic random bit generator (DRBG). The DRBG produces 32 random bytes, which convert into 64 hexadecimal characters, similar to Ethereum transaction hash. Let’s assume server seed is: a83184e9baff7cfd7019cab6121d02aff2100a69889862dfc4d2aa0e0a775268.

  1. Compute the Keccak-256 hash from the output from Step 2 and Step 3, with a space in between.

In above output, the input for Keccak-256 hash will be: β€œ11d72d2fa98ede25df9660fc45293263c4994ead0161dc386506202b4cb52f8a a83184e9baff7cfd7019cab6121d02aff2100a69889862dfc4d2aa0e0a775268”. Method compute is same as Step 2, the output will be: 601519a4b4a0b21bdefad6c17cddbb7cb87e8c5532c1eb8e0e02bcbae498a565. This will be the example final hash value that is enclosed publicly (with the server seed), before the game starts.

Last updated