Pratyush Mishra 981c20b8aa | 5 years ago | |
---|---|---|
.gitignore | 5 years ago | |
AUTHORS | 5 years ago | |
Cargo.toml | 5 years ago | |
LICENSE-APACHE | 5 years ago | |
LICENSE-MIT | 5 years ago | |
README.md | 5 years ago | |
rustfmt.toml | 5 years ago |
ZEXE (pronounced /zeksē/) is a Rust library for decentralized private computation.
This library was initially developed as part of the paper "ZEXE: Enabling Decentralized Private Computation", and it is released under the MIT License and the Apache v2 License (see License).
WARNING: This is an academic proof-of-concept prototype, and in particular has not received careful code review. This implementation is NOT ready for production use.
This library implements a ledger-based system that enables users to execute offline computations and subsequently produce publicly-verifiable transactions that attest to the correctness of these offline executions. The transactions contain zero-knowledge succinct arguments (zkSNARKs) attesting to the correctness of the offline computations, and provide strong notions of privacy and succinctness.
Informally, the library provides the ability to create transactions that run arbitrary (Turing-complete) scripts on hidden data stored on the ledger. In more detail, the library implements a cryptographic primitive known as decentralized private computation (DPC) schemes, which are described in detail in the ZEXE paper.
This repository contains several Rust crates that implement the different building blocks of ZEXE. The high-level structure of the repository is as follows.
algebra
: Rust crate that provides finite fields and elliptic curvesdpc
: Rust crate that implements DPC schemes (the main cryptographic primitive in this repository)snark
: Rust crate that provides succinct zero-knowledge argumentssnark-gadgets
: Rust crate that provides various gadgets used to construct constraint systemsIn addition, there is a bench-utils
crate which contains infrastructure for benchmarking. This crate includes macros for timing code segments and is used for profiling the building blocks of ZEXE.
The library relies on the nightly
toolchain of the Rust compiler (only for the relatively well-tested const_fn
feature). To install the latest Rust nightly, first install rustup
by following the instructions here, or via your platform's package manager. Once rustup
is installed, install the latest nightly by invoking:
rustup install nightly
After that, use cargo
, the standard Rust build tool, to build the library:
git clone https://github.com/scipr-lab/zexe.git
cd zexe/dpc
cargo +nightly build --release
This library comes with unit tests for each of the provided crates. Run the tests with:
cargo test
Lastly, this library comes with benchmarks for the following crates:
To perform the benchmarks, run the following command:
cargo bench
ZEXE is licensed under either of the following licenses, at your discretion.
Unless you explicitly state otherwise, any contribution submitted for inclusion in ZEXE by you shall be dual licensed as above (as defined in the Apache v2 License), without any additional terms or conditions.
ZEXE: Enabling Decentralized Private Computation
Sean Bowe, Alessandro Chiesa, Matthew Green, Ian Miers, Pratyush Mishra, Howard Wu
IACR ePrint Report 2018/962
This work was supported by: a Google Faculty Award; the National Science Foundation; the UC Berkeley Center for Long-Term Cybersecurity; and donations from the Ethereum Foundation, the Interchain Foundation, and Qtum.
Some parts of the finite field arithmetic, elliptic curve arithmetic, FFTs, and multi-threading infrastructure in the algebra
crate have been adapted from code in the ff
, pairing
, and bellman
crates, developed by Sean Bowe and others from Zcash.