Replies: 9 comments 1 reply
-
What if you snag the import { KZG } from 'kzg'
import { setup } from 'kzg/setups/mainnet'
const kzg = new KZG(setup) ^ similar pattern to Update: I reserved the |
Beta Was this translation helpful? Give feedback.
-
The pkg name is cool. I’m becoming less of a fan of maintaining tens of packages. So ideally wanted to keep it inside of eth signer. Which is small itself and treeshaken. For one example, signer contains special ssz impl, which is like 8x smaller than other one. At some point, people would want to use ssz. What are your thoughts? How does viem currently include kzg / setups? How do you see that in the future? |
Beta Was this translation helpful? Give feedback.
-
We are just shipping the mainnet & minimal JSON trusted setup files right now: https://www.npmjs.com/package/viem?activeTab=code (under For the future, we wanted to rely on a purely isomorphic JS solution that works across browsers and runtimes (which I think I have mentioned to you in the past) – which seems like Is the implementation complete? |
Beta Was this translation helpful? Give feedback.
-
@jxom we can use Or we can use I've ensured the library interops ok with c-kzg. |
Beta Was this translation helpful? Give feedback.
-
Apologies for the delayed response to your previous comment – was having a think about it. Whatever package name sounds good – trust your intuition with that. As for integration, I think it might be best if we still stick to the same inversion of control pattern we have now (instantiate It would be cool if edit: saw this ethereumjs/ethereumjs-monorepo#3662 (comment) – our |
Beta Was this translation helpful? Give feedback.
-
@jxom I understand C uses Uint8Arrays. However, is it "right"? I saw someone publishing first mainnet blob using viem. How exactly do you build blobs? |
Beta Was this translation helpful? Give feedback.
-
Some kind of u8a compat layer is easy to expose in |
Beta Was this translation helpful? Give feedback.
-
Wouldn't say it's the most ideal case for our scenarios as string conversion will be needed anyway before sending over the wire (for blob transactions).
End up converting to strings before sending over the network (for blob transactions). Which is pretty much same process as you are doing now. However, consumers are still able to build Uint8Array blobs, and compute commitments & proofs for them in Uint8Array form (without any conversion) – though, not too sure if anyone is doing this.
Up to you. Either way, we can figure out something to make Viem work with string -> string interfaces too. |
Beta Was this translation helpful? Give feedback.
-
The package is now live on NPM at |
Beta Was this translation helpful? Give feedback.
-
While developing a kzg.ts package, it came to my understanding that including trusted setups would increase NPM pkg size massively.
Here's the idea:
micro-trusted-setups
ortrusted-setups
(or any other better name?)The files are already in eth-signer, but should be in a separate repo: small.ts, fast.ts
Beta Was this translation helpful? Give feedback.
All reactions