Skip to main content

Randomness banner

Achieving randomness on-chain presents significant challenges, as various parties could potentially exert control over the process.

Here is the list of possible attacks:

  • Users might attempt to manipulate transactions to favor their bets.
  • Miners could withhold block hashes or alter chain variables to influence the results.
  • The protocol itself might select a seed that ensures certain players win.

To address these concerns and establish a cheat-proof environment, we've developed a novel process that guarantees fairness and transparency.

Here's how it works:

  1. The engine generates a seed off-chain, hashes it, and sends the hash to the smart contract.
  2. Players join the game with a predetermined seed.
  3. Once all players have joined or game ends, the smart contract records a timestamp and triggers an event to notify the engine that the round is ready.
  4. The engine awaits the mining of the next block by miners.
  5. Miners mine the block.
  6. The engine sends the block hash along with the original seed to the smart contract.
  7. The smart contract verifies the correctness of the seed and combines it with the block hash to generate a random number.
  8. The outcome of the game is determined based on the random number generated, and the winner/winners receive their prize.

This process ensures that:

  • Users cannot manipulate transactions, as the outcome is determined after they join the game.
  • Miners are unable to cheat because they do not know the original seed until after the block is mined, rendering any attempts to manipulate the outcome futile.
  • The protocol cannot select a seed since the seed is sent before the round even starts in a hashed form, preserving the integrity of the game.

All data is available on the blockchain. You can retrieve the hashed seed, original seed, timestamp, block hash, and verify the outcome yourself. More on that in the Provably Fair section. By implementing this process, we've created an environment where cheating is virtually impossible, and games are fully verifiable for all participants.