Calldata
The data section of a transaction that tells a contract what to do; rollups also use it to publish batches.
Basically
Calldata is information attached to an Ethereum transaction that cannot be changed. Rollups can use it to publish their data on Ethereum Layer 1.
Key Takeaways
- Calldata is the read-only input data field attached to every Ethereum transaction, used to pass function arguments to smart contracts. It costs 16 gas per non-zero byte and 4 gas per zero byte under standard pricing.
- Layer 2 rollups historically posted compressed transaction batches as calldata to Ethereum L1 for data availability, making it the dominant cost driver for rollup fees.
- EIP-4844 blob transactions, introduced in the Dencun upgrade in March 2024, provide a cheaper alternative to calldata for rollup data, reducing L2 fees by over 90%.
What Is Calldata?
Calldata is the immutable byte array included in every Ethereum transaction. It carries instructions telling the receiving smart contract which function to execute and what parameters to use. Unlike contract storage, calldata cannot be modified during execution and is strictly read-only.
Simple ETH transfers have an empty calldata field. Smart contract interactions contain an ABI-encoded payload, with the first 4 bytes forming the function selector derived from hashing the function signature and the remaining bytes encoding arguments in 32-byte slots. This data stays permanently on-chain as part of the transaction record but does not occupy the EVM's state trie, making it significantly cheaper than contract storage.
Calldata gained outsized importance in the rollup era because it provides a permanent, verifiable record on Ethereum L1. Rollups used it as their primary mechanism for publishing compressed transaction batches, ensuring anyone could reconstruct the L2 state independently and providing the data availability guarantees that rollup security depends on.
How It Works
Three EVM opcodes interact with calldata. Contracts use them to read the transaction input during execution.
Calldata has no opcode for writing to it. This immutability prevents contracts from tampering with their own input during execution.
Encoding Format
Smart contract function calls use ABI-encoded calldata. The encoding follows the Solidity ABI specification.
Static types like uint256 and address are encoded directly into 32-byte slots. Dynamic types like bytes and string use offset pointers to locate their data within the payload.
Gas Cost Structure
Calldata gas pricing has evolved through several Ethereum upgrades. The main changes came through EIP-2028 and EIP-7623.
EIP-2028, activated in the Istanbul hardfork in December 2019, reduced non-zero byte costs from 68 to 16 gas. This 4.25x reduction was specifically motivated by enabling Layer 2 scaling, since cheaper calldata meant cheaper rollup data posting.
EIP-7623, activated in the Pectra upgrade in May 2025, introduced a two-tier pricing system. Standard transactions still pay 16 gas per non-zero byte and 4 gas per zero byte, while transactions consisting mainly of calldata with minimal EVM computation, such as rollup batch postings, pay a higher floor rate of 40 gas per non-zero byte and 10 gas per zero byte. This change reduced Ethereum's worst-case block size from approximately 7.15 MB to 0.72 MB while incentivising remaining rollups to migrate from calldata to blob transactions.
Calldata in Layer 2 Rollups
Calldata was the sole mechanism for rollup data availability on Ethereum before the Dencun upgrade. Both optimistic rollups and ZK rollups relied on it to publish their compressed transaction data to L1.
The process follows a consistent pattern across rollup types. Rollups publish their compressed transaction data to Ethereum L1.
Data availability costs constituted roughly 90% of rollup gas fees on L1. Rollups competed for the same 30 million gas block limit as regular L1 transactions, so congestion on Ethereum directly inflated L2 costs. A busy NFT mint or DeFi event on L1 would spike fees for rollup users who had nothing to do with the L1 activity.
EIP-4844 and the Shift to Blobs
Proto-danksharding, or EIP-4844, was activated in the Dencun upgrade on March 13, 2024 and introduced blob transactions as a purpose-built alternative to calldata for rollup data availability. It was the most significant change to Ethereum's data economics since EIP-2028.
How Blobs Differ from Calldata
The separate fee market is the critical innovation. L1 congestion no longer affects rollup data costs, and vice versa. Blob pricing follows an EIP-1559-style mechanism, so the blob base fee increases when a block contains more blobs than the target and decreases when it contains fewer.
The 18-day retention period is sufficient for rollup security because fraud proof windows, typically 7 days for optimistic rollups, and validity proof verification periods are shorter than the pruning window. Any party needing the data for longer-term purposes can archive it independently.
Cost Impact
The shift from calldata to blobs produced dramatic fee reductions across major L2 networks. Lower data availability costs fed directly into lower user fees.
Average fees across the largest rollups had declined over 99% compared to pre-Dencun levels by early 2026, reaching fractions of a cent per transaction. For a deeper analysis of how Ethereum's Layer 2 ecosystem has evolved, see the Ethereum L2 lessons for Bitcoin scaling research article.
Smart Contract Function Calls
The original and most common use of calldata is encoding function invocations. Every DeFi swap, NFT mint, token transfer and governance vote passes its parameters through calldata. The function selector in the first 4 bytes tells the contract what to execute, while the remaining bytes carry the arguments.
Rollup Data Availability
Rollups that have not yet migrated to blobs still use calldata for posting compressed transaction batches. Some rollups also maintain calldata as a fallback mechanism when blob space is congested, since calldata availability is guaranteed as long as the transaction is included in a block.
On-Chain Data Storage
Calldata is permanently stored on-chain but costs less than contract storage, with SSTORE costing up to 22,100 gas for 32 bytes versus at most 512 gas for 32 bytes of calldata. Protocols sometimes use calldata for write-once data that needs to be verifiable but not frequently accessed, while event logs serve a similar purpose but are not accessible to the EVM during execution.
Ethereum Inscriptions
Ethereum saw a wave of "ethscriptions" in 2023 and 2024 following the popularity of Bitcoin inscriptions, embedding arbitrary data such as images and text in transaction calldata. This pattern exploited the relative cheapness of calldata compared to contract storage, though EIP-7623's floor pricing made data-heavy calldata transactions more expensive starting in 2025.
Why It Matters
Calldata economics have shaped the entire Layer 2 ecosystem. The cost of posting data to Ethereum L1 directly determines what rollup users pay per transaction. Every reduction in calldata cost through EIP-2028 or introduction of cheaper alternatives such as EIP-4844 blobs has cascaded into lower L2 fees, driving adoption across the ecosystem.
Calldata is central to comparisons of blockchain scaling approaches. Bitcoin Layer 2 solutions like Spark take fundamentally different approaches to data availability and off-chain scaling. Ethereum rollups rely on posting compressed data to L1 as calldata or blobs, while Spark uses a statechain-based model where off-chain state transfers avoid the need for L1 data posting entirely, eliminating this cost category.
Permanent State Bloat
Calldata is stored permanently by every full node on the Ethereum network, unlike blob data. Heavy calldata usage contributes to state growth and increases the storage requirements for running a node. This was one motivation behind EIP-7623, which discourages large calldata payloads that inflate worst-case block sizes.
Cost Volatility
Calldata shares Ethereum's regular gas market, so its cost fluctuates with L1 congestion. Costs can spike dramatically during peak demand. Rollups still using calldata pass this volatility directly to end users as unpredictable L2 fees.
Migration Complexity
The transition from calldata to blobs requires rollups to update their batch submission infrastructure. Major rollups completed this migration shortly after Dencun, but smaller or newer rollups may still rely on calldata. The EIP-7623 floor pricing creates economic pressure to complete the migration, but the transition requires careful testing to ensure data availability guarantees are maintained.
Calldata Limitations for Rollups
Calldata had inherent limitations for rollup data availability even before blobs because it competes with regular transactions for block space, creating a throughput ceiling. The 30 million gas block limit constrains how much data all rollups combined can post per block. Blob space, while currently limited to 9 blobs per block post-Pectra, operates on a separate budget that scales independently through future upgrades.
The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.