ethereumjs-monorepo
ethereumjs-monorepo copied to clipboard
EIP4844: kzg functionality is not available in browsers
EIP 4844 uses KZG commitments.
- Ideal: pure js KZG, works in browsers and limited environments like Metamask
- Kinda OK: wasm KZG, works in browsers, doesn't work in limited environments
- Bad (current): KZG only works in node.js and doesn't work in browsers
There's open issue in c-kzg (https://github.com/ethereum/c-kzg-4844/issues/343), but it won't add pure js impl.
Yup, this is a known issue. I've done some experimentation with compiling c-kzg to wasm with limited success so far (mainly due to my own inexperience with modern C++ and wasm). There is a typescript version that @kevaundray started at one point but it's unmaintained and out of alignment with current kzg specs.
Work is being done on this here: https://github.com/acolytec3/kzg-wasm