Dear users of libsnark,
Below is an announcement regarding recent changes in libsnark, now included in the “master” branch.
Transitioned to CMake
We upgraded libsnark’s build process from a shell script and Makefile for installation and compilation to a new CMake-based process (https://cmake.org/). We are making this transition to better address the growing system-level and modularity needs of libsnark.
The commands and flags for compiling libsnark have changed (see Transition-to-CMake.md in the repo).
Factored out algebraic routines into new libraries
We have factored out core algebraic components of libsnark to allow developers to use internal classes and functions that are useful in applications beyond libsnark, as well as to simplify the growing directory structure of libsnark.
The two new libraries are:
libff - finite fields and elliptic curves
libfqfft - fast polynomial evaluation and interpolation in various finite domains
These libraries are now automatically fetched and installed as Git submodules, in the “depends” (formerly: “third-party”) directory.
Monolithic version of libsnark is archived and unsupported
As part of this transition, we will maintain a copy of the deprecated version under the “monolithic” branch. However, we will not support any future development work for the “monolithic” branch. Should a critical vulnerability be found in “monolithic”, we will patch it accordingly.
Added automatic builds for commits and pull requests with Travis CI
In an effort to reduce compilation and system-level issues, we have added automatic builds for commits and pull requests to libsnark. Initially, we are performing these checks for Ubuntu 14.04, but we hope to expand this to more operating systems (your help would be appreciated!).
New SNARK constructions
We have also added two new pre-processing zkSNARK implementations to libsnark, both targeting the R1CS relation. They are r1cs_gg_ppzksnark from [Groth16] and r1cs_se_ppzksnark from [GM17]. Compared to r1cs_ppzksnark, which implements a modification of the Pinocchio protocol [PGHR13/BCTV14a], the new proof systems have improved empirical and asymptotic performance (see our performance comparison) at expense of relying on stronger cryptographic assumptions. The proof system of [GM17] is simulation extractable.
Improved performance
The current zk-SNARK prover spends most of its time computing a multi-exponentiation (the second largest cost is polynomial division via FFTs; the rest are negligible). This computation was previously performed by an implementation of the Bos-Coster algorithm. We have now implemented a variant of Pippenger’s algorithm from [BDLO12], which gives an asymptotic improvement, and switched our proof systems to use this algorithm. Concretely, for R1CS instances of million constraints, the overall speed-up of the prover runtime is around 1.25x.
Mailing list
For future announcements, as well as discussion with the developers and other users, please join the new libsnark mailing list.
These are exciting developments, and I look forward to seeing some of these improvements downstream in projects that use libsnark.
These are exciting developments, and I look forward to seeing some of these improvements downstream in projects that use libsnark.Quick question regarding the new cmake build system, is there a list of platforms/compilers/toolchains that it is tested on? specifically on Windows?
The current zk-SNARK prover spends most of its time computing a multi-exponentiation (the second largest cost is polynomial division via FFTs; the rest are negligible).
(enter) Generating G1 multiexp table(leave) Generating G1 multiexp table(enter) Generating G2 multiexp table(leave) Generating G2 multiexp table
template <typename ppT>r1cs_ppzksnark_proof<ppT> r1cs_ppzksnark_prover( const r1cs_ppzksnark_proving_key<ppT> &pk, const r1cs_ppzksnark_primary_input<ppT> &primary_input, const r1cs_ppzksnark_auxiliary_input<ppT> &auxiliary_input)It looks like the exponential table construction is done during the key generation phase as I saw the output in key generation process:
When you said the 'prover' spends most of the time on multi-exponentiation, do you mean this functiontemplate <typename ppT>r1cs_ppzksnark_proof<ppT> r1cs_ppzksnark_prover(const r1cs_ppzksnark_proving_key<ppT> &pk,const r1cs_ppzksnark_primary_input<ppT> &primary_input,const r1cs_ppzksnark_auxiliary_input<ppT> &auxiliary_input)was calling computations on the multi-exponentiations?