Our work is a decentralized Niu Niu poker game backed by BSV blockchain technology. Leveraging its trusted and transparent method to deal cards, compare hands, settle bets in a provable fair manner, it allows players to enjoy the game itself at ease, without fear of underhandedness, theft of funds and unfairness.
Now please allow us to give a demonstration of the specific game implementation logic
- One player creates a room, the other player joins the room.
- Both players pick a large number. Then the hash of the large number, their public keys, the stake, and the deposit will be locked in a same smart contract, which is signed by both players and broadcast to the blockchain. To unlock this smart contract, a zk proof is needed to prove that the hash of one player's large number has won.
- Each player gets back the deposit in the smart contract using the original private large number. It contains a timelock here. If after a certain period of time, one player does not get the deposit back, the other player can take his or her deposit.
- After the previous step, both players know each other's original private large numbers and can now work out who the winner is and what the multiple is. The winner uses both player’s original private large numbers (private parameter), the winner's large number hash, and the multiple to generate the zk proof.
- The winner constructs the transaction to receive the prize. The inputs are the winner's large number hash, the multiple, and the zk proof, and the output is the winner's payout address. If some of these parameters are not constructed properly, scrypt will ensure that the transaction cannot be put on chain.
Log in or sign up for Devpost to join the conversation.