Giter Site home page Giter Site logo

rapidsnark's Introduction

rapidsnark

rapid snark is a zkSnark proof generation written in C++ and intel assembly. That generates proofs created in circom and snarkjs very fast.

Dependencies

You should have installed gcc, cmake, libsodium, and gmp (development)

In ubuntu:

sudo apt-get install build-essential cmake libgmp-dev libsodium-dev nasm

Compile prover in standalone mode

npm install
git submodule init
git submodule update
npx task createFieldSources
npx task buildProver

Compile prover in server mode

npm install
git submodule init
git submodule update
npx task createFieldSources
npx task buildPistache
npx task buildProverServer

Building proof

You have a full prover compiled in the build directory.

So you can replace snarkjs command:

snarkjs groth16 prove <circuit.zkey> <witness.wtns> <proof.json> <public.json>

by this one

./build/prover <circuit.zkey> <witness.wtns> <proof.json> <public.json>

Launch prover in server mode

./build/proverServer  <port> <circuit1_zkey> <circuit2_zkey> ... <circuitN_zkey>

For every circuit.circom you have to generate with circom with --c option the circuit_cpp and after compilation you have to copy the executable into the build folder so the server can generate the witness and then the proof based on this witness. You have an example of the usage calling the server endpoints to generate the proof with Nodejs in /tools/request.js.

To test a request you should pass an input.json as a parameter to the request call.

node tools/request.js <input.json> <circuit>

Benchmark

This prover uses intel assembly with ADX extensions and parallelizes as much as it can the proof generation.

The prover is much faster that snarkjs and faster than bellman.

[TODO] Some comparation tests should be done.

License

rapidsnark is part of the iden3 project copyright 2021 0KIMS association and published with GPL-3 license. Please check the COPYING file for more details.

rapidsnark's People

Contributors

jbaylina avatar daveroga avatar obrezhniev avatar fractasy avatar mfcastellani avatar sripwoud avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.