In this project, we're developing a Halo2 implementation of the Zero Gravity project as part of a grant from the Ethereum Foundation.
To get started:
- Install Rust
- Install version 1.12.2 of HDF5
- For EVM commands: Install version 0.8.17 of
solc:(hash svm 2>/dev/null || cargo install svm-rs) && svm install 0.8.17 - For EVM commands: Install Anvil
- Run the tests:
cargo test - Run the benchmarks:
cargo bench - Build the binaries:
cargo build --release
Two models trained on MNIST are checked-in and located in models.
To add your own models, follow the steps from the BTHOWeN-zero-g readme to train a model, convert it to HDF5 and optionally export the MNIST dataset to data/MNIST/png/.
You can install the command line tool by running cargo install --path ..
Then, run zero_g --help for documentation of the tool.
For examples on how to use it, see test_cli.sh.
If you want to verify WNN predictions in your own circuit, you can do so by using the WnnChip implemented in the zero_g crate.
Run cargo doc --open to open up the documentation, and see tests/using_zero_g_as_a_library.rs for an example.