Skip to content

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
jason/kzg-ingress
Draft

feat(kzg): add KZG-based ingress proofs, blob extraction, and custody proof system DO NOT MERGE#1170
glottologist wants to merge 13 commits intomasterfrom
jason/kzg-ingress

Conversation

@glottologist
Copy link
Contributor

@glottologist glottologist commented Feb 27, 2026

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-kzg library 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

  • Tests have been added/updated for the changes.
  • Documentation has been updated for the changes (if applicable).
  • The code follows Rust's style guidelines.

Additional Context
Add any other context about the pull request here.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch jason/kzg-ingress

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant