Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor/spartan: Generic batched SumcheckEngine module #198

Open
adr1anh opened this issue Dec 20, 2023 · 0 comments
Open

refactor/spartan: Generic batched SumcheckEngine module #198

adr1anh opened this issue Dec 20, 2023 · 0 comments

Comments

@adr1anh
Copy link
Contributor

adr1anh commented Dec 20, 2023

The SumcheckEngine trait provides a useful abstraction for describing Sumcheck claims, and the corresponding prove_helper method in ppsnark.rs provides a useful generic Sumcheck prover.

SumcheckEngine::prove_batch

This method should take as input a heterogeneous list of SumcheckEngine implementations of possibly different sizes, and create a batched Sumcheck proof for all claims.

Dynamic dispatch may be fine in this situation, since all the "hot-loops" are implemented by each SumcheckEngine.

SumcheckEngine for evaluating a polynomial

We use Sumcheck to check the multi-linear polynomial in several places

  • batch_eval_{prove, verify}
  • The second claim in InnerSumcheckInstance of ppsnark.rs

If we split the InnerSumcheckInstance, we can implement the second claim using this instance, which can be reused by both SNARKs.

InnerSumcheckInstance

Both direct and pre-processing SNARKs need to check $Ax \cdot Bc - (u\cdot Cz - E) = 0$. In the literature, this is often referred to as the "row-check" for R1CS. Both implementation should use the same SumcheckEngine implementation to prove the claim.

SumcheckEngine trait

It would be very practical if the trait exposed num_remaining_variables to indicate how many variables are left to prove. We use this quantity to handle batching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant