What is calldata?
The read-only input data sent with a transaction, holding the function being called and its arguments.
Not yet verifiedHow we verify
3 min read
In this entry
The read-only input data sent with a transaction, holding the function being called and its arguments.
Calldata is what a wallet is summarizing when it says a transaction "approves" or "swaps" something. Every interaction with a smart contract carries it, and reading the decoded summary before signing is the main defense against a site that asks for one thing and encodes another. Rollup engineers care about calldata for a different reason: it is the cheapest durable place to publish transaction batches on Ethereum, and every byte has a price.
The common mistake is treating the wallet's plain-English summary as the transaction. It is a decoding of the calldata, produced by the wallet from a contract description it may or may not have. When a wallet shows raw hex instead of a sentence, that is not a display bug. It is the wallet telling you it cannot read the contract you are about to authorize.
How it works
Calldata is charged by the byte rather than by execution. EIP-2028 cut the cost of a non-zero calldata byte from 68 gas to 16 and left zero bytes cheaper still, which is why rollups compress their batches into forms that produce long runs of zeros.
The first four bytes are a function selector, derived from the function's name and argument types. Everything after that holds the arguments, padded into fixed-width words. A wallet or a block explorer matches the selector against an abi to produce the readable summary you see.
Calldata is read-only. A contract can read it but cannot modify it, which is why passing a large argument as calldata is cheaper than copying it into memory first.
Example
These figures are illustrative. Suppose a rollup posts a 100,000-byte batch to Ethereum, 60,000 of them zero bytes at 4 gas each and 40,000 non-zero at 16 gas each under EIP-2028. That is 240,000 plus 640,000, so 880,000 gas before any execution cost. At an illustrative 20 gwei base fee the batch costs about 0.0176 ETH to publish, split across every user in it. Cutting the non-zero byte count in half would remove roughly 320,000 gas from the bill.
Why it matters when you buy
If you buy through a dex rather than a centralized venue, the calldata is the actual agreement and the wallet summary is your only chance to catch a swap that routes somewhere you did not intend. Calldata cost is also a large share of what a layer-2 charges per transaction, which is part of why per-transaction costs differ across the chain pages. If you are buying on a centralized exchange, none of this reaches you, and the fee comparison is the page that matters.
Related terms
abi — the map that decodes calldata into names; blob transaction — cheaper rollup data that is not calldata; gas — how transaction work is priced; token approval — the permission most often buried in calldata; blind signing — signing data your wallet cannot decode.
Questions
Can I read calldata before I sign?
Yes. Wallets decode it when they can match the function selector to a known contract description, and show raw hex when they cannot. A block explorer will decode calldata for any verified contract, so you can check it independently before approving.
Does calldata cost more than execution?
For a simple transfer, no. For rollups posting batches to Ethereum it has historically been the dominant cost, which is why blob transactions were introduced to give them a cheaper place to put the same data.
Is calldata stored forever?
It is part of the transaction, so it persists in chain history for as long as nodes retain that history. Blob data is different by design and is pruned after a fixed period.