feat(kzg): add KZG-based ingress proofs, blob extraction, and custody proof system DO NOT MERGE#1170
Draft
glottologist wants to merge 13 commits intomasterfrom
Draft
feat(kzg): add KZG-based ingress proofs, blob extraction, and custody proof system DO NOT MERGE#1170glottologist wants to merge 13 commits intomasterfrom
glottologist wants to merge 13 commits intomasterfrom
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
319ec6d to
a118d3f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the changes
THIS IS RESEARCH ONLY - DO NOT MERGE
Before: Ingress proofs used only SHA-256 hashes (V1). No blob support. No custody proof mechanism.
After: KZG commitment-based V2 ingress proofs, EIP-4844 blob extraction, and complete custody proof challenge-response loop.
What is KZG and why does this matter?
The problem: Irys miners store 256 KB data chunks and prove they received them via ingress proofs. The existing proof (V1) is a SHA-256 merkle root — it proves "I hashed all the chunks together," but there's no way to later challenge a miner about individual chunks without re-downloading everything.
The solution: KZG commitments. A KZG commitment is a 48-byte elliptic curve fingerprint of data that supports point evaluation — a verifier can pick any position and ask "what's the value here?", and the prover must answer with a short proof. Faking a valid answer requires breaking a hard cryptographic assumption (discrete log on BLS12-381). This uses the same cryptography and trusted setup as Ethereum's EIP-4844 blobs, via the
c-kzglibrary already in our dependency tree through Reth.What this PR adds
1. KZG ingress proofs (V2) — A new proof type where the data fingerprint is a KZG commitment instead of a merkle hash. Each 256 KB chunk is split into two 128 KB halves (matching the EIP-4844 blob size), each half is committed separately, then the two commitments are aggregated into one. Per-chunk commitments are stored in the database for later custody verification.
2. Custody proofs — A challenge-response protocol: when a block is confirmed on-chain, its VDF output seeds deterministic random challenges ("prove you still hold chunk N in your partition"). Miners compute KZG opening proofs on their stored data and gossip the results. Peers verify proofs against stored per-chunk commitments. Invalid proofs generate penalty shadow transactions. The full loop is wired: challenge issuance → proof generation → gossip → block inclusion → validation.
3. EIP-4844 blob extraction — A new service that pulls blob sidecars from the Reth blob store, converts each blob into an Irys native transaction with a V2 ingress proof, and feeds it into the mempool. After extraction, blob-derived data is indistinguishable from native data.
Detailed Primer on KZG Proofs
Related Issue(s)
Please link to the issue(s) that will be closed with this PR.
Checklist
Additional Context
Add any other context about the pull request here.