Skip to main content

PicoZK library & compiler for writing zero-knowledge statements

Project description

PicoZK

Integrated, Efficient, and Extensible Zero-Knowledge Proof Engineering


Installation

You can install the library from PyPI using pip install:

pip install picozk

Or, clone the repository and then install with pip install (This library requires Python3):

git clone git@github.com:uvm-plaid/picozk.git
cd picozk
pip install .

If you want to run the examples, you'll need to install some extra Python packages (which are optional and are not required to install the core library). These dependent packages can be done by running the command pip install ".[examples]".

Usage

To generate a zero-knowledge (ZK) statement, write a Python program that uses the PicoZK library, and then run the program to generate the statement. For example, the following program corresponds to a ZK statement that the prover knows a number x such that x + x * x is 30:

from picozk import *

with PicoZKCompiler('picozk_test'):
    x = SecretInt(5)
    z = x + x * x
    assert0(z + -30)

Running this program results in three files:

  • picozk_test.rel: the relation, which is the statement itself (known to both prover and verifier)
  • picozk_test.type0.ins: the instance, which holds public information (known to both prover and verifier, always empty in our setting)
  • picozk_test.type0.wit: the witness, which holds secret information (known only to prover)

These files can be used to generate a ZK proof using any backend compatible with the SIEVE intermediate representation (IR) - for example, the EMP Toolkit.

Licensing and Acknowledgments

PicoZK is made available under the MIT License.

DISTRIBUTION A: Approved for Public Release. Distribution is Unlimited. This material is based upon work supported by DARPA under Contract No. HR001120C0087 and by the Broad Agency Announcement Program and the Cold Regions Research and Engineering Laboratory (ERDC-CRREL) under Contract W913E521C0003. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of DARPA or ERDC-CRREL.

Project details


Release history Release notifications | RSS feed

This version

0.4

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

picozk-0.4.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

picozk-0.4-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file picozk-0.4.tar.gz.

File metadata

  • Download URL: picozk-0.4.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.4

File hashes

Hashes for picozk-0.4.tar.gz
Algorithm Hash digest
SHA256 d022b261d5918beb5cbcf3cc92649a4ca0cf9cc581578e98db022795e561bbcd
MD5 0b0b54830f791ed5afd775b3d9e0b54f
BLAKE2b-256 cdfd162d7ac63c34f856ca065411c6f7f3d10d7d332ba5a43ed124beb9f7f220

See more details on using hashes here.

File details

Details for the file picozk-0.4-py3-none-any.whl.

File metadata

  • Download URL: picozk-0.4-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.4

File hashes

Hashes for picozk-0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4cb665766158209a81da950263b3b06499723af0a604c79de66a4f23277f9407
MD5 d1d0b1ebd2f1050684e10d4f7c58741b
BLAKE2b-256 92eafedcc0cc25dd2a25fdc0b39c687ef2a309e8e0cd87fa23bc1971a5d08264

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page