Skip to main content

Try it Live

Run FeeMarket examples in the interactive playground

EIP-4844 Blob Fee Calculations

Exponential blob base fee pricing for data availability.

Overview

EIP-4844 introduced blob transactions with separate fee market:
  • Target: 3 blobs per block (393,216 gas)
  • Maximum: 6 blobs per block (786,432 gas)
  • Each blob: 131,072 gas (128 KiB)
  • Pricing: Exponential based on excess blob gas
  • Minimum: 1 wei per blob gas

BlobBaseFee

Construct blob base fee using exponential formula. Parameters:
  • excessBlobGas - Accumulated excess blob gas from previous blocks
Returns: Blob base fee (wei per blob gas) Formula:
Uses Taylor series approximation for exponential. Examples:
Behavior:

calculateExcessBlobGas

Calculate excess blob gas for next block. Parameters:
  • parentExcessBlobGas - Excess blob gas from parent
  • parentBlobGasUsed - Blob gas used in parent
Returns: Next block’s excess blob gas (>= 0) Formula:
Examples:

getBlobBaseFee

Get current blob base fee from state. Parameters:
  • state - Block state with excessBlobGas
Returns: Current blob base fee (wei per blob gas) Example:
State method:

isAboveBlobGasTarget

Check if block blob gas usage is above target (will increase blob base fee). Parameters:
  • state - Block state
Returns: true if blobGasUsed > TARGET_BLOB_GAS_PER_BLOCK Example:
State method:

Constants

See constants.mdx#eip4844:

Blob Fee Dynamics

Fee Growth

Exponential growth when blocks exceed target:

Fee Decay

Linear decay when blocks below target:

Equilibrium

Constant 3 blob usage maintains stable fees:

Fake Exponential

Internal helper implementing Taylor series approximation:
Approximates: factor * e^(numerator / denominator) Uses Taylor series: 1 + x + x²/2! + x³/3! + ... Implementation: See BrandedFeeMarket/fakeExponential.js Properties:
  • Converges quickly for normal excess values
  • Maximum 256 iterations
  • Pure bigint arithmetic (no floating point)

Usage Patterns

Blob Fee Estimation

Blob Count from Gas

Monitoring Blob Utilization

Blob Transaction Fees

See calculations.mdx#calculateBlobTxFee:

Implementation

Locations:
  • BrandedFeeMarket/BlobBaseFee.js
  • BrandedFeeMarket/calculateExcessBlobGas.js
  • BrandedFeeMarket/fakeExponential.js
See branded-feemarket.mdx for implementation details.

References