1
0
Fork 0
mirror of synced 2025-09-24 04:40:05 +00:00
A toolbox for zkSNARKs on Ethereum
Find a file
Jacob Eberhardt 0573584de0 naming
2017-10-23 11:41:51 +02:00
examples Template und Sample update 2017-10-11 17:41:44 +02:00
lib Added shortcut cli command to quickly perform setup, witness and proof generation. 2017-10-11 14:09:41 +02:00
src Added shortcut cli command to quickly perform setup, witness and proof generation. 2017-10-11 14:09:41 +02:00
templates Template und Sample update 2017-10-11 17:41:44 +02:00
.dockerignore Add Sub to R1CS; Add Dockerfile 2017-02-01 17:24:44 +01:00
.gitignore Add first tests of parser and equality of structs 2017-02-08 22:06:38 +01:00
build.rs Intermediary commit. Serialization added, Deserialization still ToDo. Formatted. 2017-10-09 13:24:31 +02:00
Cargo.lock Renamed. Serialization and Deserialization implemented for FieldPrime 2017-10-09 19:03:06 +02:00
Cargo.toml Renamed. Serialization and Deserialization implemented for FieldPrime 2017-10-09 19:03:06 +02:00
Dockerfile naming 2017-10-23 11:41:51 +02:00
README.md naming 2017-10-23 11:41:51 +02:00

ZoKrates

Using ZoKrates

Set the libsnark library path in LD_LIBRARY_PATH

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

CLI

Example

To execute the program

def add(a, b, c):
  return a + b + c

with add(1, 2, 3), call

./zokrates compile -i add.code_path
./zokrates shortcut -a "1 2 3"

Building

Currently needs to be build with nightly Rust.

Docker

Example usage:

docker build -t zokrates .
docker run -ti zokrates /bin/bash
cd ZoKrates
./target/debug/zokrates compile -i examples/add.code

With libsnark

Install libsnark to /usr/local with

make install lib PREFIX=/usr/local NO_PROCPS=1 NO_GTEST=1 NO_DOCS=1 CURVE=ALT_BN128 FEATUREFLAGS="-DBINARY_OUTPUT=1 -DMONTGOMERY_OUTPUT=1 -DNO_PT_COMPRESSION=1"

and build with

cargo build

Without libsnark

Build with the feature nolibsnark

cargo build --features nolibsnark

Testing

Run normal tests with

cargo test

and run long and expensive tests with

cargo test -- --ignored