a16z / Spartan2

High-speed zkSNARKs
MIT License
1 stars 3 forks source link

Optimize: Remove final batching sumcheck #5

Open sragss opened 8 months ago

sragss commented 8 months ago

The final batching sumcheck of Snark::prove is unneeded for us as we only need to support R1CS rather than Relaxed R1CS. This final sumcheck accounts for ~25% of Spartan e2e prover time.

We can cut all of the following: https://github.com/a16z/Spartan2/blob/d78a5044b16ff6b60341785829539f5d0ba2961b/src/spartan/snark.rs#L289-L353

  1. Cut above
  2. Modify the final let eval_arg = EE::prove(...) to use eval_W instead.
  3. Verifier checks eval_E is zero
sragss commented 8 months ago

Looks like we can remove w_u_vec and associated expensive cloning as well.

sragss commented 8 months ago

Arasu is handling here: https://github.com/a16z/Spartan2/pull/17