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

support bn128 and circom #11

Merged
merged 18 commits into from
Apr 2, 2024
Merged

support bn128 and circom #11

merged 18 commits into from
Apr 2, 2024

Conversation

cliff0412
Copy link
Collaborator

@cliff0412 cliff0412 commented Mar 13, 2024

this PR was to make the latest plonky2 support circom groth16 verification.

major changes are as below

[1] remove lookups
[2] Add public_inputs_hash interface and hash_public_inputs functions; as in cbn128 config, the public inputs are using PoseidonHahsh while the tree building using Poseidon128Hash; Use customised public_input_hash to use specific hash method.
[3] Add fn export_solidity_verification_code and export_solidity_verification_code to export circom verification code for each circuit
[4] Use low_degree_interpolation & high_degree_interpolation; the latest plonky2 use coset_interpolation
[5] quoticient_poly mul by x; refer to here: 0xPolygonZero#436
[6] rm self.write_usize(public_inputs.len())? in write_proof_with_public_inputs
[7] latest plonky2 adds sereilizaiton & deserialization in the Gate trait; needs to add implementation for that, though currently it is not important
[8] add poseidon_bn128 hash to support groth16 circom verification

Note:

  • items 1,4, 5 needs to be fixed according to latest plonky2; these are to be done in future commits.
  • item 3,7 contains many todos for some gates; needs to be expanded to as many gates as possible

an important reference is here datluongductuan/plonky2@3a5abe2

@cliff0412 cliff0412 changed the title Dev cliff support bn128 Dev cliff support bn128 and circom Mar 13, 2024
@cliff0412 cliff0412 changed the title Dev cliff support bn128 and circom support bn128 and circom Mar 13, 2024
@cliff0412 cliff0412 merged commit b8e4535 into dev Apr 2, 2024
0 of 3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants