-
Notifications
You must be signed in to change notification settings - Fork 34
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 smart contract for the polynomial encoding version (aka Summa v2) #242
Comments
The info above is a bit outdated. Let's take a look at the difference between the V1 and V2 contracts. In V1, the zkSNARK was used to prove the individual user inclusion, so the smart contract verifier was verifying the individual user inclusion as well. The inclusion proof in V2 is not the zkSNARK proof but is a KZG proof. During the zkSNARK proof generation Halo2 commits to advice polynomials using the KZG commitment (https://github.com/summa-dev/halo2/blob/8386d6e64fc33baccf626869123185890b8284dc/halo2_proofs/src/plonk/prover.rs#L394). We are taking advantage of this to produce the user inclusion proofs. Since there are already the balance polynomial commitments inside the zkSNARK proof transcript (https://github.com/summa-dev/halo2/blob/8386d6e64fc33baccf626869123185890b8284dc/halo2_proofs/src/plonk/prover.rs#L406), we can perform the KZG opening proofs individually for each user based on these commitments to show the inclusion of their balances into advice polynomials. It also means that the zkSNARK proof transcript contains as many KZG commitment points as there are cryptocurrencies. The function Each user expects to receive a KZG opening proof, but also needs to verify the proof against the committed points, that is why we need to store the zkSNARK proof transcript. The user needs to read the balance polynomial KZG commitment from the transcript (similarly to https://github.com/summa-dev/halo2/blob/8386d6e64fc33baccf626869123185890b8284dc/halo2_proofs/src/plonk/verifier.rs#L108) and use it together with the balance value to verify the KZG proof. The algorithm would go roughly as follows:
|
The smart contract for V2 has been implemented, as detailed in #267 |
The text was updated successfully, but these errors were encountered: