Skip to main content

Try it Live

Run Blob examples in the interactive playground
Conceptual Guide - For API reference and method documentation, see Blob API.
Blobs (Binary Large Objects) are temporary data availability storage introduced in EIP-4844. They enable L2 rollups to post data to Ethereum at significantly lower costs compared to calldata, accelerating Ethereum’s scaling roadmap.

What Are Blobs?

Blobs are fixed-size data containers (exactly 131,072 bytes = 128 KB) attached to transactions. Unlike calldata:
  • Temporary - Stored for ~18 days (~4096 epochs), then pruned
  • Cheaper - Use separate blob gas market with lower base fees
  • Not executable - EVM cannot directly access blob data
  • Verified - Use KZG commitments to prove data integrity

Key Properties

Why Blobs Exist (EIP-4844)

Before EIP-4844, L2 rollups posted transaction data as calldata:
  • Expensive - 16 gas per byte (~2M gas for 128 KB)
  • Permanent - Stored forever in blockchain state
  • Inefficient - Paying for permanent storage when temporary availability suffices
EIP-4844 (proto-danksharding) introduces blobs:
  • Cheaper - Separate blob gas market (~0.5M gas for 128 KB)
  • Temporary - Pruned after ~18 days
  • Sufficient - L2s only need data available long enough for fraud/validity proofs

Blob Structure

A blob contains 4,096 field elements, each 32 bytes, organized for BLS12-381 scalar field operations:

Creating Blobs

Standard encoding format:
  • Bytes 0-7: Data length (8-byte little-endian uint64)
  • Bytes 8+: Actual data
  • Remaining: Zero padding

KZG Commitments

KZG (Kate-Zaverucha-Goldberg) commitments prove blob data integrity without revealing contents. Each blob has:
  1. Commitment (48 bytes) - Cryptographic binding to blob data
  2. Proof (48 bytes) - Proves commitment matches blob
  3. Versioned Hash (32 bytes) - Transaction reference (version byte + SHA256 of commitment)

Computing Commitments

Versioned Hashes

Transactions reference blobs using versioned hashes, not raw commitments:
Format: 0x01 (KZG version) + SHA256(commitment)[1:32]

Complete Example: L2 Data Posting

L2 rollup posting batch data to Ethereum:

Handling Multiple Blobs

Large data requires multiple blobs (max 6 per transaction):

Blob Gas Market

Blobs use a separate gas market from regular transactions:

Gas Pricing

Fee Market Dynamics

Blob base fee adjusts based on usage:
  • Target: 3 blobs per block (393,216 blob gas)
  • Max: 6 blobs per block (786,432 blob gas)
  • Adjustment: Exponential (similar to EIP-1559)

Field Element Constraints

Each 32-byte field element must be < BLS12-381 scalar field modulus:
Invalid field elements cause transaction rejection. Tevm handles this automatically in fromData():

Data Availability Window

Blobs are temporary (~18 days = 4096 epochs):
After pruning, only the versioned hash remains on-chain. L2s cannot reconstruct data from hash alone.

Security Considerations

Commitment Binding

KZG commitments cryptographically bind blob data:

Trusted Setup

KZG requires trusted setup ceremony:
  • Powers of Tau - 4096 participants contributed randomness
  • Security - Safe if at least 1 participant honest
  • Transparency - All contributions public and verifiable
See KZG Ceremony for details.

Common Patterns

Single Blob Transaction

Multi-Blob Transaction

Gas Estimation

Resources

Next Steps