Skip to main content

Try it Live

Run Transaction examples in the interactive playground

EIP-4844 Transactions

Blob transactions for L2 data availability, introduced in Dencun hard fork.

Overview

EIP-4844 transactions (Type 3) attach large data blobs for L2 rollup data availability. Blobs are pruned after ~18 days but provide cheaper data storage than calldata.

Type Definition

Source: types.ts:111-130

Creating EIP-4844 Transactions

Blob Basics

Blob Size

  • Each blob: 128 KB (131,072 bytes)
  • Maximum: 6 blobs per transaction
  • Blob data stored separately from transaction

Blob Gas

  • Fixed: 131,072 gas per blob
  • Total blob gas = blob_count × 131,072

Versioned Hashes

Blob commitments using KZG (Kate-Zaverucha-Goldberg):

getBlobGasCost

Calculate total blob gas cost.

Usage

Formula:
Source: EIP4844/getBlobGasCost.js:13-18

Total Cost

Example:

Blob Base Fee

Blob base fee adjusts independently from execution base fee:
Target: 3 blobs per block
  • < 3 blobs: blob base fee decreases
  • > 3 blobs: blob base fee increases

getEffectiveGasPrice

EIP-4844 uses same execution gas pricing as EIP-1559:

Methods

Blob Data

Blob data is NOT included in transaction:

RLP Encoding

Blob data transmitted separately in network layer.

Use Cases

  1. L2 Rollups - Post transaction data for data availability
  2. Data availability - Cheaper than calldata
  3. Temporary storage - Data pruned after ~18 days

Limitations

  1. No contract creation - to cannot be null
  2. Pruning - Blobs deleted after ~18 days
  3. Size limit - Maximum 6 blobs (768 KB)
  4. Network support - Requires Dencun hard fork

Cost Comparison

MethodCost (per byte)PersistentUse Case
calldata~16 gasForeverPermanent data
Blobs~1 gas~18 daysL2 rollup data
Storage~20,000 gasForeverContract state
Blobs are ~16x cheaper than calldata for temporary data.

When to Use

Use EIP-4844 for:
  • L2 rollup data availability
  • Temporary large data (< 768 KB)
  • Cost optimization for data posting
Use calldata for:
  • Permanent data needed
  • Data < 10 KB
  • Pre-Dencun networks

EIP Reference