This is a research project for understanding the Aztec network. The point is to create a PoC implementation of a simple ZK game.
This project has been abandoned. It was relying on Aztec functionalities which do not yet exist: there is no way to store the game solution privately. That would require some stateful network which supports Noir circuits - such network does not currently exist, but will be created by Aztec somewhere in the future.
The project has been implemented quite far but the important step about solution privacy is missing. You can run the proof system and run the UI which can also generate proofs. Note that the Solidity verifier contract generated by NPM package has some compatibility issues - use the verifier generated by Nargo if you want to verify proofs in an EVM contract.
Below is our original project plan.
The project is a memory card puzzle game utilizing Aztec network's Zero Knowledge properties.
Create a 2 times 2 memory puzzle with numbers instead of pictures. The board is visible but the items are hidden. The player can choose two cards to reveal - if they are the same, they are left revealed. A fresh puzzle looks like this:
0 0
0 0
Once all the pairs have been found, the puzzle looks for example like this:
2 1
1 2
Research Noir, Aztec network, Aztec Connect, zk.money and available DeFi integrations.
- Create Noir circuit for verifying puzzle solutions (pairs found)
- A verifier contract is deployed to Goerli
- Create a crude website which user uses to generate a new puzzle
- User plays at the website until a pair is found
- A Noir circuit is used for checking a (partial) solution to the puzzle
- It takes the following inputs:
- Full puzzle solution in flattened format:
2 1 1 2
- The pairs the user has found: for example
2 0 0 2
or then the full solution if all pairs are found
- Full puzzle solution in flattened format:
- It generates a proof based on the puzzle and user input
- The proof is sent to the verifier contract for verification
- It takes the following inputs:
Since phase 1 does not add any real privacy (the browser has all of the information), this phase is aimed at fixing that.
The puzzle is not sent along with the (partial) solution by the user. Preferably sent by someone else, or possibly even somehow stored in Aztec network by some other entity - or generated upon request somehow. Figuring out a way to accomplish this
Making the game actually real and playable. Creating stylized frontend and creating game assets. 2x2 was just for the test - a real game would be at least 4x4. Publishing the final project, and writing a blog post about it, as well as posting on social media to increase Noir awareness.
git submodule update --init --recursive
forge install
npm install
npm run test:full