# Re-using KZG ceremony ## New additions: - https://github.com/availproject/avail-srs/tree/main ## Parsing Ethereum's KZG ceremony - Use existing sequencer data - https://kzg-ceremony-sequencer-dev.fly.dev/info/status - https://github.com/ethereum/kzg-ceremony-specs/blob/master/apiSpec/sequencerApi.yml#L36 - `BatchTranscript` contains 4 sub ceremonies, `Transcript` elements - Parse `Transcript`: ```yaml Transcript: type: object description: Current transcript properties: numG1Powers: type: number format: int32 numG2Powers: type: number format: int32 powersOfTau: type: object properties: G1Powers: type: array items: type: string G2Powers: type: array items: type: string required: - G1Powers - G2Powers witness: type: object properties: runningProducts: type: array items: type: string potPubkeys: type: array items: type: string required: - runningProducts - potPubkeys ``` - Looking into this super [neat lib](https://github.com/heliaxdev/kzg-setup-powersoftau) now - It gives me (`[G1], VerifierKey`) instead of `powersOfTau([G1],[G2])` and a `witness` that Ethereum's setup has - Is it the same KZG impl? Why are those setups different? - It is, it's KZG10 - Ok, so how do I parse this? - Using info from [Vitalik's post](https://vitalik.ca/general/2022/03/14/trustedsetup.html) - `powersOfTau` contains `G1` and `G2` elements that have a relationship between them; we use that relationship to track the integrity of contributions - Similarly, `witness` is the actual proof of this integrity - ![](https://i.imgur.com/b1VLNRz.png) - Ok, so `[G1], VerifierKey` makes sense now. But what do I do with `VerifierKey`? - For [KZG10 implementation in arkworks](https://github.com/arkworks-rs/poly-commit/blob/master/src/kzg10/mod.rs#L135-L136) I need both `powers_of_g` and `powers_of_g_gamma`. The former is just `G1Powers`. The latter is not available in Ethereum's KZG transcript - This is because Ethereum's KZG setup uses MPC, so the "security gadget" used by verifier is different (G2 elements instead of G1 elements) - What do I do here? Does that mean that I can't use Ethereum's KZG with arkworks implementation? Is there any math trick I could use here? - Not sure if I'm understanding, but let's try: - `powers_of_g_gamma` is `powers_of_g` exponentiated to another secret, taken from generator h (in G2) - In Ethereum's ceremony, everyone takes turn to incorporate their secret into the `powers_of_gamma` - ![](https://i.imgur.com/qfAVyYv.png) ## Other approaches https://github.com/alxiong/crs