Zero knowledge puzzles to learn writing circuits in circom lang.
Circom compiler requires rust . For MacOs and Linux users,
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
Clone the circom repository
git clone https://github.com/iden3/circom.git
Enter the repository
cd circom
cargo build --release
Install
cargo install --path circom
npm install
Write your solution .
Then run the following command
yarn test ./test/<TestName>.js
For the Compile
level, I had to do some personal changes on the script.sh
file to make it all work, since I'm running on Windows 10.
I used gitBash to run the script like so . script.sh
and I had to install snarkjs globally as well.
npm i -g snarkjs@latest
Make sure to have the wget package installed (https://www.youtube.com/watch?v=cvvcG1a7dOM&t=153s)
And I had to take out the verifier
contract located in the Sujiko
folder and move it to a newly created contracts folder in order to compile with hardhat and update the artifacts.
I changed the contract name, the file name, the sh file and the Compile.js
to Groth16Verifier.sol
to be more specific.
Then I compiled the contracts with npx hardhat compile
to create the artifacts and ran the tests with yarn run compile
- Addition
- Equality
- NotEqual
- Poseidon
- ForLoop
- Power
- Range
- Salt
- QuadraticEquation
- Compile
- Sudoku
- Sujiko
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
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