Peergame uses a secret key with SHA-256 to generate a chain of 1,000,000 hashes, and each game seed’s hash equals the previous game seed.
Next game’s seed
----- SHA256 Hash ---⤍
Current game’s Seed
Random number for the game result is derived from a hash of the current game seed + all participated transaction ID in each game. Then the random number is divided by 6, which results in six different race scenarios. Please see the image below.
Hash (current game’s seed + users’ bet TxIDs) = Random number
Game result = Random number % mod 6 = 0 ~ 5
1. 100th game’s seed is:
2. Hash’ed 100th game’s seed becomes the current (99th) game’s seed
3. Combine the current game’s seed with all TxIDs that users made in the 99th round
4. Hash (current game’s seed + TxIDs) is divided by 6
= 0 (Game result)