Skip to content

0xPhaze/ZeroLink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZK privacy pools written in Noir and Solidity.

Project layout:

.
├── README.md
├── circuits - "Noir circuits"
│   ├── Nargo.toml
│   ├── contract
│   │   └── ZeroLink
│   │       └── plonk_vk.sol - "Generated UltraPlonk Solidity verifier"
│   └── src
│       └── main.nr - "ZeroLink Noir circuit"
├── foundry.toml
├── src
│   └── ZeroLink.sol - "ZeroLink Solidity contract"
└── test
    └── ZeroLink.t.sol - "Solidity tests"

Installation

Foundry

Install foundry.

curl -L https://foundry.paradigm.xyz | bash
foundryup

Install foundry dependencies.

forge install

Noir

Install nargo and switch to latest nightly version.

curl -L https://raw.githubusercontent.com/noir-lang/noirup/main/install | bash
noirup -n

Noir Circuits

Navigate to the circuits directory.

cd circuits

Test

Run the tests in circuits/src/main.nr.

nargo test

Compile

Compile the main circuit.

nargo compile

Prove

Create a proof with dummy public & private data from Prover.toml.

nargo prove

This creates the proof file circuits/proofs/ZeroLink.proof.

Verify

The verification of the proof (ZeroLink.proof) and the verifier public input (Verifier.toml) can be tested.

nargo verify

Generating Solidity Ultra Plonk Verifier

A proof for the circuit can be verified in Solidity.

nargo codegen-verifier

This creates the Solidity Ultra Plonk verifier (circuits/contract/ZeroLink/plonk_vk.sol) specific to the circuit.

Smart Contract Verification

Navigate to the project's root directory.

Solidity Testing

Run the tests in ZeroLink.t.sol.

forge test

Important

The tests in ZeroLink.t.sol contain hardcoded proofs (for efficiency) that need to be updated in the case that the verification key (plonk_vk.sol) changes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages