Skip to content

aragonzkresearch/zkRegistry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zkRegistry

⛔ DISCLAIMER: This is a proof of concept that is still a work in progress. 💀

Description

This repository contains a smart contract and sample client and server implementations of zkRegistry, an offchain sparse Merkle tree (SMT) kept in sync with an Ethereum smart contract via ZK proofs generated by Noir.

Components

Circuits

Noir circuits are provided under circuits and given suitable data may be tested via the nargo prove command, e.g.

cd circuits/single_smt_op && nargo prove

Smart contract

The zkRegistry smart contract keeps track of the SMT root and accepts SMT transactions in the form of ZK proofs. It depends on a verifier smart contract that must be regenerated every time the Noir source code is modified. To do this, run

./prep-contracts.sh

Assuming the environment variables PRIVATE_KEY (base-16 string) and RPC_URL are set, run

cd contracts && forge script script/OffchainRegistry.s.sol --rpc-url $RPC_URL --broadcast

The contract address will then be printed to stdout.

Server

Assuming guile-smt is installed, the server may be started by loading main.scm:

cd server && guile -l main.scm

Client

The client may be compiled using Cargo:

cd client && cargo build --release

Assuming the environment variables RPC_URL, PRIVATE_KEY, ZKREGISTRY_CONTRACT and ZKREGISTRY_URL have been set, a key may be added/updated/deleted by calling the insert, update or delete subcommand of the zkregistry_client binary together with a value (base-16 string), e.g.

./target/release/zkregistry_client insert "ab"

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published