ethereum / c-kzg-4844

A minimal implementation of the Polynomial Commitments API for EIP-4844 and EIP-7594, written in C.
Apache License 2.0
116 stars 107 forks source link

Expose `compute_kzg_proof` in interface #34

Closed dankrad closed 1 year ago

dankrad commented 1 year ago

I suggest adding compute_kzg_proof to the interface as it is required in order to compute valid inputs to the point evaluation precompile.

It will also be useful for testing purposes (easier to generate test cases for point evaluation precompile).

xrchz commented 1 year ago

Should it also be marked as a "Public method" in https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/polynomial-commitments.md?

dankrad commented 1 year ago

Should it also be marked as a "Public method" in https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/polynomial-commitments.md?

Yes I think we should. Good point.

xrchz commented 1 year ago

After #27 is resolved, how should we handle the BLSFieldElement argument to compute_kzg_proof? Would Bytes32 be ok even though this differs from the spec (uint256 -- not a native C type)?

dankrad commented 1 year ago

Yeah I guess Bytes32 is the most consistent with how we are handling all the other cases.