This repository implements voice classification model with torch and ezkl.
├── Verifier.sol # zkp verifier contract
├── data
│ ├── test # test dataset
│ └── train # train dataset
├── input.json # sample trainning data
├── kzg.srs # SNARK string
├── model.py # torch model implementation
├── network.onnx # torch model exported to .onnx format
├── pk.key # proving key
├── settings.json # ezkl build setting
├── vk.key # verification key
This model is not that accurate becuase of simplified model implementation (due to ezkl proving limitation) and small training data set.
- ezkl@1.13.2
- solc-select
- python@3.11.5
# ezkl
# if below curl doesn't work, download executable from https://github.com/zkonduit/ezkl/releases
curl https://hub.ezkl.xyz/install_ezkl_cli.sh | bash
# solc-select
brew install solc-select
solc-select install 0.8.17
solc-select use 0.8.17
# install pip requirements
python3 -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt
1. export model
# export simple model to .onnx file
python model.py
# or export complex model to .onnx file
python model_complex.py
2. compile model
This generates Verifier.sol file with a error.
# compile .onnx file to circuit and verifier contract
./run.sh
3. start api server