Home

Awesome

halo2-zk-email

Email verification circuit in halo2.

Disclaimer

DO NOT USE THIS LIBRARY IN PRODUCTION. At this point, this is under development not audited. It has known and unknown bugs and security flaws.

Features

halo2-zk-email provides a library and a command-line interface for an email verification circuit compatible with the halo2 library developed by privacy-scaling-explorations team.

Requirement

<!-- Note that we previously recommended rustc 1.68.0-nightly (0468a00ae 2022-12-17) and cargo 1.68.0-nightly (cc0a32087 2022-12-14), but those had package errors with the latest version. -->

Install solc (Mac instructions):

brew tap ethereum/ethereum
brew install solidity

Installation and Build

You can install and build our library with the following commands.

git clone https://github.com/zkemail/halo2-zk-email.git
cd halo2-zk-email
cargo build --release

Usage

You can open the API specification by executing cargo doc --open.

Test

You can run the tests by executing cargo test --release.

CLI

You can install CLI zkemail to prove and verify emails as follows: cargo install --path .

To generate a proof and verify it on EVM, do:

cargo build --release
zkemail gen-params --k 18
zkemail gen-keys
zkemail gen-evm-verifier
zkemail evm-prove
zkemail evm-verify

To generate regex files for a new decomposed regex definition. do:

zkemail gen-regex-files --decomposed-regex-config-path new_regex_file.json --regex-files-prefix new_regex

WASM prover on browser

You can generate a proof on browser with our wasm prover. For more information, please see examples/web-client/README.md.