Skip to content

kzg changes #2808

@HIT2022

Description

@HIT2022

Check existing issues

Viem Version

2.21.16

Current Behavior

kzg-wasm released 0.5.0 with the major changeset coming from this PR: ethereumjs/kzg-wasm#17. You can see how they renamed blobToKzgCommitment to blobToKZGCommitment and computeBlobKzgProof to computeBlobKzgProof. Reporting as a bug so that blobsToProofs and blobsToCommitments can be updated to account for both versions of these APIs.

On this subject: micro-eth-signer added kzg support so there is now a native JS implementation of KZG cryptography. It seems generation of commitments, in particular, is significantly faster than kzg-wasm. Could we refactor kzg use so that viem also supports this library's functions (blobToKzgCommitment and computeBlobKZGProof)?

Unrelated question: could sendTransaction handling potentially be adjusted to optionally support passing of pre-computed sidecar data? For UX purposes, if/when multiple blobs are in play, I'd like to be able to execute the cryto well in advance of submitting the tx. to the network.

Expected Behavior

Viem's use of kzg will work with kzg-wasm release 0.5.0

Steps To Reproduce

Use viem with kzg-wasm release 0.5.0

Link to Minimal Reproducible Example

No response

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions