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

Proper ZK treatment in plonky2 #1625

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

Proper ZK treatment in plonky2 #1625

wants to merge 15 commits into from

Conversation

Nashtare
Copy link
Collaborator

@LindaGuiga I'm opening a draft PR to be able to comment on the code

plonky2/src/batch_fri/recursive_verifier.rs Outdated Show resolved Hide resolved
plonky2/src/batch_fri/verifier.rs Outdated Show resolved Hide resolved
plonky2/src/fri/mod.rs Outdated Show resolved Hide resolved
Comment on lines 200 to 201
let last_poly = if is_zk && idx == 0 {
polynomials.len() - 2
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a one-liner for the -2

plonky2/src/fri/recursive_verifier.rs Outdated Show resolved Hide resolved
plonky2/src/plonk/proof.rs Outdated Show resolved Hide resolved
plonky2/src/plonk/proof.rs Outdated Show resolved Hide resolved
plonky2/src/plonk/proof.rs Outdated Show resolved Hide resolved
plonky2/src/plonk/prover.rs Outdated Show resolved Hide resolved
plonky2/src/util/serialization/mod.rs Outdated Show resolved Hide resolved
@LindaGuiga LindaGuiga marked this pull request as ready for review September 17, 2024 11:21
@LindaGuiga
Copy link
Contributor

LindaGuiga commented Sep 17, 2024

This PR aims at addressing #1625, based on this note https://eprint.iacr.org/2024/1037.pdf .

  • For the batch FRI polynomial, we take a random polynomial with twice the degree of the subgroup, so that we can add a FRI step with arity 2 instead of computing 2 different FRI proofs (for the lower half and higher half of the polynomial, as mentioned in the note).
  • For the quotient polynomial chunks, we reduce the degree n of each chunk to n - h, so that we can add to them random polynomials with degree n.
  • For the third point in Proper ZK treatment in plonky2 #1625, the current implementation to randomize the wire polynomials seems to follow the guidelines in the paper. Indeed, currently, the degree h is computed as: h_1 = D + num_fri_openings for wire polynomials and h_2 = 2 * D + num_fri_openings for the permutation polynomial Z where D is the extension degree. The differnece between the two values is because the wire polynomials are openings are only opened at zeta, while the Z polynomial is also opened at g*Z. h_1 is added to all wire polynomials, while h_2 is only added to the routed wires. This is in accordance with the prescription of having h >= 2 * (D * n_DEEP + n_FRI) (Eq. 13) in the paper, for the case where the quotient chunks are computed the canonical way and randomized. (Note that the factor 2 in Eq 13 comes from the evaluation at zeta and g*zeta, but we only evaluate at zeta for the wire polynomials, as explained before.)

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

Successfully merging this pull request may close these issues.

2 participants