:thought_balloon:
EZKL
Easy Zero-Knowledge Inference
ezkl is a library and command-line tool for doing inference for deep learning models and other computational graphs in a zk-snark (ZKML). It enables the following workflow:
- Define a computational graph, for instance a neural network (but really any arbitrary set of operations), as you would normally in pytorch or tensorflow.
- Export the final graph of operations as an .onnx file and some sample inputs to a
.jsonfile. - Point
ezklto the.onnxand.jsonfiles to generate a ZK-SNARK circuit with which you can prove statements such as:
"I ran this publicly available neural network on some private data and it produced this output"
"I ran my private neural network on some public data and it produced this output"
"I correctly ran this publicly available neural network on some public data and it produced this output"
In the backend we use Halo2 as a proof system.
- If you have any questions, we'd love for you to open up a discussion topic in Discussions. Alternatively, you can join the ✨EZKL Community Telegram Group💫.
resources 📖
| docs | the official ezkl docs page |
| tutorial | end-to-end tutorial using pytorch and ezkl |
| notebook | end-to-end tutorial using pytorch and ezkl in a jupyter notebook |
cargo doc --open |
compile and open the docs in your default browser |
Getting Started ⚙️
building the project 🔨
Note that the library requires a nightly version of the rust toolchain. You can change the default toolchain by running:
rustup override set nightly
After which you may build the library
cargo build --release
A folder ./target/release will be generated. Add this folder to your PATH environment variable to call ezkl from the CLI.
# For UNIX like systems
# in .bashrc, .bash_profile, or some other path file
export PATH="<replace with where you cloned the repo>/ezkl/target/release:$PATH"
Restart your shell or reload your shell settings
# example, replace .bash_profile with the file you use to configure your shell
source ~/.bash_profile
You will need a functioning installation of solc in order to run ezkl properly.
solc-select is recommended.
Follow the instructions on solc-select to activate solc in your environment.
Repos
The EZKL project has several libraries and repos.
| Repo | Description |
|---|---|
| @zkonduit/ezkl | the main ezkl repo in rust |
| @zkonduit/pyezkl | helper functions in python for processing onnx files |
| @zkonduit/ezkl-docs | official ezkl docs |
Contributing 🌎
If you're interested in contributing and are unsure where to start, reach out to one of the maintainers:
- dante (alexander-camuto)
- jason (jasonmorton)
More broadly:
-
See currently open issues for ideas on how to contribute.
-
For PRs we use the conventional commits naming convention.
-
To report bugs or request new features create a new issue within Issues to inform the greater community.
Release files for ezkl-lib 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 118.4 MB
Release files / ezkl_lib-0.3.0-cp37-abi3-win_amd64.whl
| Download URL | ezkl_lib-0.3.0-cp37-abi3-win_amd64.whl |
|---|---|
| Size | 9.9 MB |
| Tags | CPython 3.7 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
2d357614f1ceb68cd977045850d751867c54973b68f65598c853732a1c06370b
|
|
BLAKE2b-256 checksum How to use checksums |
96faf9d7dd91127a961c673cf7f3cf283ef967182182552e89f03d46bb9e9b11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / ezkl_lib-0.3.0-cp37-abi3-win32.whl
| Download URL | ezkl_lib-0.3.0-cp37-abi3-win32.whl |
|---|---|
| Size | 9.0 MB |
| Tags | CPython 3.7 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
e8f33d34378e40b0da2b661bd323ddbe5fc2b76a5301daaf7f3a224ae69a86b5
|
|
BLAKE2b-256 checksum How to use checksums |
970c8ae52aecb84271562860109a43a9ed076331ad806aeeffa7fad6eb34948d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / ezkl_lib-0.3.0-cp37-abi3-musllinux_1_2_x86_64.whl
| Download URL | ezkl_lib-0.3.0-cp37-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 13.8 MB |
| Tags | CPython 3.7 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
81039501dbb8e56752539444c0409885b3814ef56871620095d903422799379f
|
|
BLAKE2b-256 checksum How to use checksums |
82db0a4bf7f68b66a3d37b342b8b0af2bcc98648cf6f5e4421c9092aa1c947fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / ezkl_lib-0.3.0-cp37-abi3-musllinux_1_2_armv7l.whl
| Download URL | ezkl_lib-0.3.0-cp37-abi3-musllinux_1_2_armv7l.whl |
|---|---|
| Size | 12.8 MB |
| Tags | CPython 3.7 Linux musl 1.2+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
acb9495ced45b25851d21b3767578b7098c46360cc2ff0efe3418f0253458b49
|
|
BLAKE2b-256 checksum How to use checksums |
e1f93c67301d2e165ba3f14c4ebb2196aed41086053a0fdf6c369cceae99f502
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / ezkl_lib-0.3.0-cp37-abi3-musllinux_1_2_aarch64.whl
| Download URL | ezkl_lib-0.3.0-cp37-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 12.9 MB |
| Tags | CPython 3.7 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
19a1425f2bc979f4b661362560dfd75ded8a22a46f654fc0d72323d5b521ad85
|
|
BLAKE2b-256 checksum How to use checksums |
7ed38ff3630e12f4fbb353db0db985d7507c9f79b1c6b07709da16145a736800
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / ezkl_lib-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | ezkl_lib-0.3.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 13.6 MB |
| Tags | CPython 3.7 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
d9c4255d629e184cab7d29616e7aa335b2084f842d10552a622df61daedd1b16
|
|
BLAKE2b-256 checksum How to use checksums |
c57d71e4bb36d556db1aa87c9db2719c8a00f51a549047071970c22aa208ad3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / ezkl_lib-0.3.0-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
| Download URL | ezkl_lib-0.3.0-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl |
|---|---|
| Size | 14.0 MB |
| Tags | CPython 3.7 Linux glibc 2.17+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
9582a6efb70d99d8013897be0acc62c7c41af264bcaaf76c7fef7f48584eb6a8
|
|
BLAKE2b-256 checksum How to use checksums |
f69319ea7e40090f7ade429c00bafa710418662e20c5f0e28a59981405cc934d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / ezkl_lib-0.3.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | ezkl_lib-0.3.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 21.1 MB |
| Tags | CPython 3.7 abi3 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
dad319eda6476af0290b3652c645f490106e65db4467a4fb9e81aa6e017ec068
|
|
BLAKE2b-256 checksum How to use checksums |
514791236f214f7fc731287435e2ec8d946c6b3d5e99f5376a9f576673e08c27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|
Release files / ezkl_lib-0.3.0-cp37-abi3-macosx_10_7_x86_64.whl
| Download URL | ezkl_lib-0.3.0-cp37-abi3-macosx_10_7_x86_64.whl |
|---|---|
| Size | 11.2 MB |
| Tags | CPython 3.7 abi3 macOS 10.7+ x86-64 |
|
SHA-256 checksum How to use checksums |
3c1a65ca46a338e97afca5c038c7b5925d4e6e96ecbbba8c5af90bcc38d23df3
|
|
BLAKE2b-256 checksum How to use checksums |
8d681d68aba7abb8fae775d4573d399d2dad8d106fc37529b9bb589bb9d243b0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.1 CPython/3.11.4
|