Skip to content

Latest commit

 

History

History
17 lines (16 loc) · 1.61 KB

VRF.md

File metadata and controls

17 lines (16 loc) · 1.61 KB

Website's VRF Mechanism:

  • A random number, beta, is generated using a VRF.

  • The modulo of beta divided by the size of the revolver is hashed with a random key (salt) and published as part of the newGame transaction made by the bot.

  • When the game ends, the bot sends the following as part of the endGame transaction:

    • beta: The randomly generated number in hex.
    • salt: The key concatenated with the modulo of beta and the revolver size before generating the SHA-256 hash.
    • publickey: The public key of the VRF.
    • proof: The generated proof for this specific random number.
    • alpha: The input message to the VRF, created as UNIX time + [array of each player's bets].
  • Each invocation of the VRF is provided with a seed, randomly generated by the bot. This seed doesn't need to be revealed for verification.

  • Using publickey, proof, and alpha, anyone can verify that beta is the correct VRF hash. With beta verified, the modulo of it divided by the size of the revolver, concatenated with salt, generates a SHA-256 hash. This hash should match the one passed to newGame, proving that the bullet's chamber index was randomly generated at the start of the game.

  • New Game

    • _hashedBulletChamberIndex telegram bot feeds value to New Game
  • End Game

    • string[] publickey, alpha, proof, beta, salt