Welcome to our hackathon project backed by RockawayX!! We've developed a simple, incomplete information game based on the RISC-0. This game is a fun way to challenge your friends and test your guessing abilities.
We also won one of the bounties from Risc-0 during the ZK-hack event in Lisbon.
First, make sure rustup is installed. This project uses a nightly version of Rust. The rust-toolchain
file will be used by cargo
to automatically install the correct version. To start the game, run the following command:
cargo run -r
In this game, each player uses his/her 2 hands (i.e. 2 thumbs). The total number of thumbs in the game equals 2 * number_of_players
. The goal is to be the first player to have zero hands by correctly guessing the number of lifted thumbs in each round. After each correct guess you can pull out one
hand from the game.
- At every round each player (i.e. server and player) commits to a choice by lifting 0, 1, or 2 thumbs.
- They simultaneously commit to their guesses where they are guessing the total number of lifted thumbs.
- Players who guess correctly will pull off one hand (note: in the next round the number of thumbs decreases).
- The game continues until someone pull of both hands from the game, making him/her the winner.
The player ensures that server isn't cheating using the check_receipt
function. This function verifies that the
receipt is valid and was generated by the correct binary file.
Then the check_receipt
function checks that the has in
the journal
match the hash of the secret guess provided
by the server at the beginning of each round.
To play the RISC-0 Ting-Tong, follow these steps:
- Run
cargo run -r
- Wait for server to commit to it's guess and choice.
- Enter you choice and guess.
- Wait for verification and evaluation of a round.
- After verification and evaluation the score of a round will be printed out and if you or server (or both) guessed the correct number of lifted thumbs in a round your score is substracted by 1 (simulating pulling of a hand from the game).
- Process repeats from the 2. point until some of you reach
score=0
Enjoy playing the RISC-0 Ting-Tong and may the best "guesser" win!