Buy Crypto
Markets
Spot
Futures
Earn
Promotion
More
reward-centerNewcomer Zone
AcademyGlossariesDetails
Ethereum
Smart Contracts

Calldata

Definition

Calldata is a type of read-only data sent along with a transaction when interacting with a smart contract on Ethereum. It contains the instructions and input values a smart contract needs to execute a function, but it cannot be modified or stored permanently by the contract.

In simple terms, calldata is the message you send to a smart contract telling it what to do and with what information.

What Is Calldata Used For?

Calldata is mainly used to pass information into smart contracts. This includes:

  • Which function to call
  • The parameters required to run that function
  • Encoded transaction data from users or applications

Because calldata is not saved in contract storage, it is cheaper than permanent storage, making it an efficient way to supply temporary data during execution.

How Calldata Works

When a user submits a transaction to a smart contract, the transaction includes calldata that specifies the action to perform. The Ethereum Virtual Machine (EVM) reads this data, executes the requested function, and then discards the calldata once execution is complete.

For example, when a user swaps tokens on a decentralized exchange, the transaction’s calldata includes details such as the token address, the amount being swapped, and the recipient address. The smart contract reads this information, completes the swap, and does not retain the calldata afterward.

Calldata in Ethereum Scaling

Calldata plays an important role in Ethereum scaling, especially for rollups. Rollups post compressed transaction data to Ethereum using calldata so that anyone can verify off-chain transactions if needed.

However, calldata can become expensive when large amounts of data are posted. This is why newer solutions like data blobs and external data availability layers are being developed to reduce costs.

Calldata vs Storage and Memory

Calldata differs from other data locations in Ethereum:

Calldata: Read-only, temporary, and used for function inputs.

Memory: Temporary and modifiable during execution.

Storage: Persistent data saved on the blockchain and most expensive to use.

Why It Matters

Understanding calldata helps users and developers grasp how smart contracts receive instructions and why transaction costs vary. It also explains why rollups rely on calldata for transparency and why optimizing data usage is critical for Ethereum’s scalability.

Calldata may be invisible to most users, but it is a core building block of how smart contracts and scaling solutions function on Ethereum.