HorizenLabs / marlin

A Rust library for the Marlin preprocessing zkSNARK
Apache License 2.0
12 stars 0 forks source link

Cleaning up / refactoring Marlin #27

Open UlrichHaboeck75 opened 3 years ago

UlrichHaboeck75 commented 3 years ago

Our Marlin code base deserves some cleaning up. We still have left-overs from Marlin's initial AHP which are not necessary due to the coboundary sumcheck, and there are some structural improvements by arkworks we might want to take over. In short,

Beyond that, I recommend to switch to the Lagrange kernel instead of the UnnormalizedBivariateLagrangePoly, even if it comes slightly costlier in circuit. This is mainly for the following reasons.

If we keep with the generalized derivative, I at least opt to remove the double transposition of matrices: The indexer outputs the transpose of the representation with respect to the (non-normalized) kernel (to be in alignment with the lincheck from Fractal), and then again transposes the arguments for Marlin's t-polynomial in the inner sumcheck.

For details see the TODO's I have pushed in a separate branch inline_docu for our cargo doc.

UlrichHaboeck75 commented 3 years ago

P.S.: As we need to stay compatible with the mainchain verifier, I'd opt to provide two versions of Coboundary Marlin in our repo: coMarlin, which is in full alignment with our paper, and coMarlin_gd which works with the generalized derivative.