/lotto-game

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0

lotto-game

The lotto game is a simple demonstration of the Orchid probabilistic nanopayment mechanism called lottery tickets.

Setup

  • In separate terminals, run two copies of the lotto game.
  • Set the first player's name. The Orchid account's L1 funder L2 payment identity will be generated by hashing the player's name.
  • Navigate to https://account.orchid.com and fund the Orchid account
  • Perform the same naming/funding for the second player
  • Set the ticket face value and probability for each player as prompted.
  • For each player, copy the opponent code and enter it into the other player's copy of the lotto game using the "opponent" command

Gameplay

The players may take turns generating tickets using the "pay" command. This generates a lottery ticket with the previously specified win probability and face value to be generated and serialized. Copy the serialized ticket from the paying player and enter it into the receiving player's copy of the game using the "claim" command. The "claim" command decodes the ticket, checks whether it is a winner. If the ticket is a winner, it is submitted to the blockchain.

That's it. Have fun!