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

insertion_circuit: use versioned KZG hash #17

Merged
merged 1 commit into from
Aug 30, 2024
Merged

Conversation

wzmuda
Copy link
Collaborator

@wzmuda wzmuda commented Aug 9, 2024

As per the EIP-4844 specs, KZG commitment should not be passed as raw
bytes. Instead, a versioned hash of the commitment should be used.
Implement the hashing function according to the specs and apply it on
the commitment. Use the hash instead of the raw commitment for
evaluation point calculation and pass the hash to the circuit instead.

Reduce the evaluation point value at the input to the circuiut as an
optimization, to avoid passing around large values.

Introduce relevant changes in the insertion circiut test as well as the
integration test and the prover itself. Export the BN254 reduction
function to the circuit utils file, as now it's used in the integration
test, which is outside of the prover package.

@wzmuda wzmuda requested a review from kustosz August 9, 2024 22:00
@wzmuda wzmuda marked this pull request as draft August 9, 2024 22:02
As per the EIP-4844 specs, KZG commitment should not be passed as raw
bytes. Instead, a versioned hash of the commitment should be used.
Implement the hashing function according to the specs and apply it on
the commitment. Use the hash instead of the raw commitment for
evaluation point calculation and pass the hash to the circuit instead.

Reduce the evaluation point value at the input to the circuiut as an
optimization, to avoid passing around large values.

Introduce relevant changes in the insertion circiut test as well as the
integration test and the prover itself. Export the BN254 reduction
function to the circuit utils file, as now it's used in the integration
test, which is outside of the prover package.

Signed-off-by: Wojciech Zmuda <[email protected]>
@wzmuda wzmuda force-pushed the wz/4844-versioned-hash branch from 3c337a0 to 12462b1 Compare August 9, 2024 22:45
@wzmuda wzmuda changed the title test: insertion_circuit: use versioned KZG hash insertion_circuit: use versioned KZG hash Aug 9, 2024
@wzmuda wzmuda marked this pull request as ready for review August 9, 2024 22:46
@wzmuda wzmuda merged commit 568b3bb into next Aug 30, 2024
2 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