This repository is used to test and learn Noir circuits for zero-knowledge proof (ZKP) development.
Noir is a domain-specific language for creating zero-knowledge proofs. This project contains custom circuits to experiment with and understand ZKP concepts. The project uses Nargo for circuit development and Barretenberg as the zero-knowledge proof system backend for proof generation and verification.
.
├── Nargo.toml # Noir project configuration
├── Prover.toml # Prover configuration
└── src/
└── main.nr # Main circuit implementation
- Nargo - The Noir package manager
- Barretenberg - Zero-knowledge proof system backend
# Runs all tests
nargo test# Checks circuit for any errors
nargo check# Compiles circuit to ACIR (Abstract Circuit Intermediate Representation)
nargo compile# Compiles circuit and creates a witness
nargo execute# Generates a verification key to verify the proof
bb write_vk -b ./target/custom_noir_circuit.json -o ./verification_keys# Generates a verification key to generate the verifier contract
bb write_vk --oracle_hash keccak -b ./target/custom_noir_circuit.json -o ./verification_keys# Generates a verifier smart contract
bb write_solidity_verifier -k ./verification_keys/vk -o ./contracts/Verifier.sol# Generates a proof using the circuit, witness and verification key
bb prove -b ./target/custom_noir_circuit.json -w ./target/custom_noir_circuit.gz -k ./verification_keys/vk -o ./proofs# Verifies the proof using the verification key
bb verify -k ./verification_keys/vk -p ./proofs/proof -i ./proofs/public_inputs