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

Plonk: list of suggested changes #52

Closed
vesselinux opened this issue Jul 13, 2022 · 2 comments
Closed

Plonk: list of suggested changes #52

vesselinux opened this issue Jul 13, 2022 · 2 comments

Comments

@vesselinux
Copy link
Collaborator

vesselinux commented Jul 13, 2022

  1. Have explicit struct members of the a,b,c polynomials currently stored as a single vector W_polys_blinded_at_secret_g1[a,b,c] in the plonk_proof class. Similarly, have explicit struct members for the q_L, q_R, q_O, q_M, a_C selector polynomials currently stored as a single vector Q_polys in the circuit struct.

  2. Do not store the Lagrange basis L_basis explicitly (e.g. as part of the srs class and circuit_t struct). Instead compute it on-the-fly as needed. For the purpose store the domain instead (obtained through libfqfft::get_evaluation_domain<Field>()) in the srs and circuit_t and pass this as input to functions that use the L_basis parameter.

  3. Related to 2.: create the domain once (using libfqfft::get_evaluation_domain<Field>()) and carry it around as necessary. See [BASE] Plonk #49 (comment)

  4. In all header files: leave only functions that are externally visible to calling code. If a function is only used "internally" in the implementation then just leave it in the .tcc (and not in the .hpp), potentially in the internal namespace (to hide it from other code). See also discussion: [BASE] Plonk #49 (comment)

  5. Move the print_vector function https://github.com/clearmatics/libsnark/blob/plonk/libsnark/zk_proof_systems/plonk/utils.tcc#L19-L25 to libff/.../field_utils.hpp. (Nice print functions in libff stream operators and old serialization code libff#70)

  6. Move the plonk main directory from zk_proof_systems/ to zk_proof_systems/ppzksnark/ since technically Plonk is a pre-processed zk-SNARK (ppzksnark).

  7. Make sure that all functions do not rely on the caller for allocating the correct sizes of the return parameters. Make the latter to be allocated inside the functions that compute them. See also [BASE] Plonk #49 (comment)

  8. When throwing an exception, it should not be up to the function that throws it to decide how it should be handled. Catch and handle must be done by the caller instead, who may wish to handle it in some way other than exiting the process, like retrying. See [BASE] Plonk #49 (comment) , [BASE] Plonk #49 (comment) , [BASE] Plonk #49 (comment)

  9. Break down the long functions plonk_prover<ppT>::round_five() and plonk_prover<ppT>::round_three() into several sub-functions for the purposes of unit testing and readability (see next). See [BASE] Plonk #49 (comment)

  10. Have a separate unit test under tests/ to verify the value of r_poly, W_zeta and W_zeta_omega in plonk_prover<ppT>::round_five(). See [BASE] Plonk #49 (comment) and [BASE] Plonk #49 (comment)

  11. Compute the challenges alpha, beta, gamma, zeta, nu, u using a hash function rather than passing them as pre-computed inputs as part of the transcript_hash_t structure. The latter is done now for the purposes of unit testing. In the long run we might want something like a transcript_hasher which can accept field and group elements as they are available, and then output a digest when required. See discussion at [BASE] Plonk #49 (comment) and [BASE] Plonk #49 (comment)

@dtebbs
Copy link
Contributor

dtebbs commented Jul 19, 2022

For the immediate future:

(ignore: 9, 10 for now.)

@vesselinux
Copy link
Collaborator Author

vesselinux commented Jul 20, 2022

Issue broken down into 5 new issues according to the list above and closed.

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

2 participants