# Momiji testnet Set membership/state transition using batched proofs in Noir ## Requirements - Noir is based upon [Rust](https://www.rust-lang.org/tools/install), and we will need to Noir's package manager `nargo` in order to compile our circuits. Further installation instructions for can be found [here](https://noir-lang.org/getting_started/nargo_installation). - Note: This version of the testnet was built using nargo 0.9.0; this is highly likely to change in future releases as Noir continues to grow. - The Javascript tests and contracts live within a hardhat project, where we use [yarn](https://classic.yarnpkg.com/lang/en/docs/install/) as the package manager. ## Development This repository contains an application that generates proofs of valid state transition and set membership using Pedersen-hash Merkle trees. This walkthrough will allow you to perform test transfers on a local testnet instance using a Solidity verifier. Start by installing all the packages specified in the `package.json` ```shell yarn install ``` After installing nargo it should be placed in our path and can be called from inside the folder. We will then compile our circuit and verifier. The contract tests will also run this step if needed. ```shell npm run compile ``` ### Solidity Verifier Once we have compiled our program, we can generate a Solidity verifier rather than having to use the verifier provided by `nargo`. This Solidity verifier can also be generated by calling `nargo codegen-verifier`. This will produce a Solidity verifier inside of the Noir project which you can then move into the correct `contracts` folder. It is important to note that if you change your circuit and want to verify proofs in Solidity you must also regenerate your Solidity verifier. The verifier is based upon the circuit and if the circuit changes any previous verifier will be out of date. ### Running tests The tests use the method of compiling the circuit using `nargo`. The tests also show how to complete proof verification using the Solidity verifier. ``` npm run test ``` You will also notice inputs in `Prover.toml` that satisfy the specified circuit constraints. This toml file will be automatically populated by the tests. You can run `nargo prove main` followed by `nargo verify main` to prove and verify a circuit natively. More info on the `nargo` commands can be found in the Noir documentation linked above or by running: `nargo --help` in your command line.