Has anybody working on a decentralized poker client?

I've been wanting to make a decentralized for over a year but have been busy with school. When I learned about bitcoin and how it's decentralized, p2p, and doesn't require a trusted 3rd party I thought that it would be awesome if someone could create a poker client to do that especially since the 2 biggest problems with poker clients today is the rake and the fact that the site might be cheating you, but if it were decentralized and made to not take a percentage of every pot like other sites.

Comments

  • IVI3T4LIVI3T4L Member Posts: 10
    I have been working on this a little bit, but my main problems in this project have been random number generation, the fact that poker events are faster than the blockchain generates blocks, and how to account for orphans in the blockchain.

    I hope I am wrong here, but a texas hold em type game would take hours for a hand to complete (assuming the random number generation could be done properly) if we want to make it fully distributed in the blockchain.

    Now i agree that this would be amazing and I for one would love to play poker on a fully decentralized platform. This would mean no rake (other than the ethereum fees). It would also mean no cheating other than collusion between players, but collusion would be less of a factor if there was a way of randomly matching players to each other.
  • sjenkinssjenkins Member Posts: 28
    The game could take place off the blockchain between peer-to-peer game clients but with the blockchain/contract used to verify the fairness of the game. In the following example a player need only trust their own client in order to trust the game. Collusion can't be ruled out, but only to the extent of players showing each other cards they can already see themselves.

    1. On the blockchain: The contract convenes a game, puts the game clients in touch with each other and issues chips in exchange for cash which it will hold. Players also pay a returnable deposit which they will forfeit if e.g. they "kick over the table" after losing.

    2. Off the blockchain: Each game client generates but does not broadcast a large block of random bytes. It's in the player's own interests that these bytes really are random.

    3. On the blockchain: Each game client sends a hash of its random number block to the contract.

    Now the game can proceed between clients without further interaction with the contract until the end.

    Every card for the entire game will be seeded using a few bytes from each of the players' random number supply. A card is dealt by all clients broadcasting their bytes for that card *except* for the player who is actually to see the card. Since only this player has all the bytes for the card, only this player can see it until they later reveal it by broadcasting their own bytes. (Obviously a card can be dealt in the open by just having all clients broadcast their bytes to begin with).

    As gameplay and betting proceed all clients produce a signed account of the events taking place. For example if the 231st thing to happen is that player 4 bets 25 chips then all players would broadcast a hash of 231/BET/4/25/[some-of-their-random-numbers].

    At the end of the game its back to the blockchain. The clients transmit their entire game transcripts including the signed accounts from the other players. They also transmit their formerly secret random number blocks. The contract verifies the random blocks against the hashes it was sent at the start, verifies the game transcripts against the random blocks, then cashes out the winners and returns deposits to all.
  • chris613chris613 Member Posts: 93 ✭✭
    @sjenkins? , while I have no interest at all in poker, I really appreciate your explanation of this simple approach to random numbers of this type. These clear examples of P2P clients using the blockchain only for co-ordination and verification are very valuable because many people are still confused about what types of code can be written in a contract and what must be programmed elsewhere.
Sign In or Register to comment.