1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00

edit Introduction and getting started, change zokrates to ZoKrates

This commit is contained in:
schaeff 2018-10-26 14:43:18 +02:00
parent eb7ce0982b
commit 8de54f5979
3 changed files with 18 additions and 15 deletions

View file

@ -2,7 +2,7 @@
## Installation
Using Docker is currently the recommended way to get started with Zokrates.
Using Docker is currently the recommended way to get started with ZoKrates.
```bash
docker run -ti zokrates/zokrates /bin/bash
@ -22,26 +22,29 @@ cd ZoKrates/target/release
Alternatively, you can build Cargo from [source](https://github.com/JacobEberhardt/ZoKrates/).
## First Steps with ZoKrates
## Hello ZoKrates!
First, create the text-file `add.code` and implement your program:
First, create the text-file `root.code` and implement your program. IN this example, we will prove knowledge of the square root of a number:
```zokrates
def main(field a, field b, field c) -> (field):
return a + b + c
def main(private field a, field b) -> (field):
field result = if a * a == b then 1 else 0
return result
```
The keyword `field` declares the type of the parameters used as elements of the underlying finite field.
Some observations:
- The keyword `field` is the basic type we use, which is an element of a prime field.
- The keyword `private` signals that we do not want to reveal this input, but still prove that we know its value.
Then run the different phases of the protocol:
```bash
./zokrates compile -i 'add.code'
./zokrates compile -i root.code
./zokrates setup
./zokrates compute-witness -a 1 2 3
./zokrates compute-witness -a 337 113569
./zokrates generate-proof
./zokrates export-verifier
```
The CLI commands are explained in more detail in this [section
](reference/cli.html) of the doc.
](reference/cli.html) of the documentation.

View file

@ -1,22 +1,22 @@
# Introduction
Zokrates is a toolbox for zkSNARKs on Ethereum.
ZoKrates is a toolbox for zkSNARKs on Ethereum. It helps you use verifiable computation in your DApp, from the specification of your program in a high level language to generating proofs of computation to verifying those proofs in Solidity.
## Background on zkSNARKs
Zero-knowledge proofs (ZKPs) are a family of probabilistic protocols, first described by [Goldwasser, Micali and Rackoff](http://people.csail.mit.edu/silvio/Selected%20Scientific%20Papers/Proof%20Systems/The_Knowledge_Complexity_Of_Interactive_Proof_Systems.pdf) in 1985.
On particular family of ZKPs is described as zero-knowledge **S**uccinct **N**on-interactive **AR**guments of **K**nowledge, a.k.a. zk-SNARKs. zk-SNARKs are the most widely used zero-knowledge protocols, with the anonymous cryptocurrency Zcash and the smart-contract platform Ethereum among the notable early adopters.
One particular family of ZKPs is described as zero-knowledge **S**uccinct **N**on-interactive **AR**guments of **K**nowledge, a.k.a. zkSNARKs. zkSNARKs are the most widely used zero-knowledge protocols, with the anonymous cryptocurrency Zcash and the smart-contract platform Ethereum among the notable early adopters.
For further details we refer the reader to some introductory material provided by the community: [[1]](https://z.cash/technology/zksnarks/),[[2]](https://medium.com/@VitalikButerin/zk-snarks-under-the-hood-b33151a013f6), [[3]](https://blog.decentriq.ch/zk-snarks-primer-part-one/).
For further details we refer the reader to some introductory material provided by the community: [[1]](https://z.cash/technology/zksnarks/),[[2]](https://medium.com/@VitalikButerin/zkSNARKs-under-the-hood-b33151a013f6), [[3]](https://blog.decentriq.ch/zkSNARKs-primer-part-one/).
## Motivation
Ethereum runs computations on all nodes of the network, resulting in high costs, limits in complexity, and low privacy. zkSNARKs have been enabling to only verify computations on-chain for a fraction of the cost of running them, but are hard to grasp and work with.
Zokrates bridges this gap. It helps you create off-chain programs and link them to the Ethereum blockchain, expanding the possibilities for your dApp.
ZoKrates bridges this gap. It helps you create off-chain programs and link them to the Ethereum blockchain, expanding the possibilities for your DApp.
## License
ZoKrates, all the source code, is released under the GNU Lesser General Public License v3.
ZoKrates is released under the GNU Lesser General Public License v3.

View file

@ -1,6 +1,6 @@
# Command Line Tool
Zokrates provides a command line interface.
ZoKrates provides a command line interface.
You can see an overview of the available subcommands by running
```sh