ark-r1cs-std/README.md
README.mdRaw
1<h1 align="center">ZEXE (Zero knowledge EXEcution)</h1>
2
3<p align="center">
4 <a href="https://github.com/scipr-lab/zexe/blob/master/AUTHORS"><img src="https://img.shields.io/badge/authors-SCIPR%20Lab-orange.svg"></a>
5 <a href="https://github.com/scipr-lab/zexe/blob/master/LICENSE-APACHE"><img src="https://img.shields.io/badge/license-APACHE-blue.svg"></a>
6 <a href="https://github.com/scipr-lab/zexe/blob/master/LICENSE-MIT"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
7</p>
8
9
10___ZEXE___ (pronounced */zeksē/*) is a Rust library for decentralized private computation.
11
12
13This library was initially developed as part of the paper *"[ZEXE: Enabling Decentralized Private Computation][zexe]"*, and it is released under the MIT License and the Apache v2 License (see [License](#license)).
14
15**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.
16
17## Overview
18
19This 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.
20
21- **Privacy** - transactions reveal no information about the offline computation.
22- **Succinctness** - transactions can be validated in time that is independent of the offline computation.
23- **Application isolation** - malicious applications cannot affect the execution of honest applications.
24- **Application interaction** - applications can safely communicate with each other.
25
26Informally, 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][zexe].
27
28## Directory structure
29
30This repository contains several Rust crates that implement the different building blocks of ZEXE. The high-level structure of the repository is as follows.
31
32* [`algebra`](algebra): Rust crate that provides finite fields and elliptic curves
33* [`dpc`](dpc): Rust crate that implements DPC schemes (the main cryptographic primitive in this repository)
34* [`snark`](snark): Rust crate that provides succinct zero-knowledge arguments
35* [`snark-gadgets`](snark-gadgets): Rust crate that provides various gadgets used to construct constraint systems
36
37In addition, there is a [`bench-utils`](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.
38
39## Build guide
40
41The 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](https://rustup.rs/), or via your platform's package manager. Once `rustup` is installed, install the latest nightly by invoking:
42```bash
43rustup install nightly
44```
45
46After that, use `cargo`, the standard Rust build tool, to build the library:
47```bash
48git clone https://github.com/scipr-lab/zexe.git
49cd zexe/dpc
50cargo +nightly build --release
51```
52
53This library comes with unit tests for each of the provided crates. Run the tests with:
54```bash
55cargo test
56```
57
58Lastly, this library comes with benchmarks for the following crates:
59
60- [`algebra`](algebra)
61- [`dpc`](dpc)
62
63To perform the benchmarks, run the following command:
64```bash
65cargo bench
66```
67
68## License
69
70ZEXE is licensed under either of the following licenses, at your discretion.
71
72 * Apache License Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
73 * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
74
75Unless 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.
76
77[zexe]: https://ia.cr/2018/962
78
79## Reference paper
80
81[_ZEXE: Enabling Decentralized Private Computation_][zexe]
82[Sean Bowe](https://www.github.com/ebfull), Alessandro Chiesa, Matthew Green, Ian Miers, [Pratyush Mishra](https://www.github.com/pratyush), [Howard Wu](https://www.github.com/howardwu)
83*IACR ePrint Report 2018/962*
84
85## Acknowledgements
86
87This work was supported by:
88a Google Faculty Award;
89the National Science Foundation;
90the UC Berkeley Center for Long-Term Cybersecurity;
91and donations from the Ethereum Foundation, the Interchain Foundation, and Qtum.
92
93Some 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`](https://github.com/zkcrypto/ff), [`pairing`](https://github.com/zkcrypto/pairing), and [`bellman`](https://github.com/zkcrypto/bellman) crates, developed by [Sean Bowe](https://www.github.com/ebfull) and others from Zcash.