Skip to content

delta-mpc/delta-zk

Repository files navigation

delta-zk

The zero knowledge proof system used in Delta.

Dependency

  1. Docker

  2. docker-compose(optional)

  3. nodejs && yarn

  4. snarksjs

    npm install -g snarkjs@latest
  5. circom (v2.0.6)

    wget https://github.com/iden3/circom/releases/download/v2.0.6/circom-linux-amd64 /usr/local/bin/circom
    chmod +x /usr/local/bin/circom

Setup

The user should provide the value of ${input_size}, which is the feature dimension of the dataset

All of the setup files will be generated under directory circuits/main/${input_size}

setup with docker

docker run --rm -it --name delta-zk-setup -v ${PWD}/circuits/main:/app/circuits/main deltampc/delta-zk:dev yarn setup ${input_size}

setup with yarn

download snarkjs Ptau file

wget https://hermez.s3-eu-west-1.amazonaws.com/powersOfTau28_hez_final_20.ptau ./ptau/pot_final.ptau
yarn install && yarn setup ${input_size}

Docker image

build

docker build -t deltampc/delta-zk:dev .

docker hub

docker pull deltampc/delta-zk:dev

Run gRPC service

run with docker

docker run --name delta-zk -v ${PWD}/circuits/main:/app/circuits/main -p 4500:4500 -d deltampc/delta-zk:dev

or

docker compose up -d

run with yarn

yarn server