Skip to content

eqlabs/aztec-memorygame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memory card game

This is a research project for understanding the Aztec network. The point is to create a PoC implementation of a simple ZK game.

Project status

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.

Original project plan

The project is a memory card puzzle game utilizing Aztec network's Zero Knowledge properties.

MVP example puzzle

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 phase

Research Noir, Aztec network, Aztec Connect, zk.money and available DeFi integrations.

Implementation Phase A - PoC

  1. Create Noir circuit for verifying puzzle solutions (pairs found)
  2. A verifier contract is deployed to Goerli
  3. Create a crude website which user uses to generate a new puzzle
  4. User plays at the website until a pair is found
  5. A Noir circuit is used for checking a (partial) solution to the puzzle
    1. It takes the following inputs:
      1. Full puzzle solution in flattened format: 2 1 1 2
      2. The pairs the user has found: for example 2 0 0 2 or then the full solution if all pairs are found
    2. It generates a proof based on the puzzle and user input
    3. The proof is sent to the verifier contract for verification

Implementation Phase B - Aztec Privacy Magic

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

Implementation Phase C - Making it Real + Publish

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.


Installation instructions

  1. git submodule update --init --recursive
  2. forge install
  3. npm install
  4. npm run test:full

About

A simple ZK game utilizing Aztec's Noir

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published