Calldata Compression

Shrinking the data a rollup posts to the base chain, which is usually its largest running cost.

Basically

Layer 2 rollups bundle transactions and post their data to Layer 1. Smaller data costs less to post, so you pay lower transaction fees.

Key Takeaways

  • L1 data posting is the largest cost for rollup users. Calldata compression shrinks the data each batch posts to Ethereum, which directly lowers transaction fees.
  • Common techniques include zero-byte optimisation, address table lookups and custom compact encoding. Address tables replace 20-byte addresses with short indices, compact encoding drops ABI padding, and general-purpose compressors include zlib and brotli.
  • EIP-4844 moved rollups from calldata to blob transactions, but compression still matters. Smaller compressed batches need fewer blobs and cost less in the blob fee market.

What Is Calldata Compression?

Calldata compression covers techniques that Layer 2 rollups use to shrink transaction data before posting it to Ethereum Layer 1. Rollups get their security by publishing enough data for anyone to reconstruct the L2 state. That data submission is the largest part of the transaction fees you pay, so compressing it before it reaches L1 directly lowers those fees.

A standard Ethereum transaction can use 100+ bytes of calldata per transfer, much of it padded or predictable. Rollups batch hundreds or thousands of L2 transactions into one L1 submission. Even small savings per transaction add up to significant cost reductions across a batch.

Why L1 Data Cost Dominates

Ethereum charges gas for every byte of calldata in a transaction. Ethereum charged 68 gas for each non-zero calldata byte before EIP-2028 (Istanbul, December 2019). EIP-2028 cut non-zero bytes to 16 gas and kept zero bytes at 4 gas. This 4:1 price ratio between non-zero and zero bytes rewarded data formats that maximise zero bytes.

L1 data typically accounts for 80-90% of total user fees for rollups, while L2 execution is comparatively cheap. Smaller data therefore maps almost linearly to lower user costs. Compression is one of the highest-leverage optimisations a rollup can implement.

How It Works

Rollup compression works at several layers, from transaction-level encoding to batch-level algorithms. The most effective systems combine several of these techniques.

Zero-Byte Optimization

Ethereum's calldata pricing charges less for zero bytes at 4 gas than for non-zero bytes at 16 gas. Compression schemes use this difference by encoding data into formats that produce more zeros. One approach uses run-length encoding for zero sequences, storing a single marker and a count instead of a long run of zero bytes.

Optimism's early compression used a simple zero-byte run-length encoding (ZLE) algorithm. It replaced strings of consecutive zeros with a count value. The approach was straightforward but delivered meaningful savings because ABI-encoded calldata contains heavy zero padding.

EIP-7623 (Pectra, 2025) later raised calldata gas costs to 10 gas per zero byte and 40 gas per non-zero byte. These changes made calldata even more expensive relative to blobs. They also encouraged the move to blob-based data posting.

Address Table Lookups

Ethereum addresses are 20 bytes long, but many rollup transactions repeatedly reference the same addresses. These include popular token contracts, DEX routers and bridge contracts. Address table compression keeps a registry of known addresses and replaces each 20-byte address with a short index.

Arbitrum implements this through an Address Table precompile that maps addresses to integer indices. A transaction that references a registered address can use a 3-4 byte index instead of the full 20-byte address, saving 16-17 bytes per reference. Testing showed roughly 26% gas reduction for certain transaction types from this technique alone.

Sequence's compression system goes further with a directory of frequently used addresses, each referenced by a 3-byte directory index. Its production deployment across Arbitrum, Optimism and Base reported approximately 5x calldata compression. It also reported roughly 50% lower L2 fees.

Custom Compact Encoding

Standard Ethereum transactions use ABI encoding, which pads every value to 32 bytes. A uint8 value of 5 occupies a full 32-byte slot and wastes 31 bytes. Rollups can define custom encoding formats that pack values tightly.

Compact encoding uses several key techniques. Each technique packs transaction values into less space than standard ABI encoding.

These techniques can reduce a standard ~112-byte ETH transfer to approximately 12 bytes of rollup calldata. That is roughly a 9x compression ratio.

General-Purpose Compression

Rollups apply standard compression algorithms to the entire batch after application-level encoding. They compress the batch before posting it to L1.

General-purpose compressors work best on structured, repetitive data. They are less effective on addresses, hashes and signatures, which look almost random to the algorithm. Application-level techniques such as address tables and field omission complement general-purpose compression because they remove data that compressors cannot shrink.

The Shift to Blobs (EIP-4844)

EIP-4844 (Proto-Danksharding), activated in March 2024, introduced blob transactions as a new, cheaper way for rollups to post data to Ethereum. Rollups now attach fixed-size 128 KiB blobs to transactions instead of embedding data in calldata. A separate blob fee market prices blobs through its own base fee, independent of the regular gas market.

Research shows that rollups rapidly moved from calldata to blobs after EIP-4844, with calldata-based data posting falling to near zero. Blobs are temporary and are pruned after approximately 18 days. The EVM cannot access them, which makes them cheaper but limits their use to data availability.

Compression still matters in the blob era for two reasons. Smaller compressed batches require fewer blobs and cost less in the blob fee market.

Reducing Rollup Transaction Fees

The most direct use case is lowering costs for end users. Every byte saved in L1 data posting lowers fees. High-volume rollups process millions of transactions daily, so even small per-transaction savings add up to significant cost reductions that make the chain more competitive.

Enabling Micropayments and High-Frequency Applications

Applications such as gaming, social media tipping and IoT microtransactions need sub-cent fees to be viable. Aggressive calldata compression helps rollups reach the fee levels these use cases require. Without compression, the fixed L1 data cost per transaction would price out many of these applications.

Increasing Effective Throughput

Compression effectively multiplies a rollup's throughput without changes to the base layer. A rollup that compresses its data by 5x can fit 5x more transactions into the same amount of L1 block space or blob space. This increases network capacity without protocol upgrades.

Cross-Chain and Multi-Layer Posting

Bitcoin Layer 2 solutions face similar data-posting constraints. Protocols such as Spark and other Bitcoin L2s must consider data efficiency when anchoring state to the Bitcoin base layer, where block space is even scarcer and more expensive than on Ethereum. Compression techniques first developed for Ethereum rollups inform the design of data-efficient protocols across all blockchain ecosystems.

Decompression Overhead

Every compression scheme needs a decompression step. Rollups must use either an on-chain decompressor contract, which costs execution gas, or off-chain decompression for validators and verifiers. The gas savings from smaller calldata must exceed the gas cost of decompression, or the net effect is negative.

Complexity and Attack Surface

Custom encoding formats and compression logic add complexity to the rollup's critical path. Bugs in compression or decompression can cause state mismatches between the rollup and its verification system. A compression bug could make fraud proofs fail for optimistic rollups, while ZK-rollups must make the compression logic provable within the proof system.

Diminishing Returns

Compression techniques interact with each other. Address table lookups and field omission can reduce the effectiveness of later general-purpose compression because less redundancy remains. Teams must benchmark combined approaches against real transaction data to find the best combination for their workload.

Pricing Model Changes

Ethereum's calldata pricing has changed several times: EIP-2028 lowered non-zero byte costs, EIP-7623 raised them and EIP-4844 introduced blobs. Compression strategies optimised for one pricing regime can become suboptimal under another. Rollups need flexible compression pipelines that can adapt to changing L1 economics.

Further Reading

You can read the glossary entries on rollups, data availability, blob space and gas optimisation for more context on how rollups work and why data availability matters. The research article on Ethereum's EIP-4844 blob fee market explains blob pricing in detail.

Nuri provides this glossary entry for informational purposes only, not as financial or investment advice. Always do your own research before using any protocol or technology.

0

← All 1876 glossary terms