What is Calldata?

1 min read Updated

Calldata is the read-only byte array sent with an Ethereum transaction that encodes function calls and parameters — the primary input mechanism for smart contract interactions.

WHY IT MATTERS

Every smart contract interaction sends calldata — the ABI-encoded function selector (first 4 bytes) followed by encoded parameters. When you call 'transfer(address, uint256)', the calldata contains the function signature hash plus the encoded address and amount.

Calldata is read-only and cheaper than storage. L2 rollups post transaction calldata to L1, making calldata efficiency critical for rollup costs. EIP-4844 (blob transactions) further reduces the cost of posting data to L1.

For developers, understanding calldata is important for gas optimization, debugging failed transactions, and building systems that parse and validate contract interactions.

FREQUENTLY ASKED QUESTIONS

How is calldata structured?
First 4 bytes: function selector (keccak256 hash of function signature). Remaining bytes: ABI-encoded parameters in 32-byte slots.
Why is calldata important for L2s?
L2 rollups post compressed calldata to L1 for data availability. L2 transaction costs are largely determined by how much calldata they need to post to L1.
Can calldata be modified?
Calldata is read-only within the EVM. Once a transaction is submitted, the calldata is fixed. The contract can read but not modify the calldata it receives.

FURTHER READING

Enforce policies on every tool call

Intercept is the open-source MCP proxy that enforces YAML policies on AI agent tool calls. No code changes needed.

npx -y @policylayer/intercept
github.com/policylayer/intercept →
// GET IN TOUCH

Have a question or want to learn more? Send us a message.

Message sent.

We'll get back to you soon.