GOMTU Crypto
guidePart 15 of 15 in this guide

Ethereum Calldata Explained: How to Decode Transaction Input Data

Learn how Ethereum calldata encodes function selectors and arguments, how explorers decode it, and what to verify before signing a contract transaction.

GOMTU
GOMTU
Crypto Research · August 4, 2026 · 5 min read
Share𝕏in
Ethereum Calldata Explained: How to Decode Transaction Input Data

Your wallet asks you to approve a contract interaction, but the raw input looks like an endless hexadecimal string. That string is not random. It is calldata: the machine-readable instruction telling a smart contract what function to run and which values to use. Understanding its structure connects blockchain basics with safer signing—even if you never decode every byte by hand.

This guide covers the standard Solidity ABI layout, what block explorers can and cannot infer, and what to verify before signing. It applies to Ethereum and EVM-compatible chains, but accurate decoding still requires a trusted interface and the correct chain context.

What Ethereum calldata is

Advertisement

An Ethereum transaction includes fields such as destination (to), ETH amount (value), fee settings, nonce, and optional input data. When the destination is a smart contract, that input commonly contains calldata encoded according to the contract's Application Binary Interface (ABI).

Think of a restaurant order ticket. The first line identifies the dish; the remaining lines specify size and extras. The kitchen needs both the ticket format and menu to interpret it. Likewise, the Ethereum Virtual Machine receives bytes, while an ABI supplies the type-aware menu used to decode them.

Calldata is read-only input during an external call. It differs from storage, which persists in blockchain state, and memory, which is temporary workspace during execution. A plain ETH transfer can have empty input. A contract deployment uses the data field for creation code and constructor arguments instead of calling an existing contract function.

How a contract call is encoded

A typical Solidity call has two parts:

0x | 4-byte function selector | ABI-encoded arguments

The Solidity ABI specification defines the selector as the first four bytes of the Keccak-256 hash of the canonical function signature. That signature contains the function name and parameter types, without spaces or return types. For example, transfer(address,uint256) has the widely recognized selector 0xa9059cbb.

Everything after those four bytes represents arguments. ABI values are generally arranged in 32-byte words. Fixed-size values are padded; dynamic values such as strings and variable arrays use offsets pointing to data later in the payload.

Why a selector is not proof

Four bytes have a finite number of combinations, so different function signatures can share a selector. A public selector database can suggest candidates, but cannot prove which interface a deployed contract implements.

ABI encoding is not self-describing either. Raw bytes do not reliably label a word as an address or an offset as an array pointer. You need the correct ABI, preferably tied to verified source code for the exact address and chain.

A practical decoding workflow

1. Confirm the chain and destination

Start with the network and to address. A malicious address can imitate a legitimate application, and the same interface can connect to another chain. Obtain addresses from official project documentation—not search ads, replies, or direct messages.

2. Check verified source and proxy context

A reputable explorer may publish verified source and an ABI. If the address is a proxy, execution may be delegated to an implementation contract. Confirm that the explorer identifies the current implementation; reading only the proxy shell can be incomplete.

3. Match the selector to the trusted ABI

Compare the first four bytes with functions in the verified ABI. Treat selector databases as hints. The contract address plus verified implementation is stronger evidence than a four-byte label alone.

4. Decode arguments and normalize units

Decode values using their declared types. Token amounts are commonly integers in base units, so human-readable display depends on the token's decimals. Inspect recipient addresses, spenders, allowances, minimum outputs, deadlines, token IDs, and array contents.

5. Compare the result with your intent

Ask: “Does this authorize exactly what I meant to do?” A decoded method name is insufficient. An approve call only makes sense when you inspect the token, spender, and allowance together.

Calldata, gas, logs, and blobs differ

ConceptPurposeAvailable to execution?Persistent contract state?
CalldataCall inputYesNo
MemoryTemporary workspaceYesNo
StoragePersistent variablesYesYes
Event logsReceipts for offchain indexingContracts emit themNo
Blob dataTemporary data availabilityNot readable as calldataNo

Calldata affects gas because nodes carry and process transaction bytes. Pricing rules have changed through upgrades, including EIP-2028 and EIP-7623, so use a current estimator instead of hard-coding a per-byte assumption. Execution can cost much more if the function writes storage or makes external calls. Our gas fees guide explains the distinction.

Security risks and limitations

Human-readable labels can be wrong

Wallet and explorer decoders depend on metadata. An unverified ABI, outdated proxy implementation, selector collision, or malicious token metadata can produce a reassuring but incorrect label. Decoding improves visibility; it does not make a contract trustworthy.

Calldata is public

Never put secrets in transaction input. Broadcast calldata can be observed by network participants and becomes public chain history when included. Hexadecimal display is not encryption.

Simulation is not a guarantee

A wallet simulation estimates effects against a particular state. State can change before inclusion, contracts can branch on changing conditions, and tools may miss unsupported behavior. Treat simulation as another check, not a promise.

Decoded intent can still be dangerous

A perfectly decoded call may grant an unlimited allowance, transfer an NFT, change wallet authority, or execute a swap with weak slippage protection. Risk lies in values and contract behavior, not only readability. See clear signing versus blind signing for signing defenses.

Warning

If a wallet cannot show the destination, method, important parameters, and expected asset changes for an unfamiliar contract, stop. Never sign because someone says the hex is “just verification.”

Before-signing checklist

  • Confirm chain, account, and destination
  • Verify the address through an official source
  • Check verified source, ABI, and proxy implementation
  • Inspect every security-relevant argument
  • Normalize token amounts with correct decimals
  • Review spender, recipient, deadline, minimum output, and allowance
  • Compare simulation with intended asset changes
  • Reject unexplained calldata or pressure to sign

FAQ

Can I decode calldata without the ABI?

You can isolate the selector and inspect 32-byte words, but reliable type interpretation needs the correct interface. Pattern matching produces candidates, not proof.

Can calldata change after I sign?

Changing a signed field invalidates the signature. However, a website can present misleading context before signing, and execution can depend on changing state. Verify the wallet's final confirmation.

Why does a token amount look too large?

The ABI carries an integer. Wallets display decimals using the token contract's decimals value. Verify both the token address and decimals.

Does empty calldata mean a transaction is safe?

No. Destination, value, chain, and account still matter. Sending ETH to a contract with receive or fallback logic can also execute code.

Primary sources

Read the instruction, then judge the contract

Calldata bridges a button you click and a function the EVM executes. Read it in layers: chain and address, trusted ABI, selector, arguments, units, and expected result. Decoding does not remove contract or phishing risk, but it gives you facts to compare with your intent.

This article is educational and not financial advice. Smart-contract transactions can be irreversible and may cause complete loss. Test unfamiliar actions with an amount you can afford to lose, verify current primary documentation, and do your own research (DYOR).

Advertisement

Keep learning

Explore related topics

More from GOMTU