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

book tweaks

This commit is contained in:
schaeff 2022-08-30 13:56:55 +02:00
parent 91028bb036
commit b66cfc4d83
4 changed files with 20 additions and 25 deletions

View file

@ -30,6 +30,6 @@
- [Examples](examples/index.md)
- [A SNARK Powered RNG](examples/rng_tutorial.md)
- [Proving knowledge of a hash preimage](examples/sha256example.md)
- [The Magic Square](examples/magic_square.md)
- [A ZK Magic Square in the browser](examples/magic_square.md)
- [Testing](testing.md)

View file

@ -1,7 +1,7 @@
# The Magic Square
# A ZK Magic Square in the browser
<iframe
src="https://zokrates.github.io/zokrates-nextjs-demo/"
style="width:100%;min-height:100vh;border:none"
title="The Magic Square">
title="A ZK Magic Square">
</iframe>

View file

@ -2,9 +2,12 @@
## Installation
### Remix online IDE
### Online IDEs
To get a feel of the language, try the [ZoKrates playgound](https://play.zokrat.es).
To experiment with creating SNARKs and verifying them in the EVM, check out the ZoKrates plugin in the [Remix online IDE](https://remix.ethereum.org).
To write your first SNARK program, check out the ZoKrates plugin in the [Remix online IDE](https://remix.ethereum.org)!
### One-line installation
@ -14,6 +17,18 @@ We provide one-line installation for Linux, MacOS and FreeBSD:
curl -LSfs get.zokrat.es | sh
```
### From source
You can build ZoKrates from [source](https://github.com/ZoKrates/ZoKrates/) with the following commands:
```bash
git clone https://github.com/ZoKrates/ZoKrates
cd ZoKrates
export ZOKRATES_STDLIB=$PWD/zokrates_stdlib/stdlib
cargo +nightly build -p zokrates_cli --release
cd target/release
```
### Docker
ZoKrates is available on Dockerhub.
@ -24,17 +39,6 @@ docker run -ti zokrates/zokrates /bin/bash
From there on, you can use the `zokrates` CLI.
### From source
You can build ZoKrates from [source](https://github.com/ZoKrates/ZoKrates/) with the following commands:
```bash
git clone https://github.com/ZoKrates/ZoKrates
cd ZoKrates
cargo +nightly build -p zokrates_cli --release
cd target/release
```
## Hello ZoKrates!
First, create the text-file `root.zok` and implement your program. In this example, we will prove knowledge of the square root `a` of a number `b`:

View file

@ -20,15 +20,6 @@ cargo test --release
Integration tests are excluded from `cargo test` by default.
They are defined in the `zokrates_cli` crate in `integration.rs` and use the test cases specified in `zokrates_cli/tests/code`.
Before running integration tests, make sure:
1. You have [solc](https://github.com/ethereum/solc-js) installed and in your `$PATH`.
Solc can conveniently be installed through `npm` by running
```
npm install -g solc
```
2. You have an Ethereum node running on localhost with a JSON-RPC interface on the default port 8545 (`http://localhost:8545`).
Integration tests can then be run with the following command:
```