KZG Commitments
KZG (Kate-Zaverucha-Goldberg) is a polynomial commitment scheme using pairings over the BLS12-381 elliptic curve, enabling succinct proofs of polynomial evaluations. Mainnet-critical algorithm (post-Dencun) - Core primitive for EIP-4844 blob transactions, enabling proto-danksharding and L2 data availability scaling.Overview
KZG commitments allow rollups to post large data blobs (~126 KB) as tiny commitments (48 bytes) on-chain. Validators can verify data availability without storing full blobs, enabling Proto-Danksharding and reducing L2 costs by 100-200x.Why KZG for Ethereum?
Data Availability Crisis: L2s need cheap data posting Solution: Blob transactions with KZG commitments Impact: Rollup costs reduced from ~0.01-0.10 per transaction Key Properties:- Succinct: 48-byte commitment for ~126 KB blob (4096 field elements)
- Binding: Cannot change blob after commitment
- Verifiable: Prove
p(z) = yat any point - Batch-friendly: Verify multiple proofs efficiently
Mathematical Foundation
Polynomial Commitments
Represent blob as polynomial:C = [p(τ)]₁ (G1 point on BLS12-381)
Evaluation Proof for p(z) = y:
Trusted Setup
Ethereum KZG Ceremony: Multi-party computation generating trusted setup parameters τ (tau): Secret value from MPC ceremony- 140,000+ participants (Ethereum KZG ceremony 2023)
- Safe if ANY participant destroyed their secret
- Powers of τ precomputed in G1 and G2
Implementation Details
Native C Only: KZG operations via c-kzg-4844 library (trusted setup required) WASM Not Supported: WASM target returnserror.NotSupported due to C library dependencies. KZG is only available in native environments.
Import:
Quick Start
- Standard API
- Factory API
Documentation
Core Operations
- Commitments - Creating KZG commitments from blobs
- Proofs - Opening proofs and evaluation verification
- Point Evaluation - EIP-4844 precompile 0x0a
- Trusted Setup - Ceremony, verification, security
Integration
- EIP-4844 - Blob transactions, gas pricing, lifecycle
- Usage Patterns - L2 integration, data availability sampling
- Test Vectors - Official EIP-4844 test cases
- Performance - Benchmarks, gas costs, optimizations
EIP-4844 Blob Transactions
Blob Format
Size: 131,072 bytes (~126 KB) Structure: 4,096 field elements × 32 bytes Constraint: Each element < BLS12-381 scalar field modulus Note: While often described as “128 KB”, the actual size is 131,072 bytes (128 × 1024), approximately 126 KB in decimal.Transaction Type
Type 3 (Blob Transaction):Blob Lifecycle
- Submission: Rollup creates blob transaction with KZG commitments
- Inclusion: Block proposer includes in block
- Verification: Nodes verify KZG proofs ensure commitment correctness
- Availability: Blobs available for 18 days (commitments enable verification without full blob download)
- Pruning: After 18 days, blobs deleted (commitments remain on-chain permanently)
Point Evaluation Precompile
Address:0x0a (precompile 0x0a)
Function: Verify KZG proof for blob evaluation
Implementation
C-KZG-4844: Official Ethereum implementation- Location:
lib/c-kzg-4844/ - Language: C (portable)
- Audits: Sigma Prime (2023), zkSecurity (2025)
src/crypto/c_kzg.zig
- Safe FFI bindings
- Error handling
- Memory management
- Native: Full support via c-kzg-4844 C library
- WASM: NOT SUPPORTED - Returns
error.NotSupporteddue to C library dependencies
loadTrustedSetup() before any KZG operations. Setup loads Ethereum KZG Ceremony parameters (~1 MB).
Gas Economics
Blob Gas: Separate gas market from execution gas Target: 3 blobs per block (~393 KB) Max: 6 blobs per block (~786 KB) Pricing: EIP-1559 style (exponential)- Calldata: ~16 gas/byte × 131KB =
2.1M gas ($100-500) - Blob:
50K gas per blob ($1-5)
Security
Trusted Setup Security:- Assumption: Safe if ≥1 participant destroyed their secret contribution
- Participants: 140,000+ in Ethereum KZG Ceremony (2023)
- Verification: Publicly verifiable transcript ensures ceremony correctness
- Risk: If all participants colluded, they could create false proofs. With 140,000+ participants, this is cryptographically impractical.
- Computationally infeasible to find collision
- Based on discrete log hardness in G1 (BLS12-381)
- Cannot forge proof for wrong evaluation value
- Pairing check guarantees correctness via bilinear map properties
Use Cases
Optimistic Rollups:- Post transaction data as blobs
- Fraud proofs reference blob data
- Post full transaction data
- Validity proofs verify state transition
- Light clients sample random points
- Verify via KZG proofs
- Ensure data availability without full download
Performance
Native (c-kzg-4844):- Blob to commitment: ~50 ms
- Compute proof: ~50 ms
- Verify proof: ~2 ms
- Verify blob proof batch: ~2 ms per blob
- Max 6 blobs per block
- Verification time: ~12 ms per block (6 blobs)
Related
- BLS12-381 - Underlying elliptic curve
- Precompiles: Point Evaluation - 0x0a implementation

