Skip to main content

Try it Live

Run Blob examples in the interactive playground
New to blobs? Start with Fundamentals for guided examples and EIP-4844 concepts.

Type Definition

Branded Uint8Array representing EIP-4844 blob data (exactly 131,072 bytes = 128 KB).
Blobs enable proto-danksharding (EIP-4844), providing temporary data availability for L2 rollups at significantly lower gas costs compared to calldata.

Constants

API Methods

Constructors

  • from - Universal constructor from any input (auto-encodes if needed)
  • fromData - Encode arbitrary data into blob format with length prefix

Data Encoding/Decoding

  • toData - Extract original data from blob (reads length prefix)
  • splitData - Split large data into multiple blobs
  • joinData - Join data from multiple blobs

KZG Cryptography

  • toCommitment - Compute 48-byte KZG commitment for blob
  • toProof - Generate 48-byte KZG proof
  • toVersionedHash - Compute versioned hash (0x01 + SHA256 of commitment)
  • verify - Verify KZG proof for blob and commitment
  • verifyBatch - Batch verify multiple blob proofs

Validation

  • isValid - Check if data is valid blob (exactly 131,072 bytes)
  • isValidVersion - Validate versioned hash format and version byte

Gas Estimation

Nested Namespaces

Types

Main blob type. Exactly 131,072 bytes (128 KB) containing 4,096 field elements of 32 bytes each.

Usage Patterns

Creating Blobs from Data

Handling Large Data

Versioned Hashes for Transactions

Gas Cost Estimation

Batch Verification

Tree-Shaking

Import only what you need for optimal bundle size:

Core Documentation

  • Fundamentals - EIP-4844 blob structure and proto-danksharding
  • EIP-4844 - Detailed EIP-4844 specification coverage
  • KZG - KZG commitment scheme explanation

Advanced Features

  • Usage Patterns - Real-world blob transaction examples
  • WASM - WASM acceleration for KZG operations
  • Transaction - EIP-4844 transaction type (0x03)
  • Keccak256 - SHA256 and keccak256 hashing for commitments
  • Hex - Hex encoding for versioned hashes

Specification