Verifiable zk-mastermind

Verifiable zk-mastermind

We convert the zk-mastermind game into a zkVerify-compatible mode. The author of the original project is adam-maj -- referring to https://github.com/adam-maj/zk-mastermind

Verifiable zk-mastermind

Verifiable zk-mastermind

We convert the zk-mastermind game into a zkVerify-compatible mode. The author of the original project is adam-maj -- referring to https://github.com/adam-maj/zk-mastermind

The problem Verifiable zk-mastermind solves

Compared with the original game, we import the zkVerify library to handle the verification of any submitted guess. Once the player (act as the code breaker) orders to verify a previous guess, the zk proof and relevant public signals of that guess are displayed at the frontend, and a zkVerify session is triggered to verify that proof.

Our modification on the original repo comprises:

components/Game.tsx: the gameplay frontend, we created two additional textboxes to output the zk proof and list of public signals of a submitted guess once it requires verification.
context/GameContext.tsx: the React context holding game states, in which we applied the zkVerify hook to operate a proof verification by zkVerify.
context/useZkVerify.ts: the zkVerify hook, almost directly derived from the sample sudoku project.

Challenges we ran into

As zkVerify is still an emerging module, its library could not cover the majority of zk proof systems including popular ones like Kimchi. We ever selected and kept investigating on a Mina-version of zk-mastermind game until it was announced as a unsupported proof system.
The other major issue on which we are struggling is the intricacy of local testing due to currently unsatisfied local development environment by zkVerify. We paid great effort in the local environment configuration and testnet connection, and eventually managed it thanks to the help of zkVerify coordination staff at the stage.

Our video presentations are uploaded to our repo: https://github.com/repository23/hackathon2024warsaw/tree/develope/video_presentation

Tracks Applied (2)

Integration with zkVerify

We use ZkVerify to verify the groth16 proof of a guess in the original gameplay.

zkVerify

Comprehensive zkVerify, user-centric integration

Our project also remains the user-friendly game experience to interact with ZkVerify.

zkVerify

Discussion