BabySNARK Save

Baby SNARK (do do dodo dodo)

Project README


The simplest possible SNARK for NP. You know, for kids!

This is a self-contained development of SNARKs for NP. It is based on Square Span Program SNARKs by Danezis et al., which are expressive enough to encode boolean circuits.

This code accompanies a tutorial on defining and analyzing the security of a SNARK, focusing on the soundness proof. (writeup.)

This is for educational purposes only. It's not efficient overall compared to state-of-the-art SNARK implementations, it doesn't come with a type system or any program analysis to rule out mistakes, and it doesn't support the zero-knowledge feature. It does, however, demonstrate some important SNARK design concepts and algorithm optimizations. It's succinct: the proof is constant size, and verifying it depends only on the size of statement, not the circuit and witness. It also achieves quasilinear overhead, through the use of FFT-based optimizations.

So, use it to study how SNARKs can be implemented, and to check your understanding of the accompanying tutorial As a project, consider extending this library to implement additional optimizations or protocol variants. This may also be useful in development for prototyping and reference implementations.


Setting up

This uses Python3. There are a few python dependencies, mainly numpy and py_ecc, an implementation of pairing cryptography including bls12-381.

pip install -r requirements.txt

To run:


To rebuild the jupyter notebooks:

Open Source Agenda is not affiliated with "BabySNARK" Project. README Source: initc3/babySNARK
Open Issues
Last Commit
3 years ago

Open Source Agenda Badge

Open Source Agenda Rating