Home

Awesome

<img align="right" width="150" height="150" top="100" src="./assets/no_step_on_snark.png">

huff-snark-verifier • ci

huff-snark-verifier offers an optimized Groth16 SNARK verification smart contract generator for EVM-based blockchains.

Warning This software is experimental, and it has not been audited. Please proceed with caution, and report any bugs in the Issues.

Gas Report

VERSIONGAS CONSUMED
Solidity (1 input)207009
Huff (1 input)188762
Solidity (2 inputs)215009
Huff (2 inputs)195354

Usage

To generate a Huff SNARK verification contract, you must first have a verification key created by snarkjs.

  1. Install huffv (Requires the rust toolchain to be installed.)
git clone git@github.com:whitenois3/huff-snark-verifier.git
cd huff-snark-verifier && cargo build
cargo install --path .
  1. Generate verification contract
huffv ./path/to/verification_key.json [-o <output_file_path>]
  1. Compile verification contract with huffc
huffc ./Verifier.huff -b

Testing

To run tests for this repo, you will need forge, huffc, and the rust toolchain installed.

# Regenerate test contracts
make tests

# Test sample Huff verification contracts against the Solidity version
forge test -vvv

Contributing

All contributions are welcome- create a fork and submit a PR! Please adhere to the PR template provided :smile:

You can test your changes to the template contract by regenerating the single-input & multi-input sample verifiers and running forge test. See the Testing section above.

To Do

License

Released under the GNU GPLv3 License. Go wild.