Skip to content

kashepavadan/zero-knowledge-puzzles-answers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zero Knowledge Puzzles Solutions

Tutorial problems meant to teach ZK SNARKs with Circom, created by RareSkills.

I've decided to add my own solutions since many of the solution sets I've seen on GitHub are incorrect and underconstrained. Each solution includes the associated r1cs file printout in the comments (or the number of constraints) so you can see the constraints created by the code. The solutions have also been verified with Circomspect.

If you catch a mistake, please submit a PR with the corrections!

Original is here.

You should run the following installation in addition to the steps below to generate and check constraints:

npm install snarkjs

Installation

Rust

Circom compiler requires rust . For MacOs and Linux users,

curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

Circom compiler

Clone the circom repository

git clone https://github.com/iden3/circom.git

Enter the repository

cargo build --release

Install

cargo install --path circom

Libraries

npm install 

Solving puzzles.

Write your solution .

Then run the following command

yarn test ./test/<TestName>.js

Suggested Order for the Puzzles.

Relevant links

Play Sujiko Game using circom proofs

Congrats on completing all the challenges, you can play Sujiko Game .

  • Go to Frontend directory
  • Install libraries using
npm install
  • Then, start the front end:-
npm run dev

Troubleshoot

Mac users getting this error on circom installation

error: linking with `cc` failed: exit status: 1

Install xcode , then restart your mac .

xcode-select --install

Contributors

About

RareSkills' Circom challenges with my solutions.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 41.8%
  • Circom 27.7%
  • Solidity 16.9%
  • TypeScript 8.6%
  • Shell 3.3%
  • CSS 1.7%