Skip to content

Instantly share code, notes, and snippets.

@loredanacirstea
Created January 15, 2019 21:23
Show Gist options
  • Save loredanacirstea/4028e4ebfcfad0e911e13c9a7d7f61dd to your computer and use it in GitHub Desktop.
Save loredanacirstea/4028e4ebfcfad0e911e13c9a7d7f61dd to your computer and use it in GitHub Desktop.
Initial idea

Tried to think of an easy to implement game idea after today's lunch discussion with @palango . So, this is what I got:

Team-based RockPaperScissors Idea:

  • 2 teams with unlimited number of participants
  • each game finalizes after 1 round
  • each team can pick one of rock, paper, scissors
  • each team picks the move based on a majority of votes of the team members
  • each team member sends the move & an off-chain payment

We need:

  • GameClient, which enables the user to choose a team_id and a move
  • GameGuardian Raiden node, which receives the move payments

Round:

  • team member proposes a move & sends a payment to the GameGuardian: hash(move || team_id || move_secret) - this will be the additional_hash of the Raiden balance proof; GameClient will validate the move, team_id, paid amount
  • the round has a known time limit for receiving & finalizing the off-chain transfers; no payments will be accepted after this.
  • after round finishes, each person sends the move, team_id & move_secret to the GameGuardian
  • GameGuardian calculates the winning team -> keeps a % of the funds for himself and then distributes the rest of the money to the winning team members.

We can have a constant paid amount for each move or, people can send whatever amount and then if their team wins, they can get a profit proportional to what they staked.

With this, we can test both many-to-one and one-to-many payments with some load on the network. Members don't need to have an open channel with the GameGuardian, they can send the payments through the network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment