Skip to main content
Loading…
AS Albert Schaper
  • 01Home
    • Profile & Career
    • Expertise
    • Overview
    • Results
    • Technical Depth
  • 04Projects
  • 05Contact
  • 06Insights
  • 07Tools
AS

Albert Schaper

01Home
Profile & CareerExpertise
OverviewResultsTechnical Depth
04Projects05Contact06Insights07Tools

AI · Finance · Entrepreneur

Home / Insights / How Calldata Is Laid Out: Selector, Arguments, and Offsets
Insights

How Calldata Is Laid Out: Selector, Arguments, and Offsets

After the selector's four bytes, arguments follow in 32-byte words. Static values sit in place, dynamic values point onward with an offset measured without the selector.

By Albert Schaper AI Expert & Entrepreneur
10 November 2026 CryptoWeb3
Auf Deutsch lesen LinkedIn X
Contents
  • Static arguments sit in the word
  • Dynamic arguments are a pointer
  • Without types, a word is ambiguous
  • An exercise on the placeholder calldata

Strip the labels off a raw transfer and you are left with a9059cbb plus two 32-byte words. Nothing in those bytes is named "recipient" or "amount". The ABI specification is the rule that sliced the arguments into words, and the types are what tell you which word is the address. The examples below were recomputed on 10 November 2026 with the same Keccak function that matches the specification's own examples.

How those four selector bytes are produced is covered in What the 4-byte selector means. From the fifth byte, you are reading arguments.

Static arguments sit in the word

address, uint256, and bool are static. The value is the word itself. An address is padded on the left with zeros to 32 bytes, a number is padded the same way, and true becomes 1. For transfer(address,uint256) to the example address 0x1111111111111111111111111111111111111111 with an amount of 1000, the calldata looks like this:

PartHex
Selector transfer(address,uint256)a9059cbb
Address, left-padded0000000000000000000000001111111111111111111111111111111111111111
Amount 1000 (0x3e8)00000000000000000000000000000000000000000000000000000000000003e8

0x1111…1111 is a placeholder for reading, not a payment recommendation. The zeros in front of it are padding: 20 bytes of address, 12 bytes of zeros. The specification uses the same word encoding for return values and for non-indexed event data. Those omit the four selector bytes.

Dynamic arguments are a pointer

string, bytes, and arrays do not store their contents in the head. They store an offset, counted in bytes from the start of the arguments, so the four selector bytes are outside the count. Length comes next, then the contents, padded on the right with zeros until the word is full.

For setName(string) with the text Ada:

PartMeaning
c47f0027Selector of setName(string)
0x20Offset 32: the data starts after this single head word
3Length in bytes
416461UTF-8 of Ada, padded on the right to 32 bytes

The selector, then one 32-byte word per line:

c47f0027
0000000000000000000000000000000000000000000000000000000000000020
0000000000000000000000000000000000000000000000000000000000000003
4164610000000000000000000000000000000000000000000000000000000000

Two dynamic arguments produce two offsets. The specification's layout of sam(bytes,bool,uint256[]) is the worked case: the boolean sits in the head, and the two dynamic values point to 0x60 and 0xa0. Start that count at the selector instead of at the arguments and you are four bytes out, so length and text are read from the wrong place.

Without types, a word is ambiguous

One 32-byte word can be a small number, an address, or an offset. In the setName row, 0x20 is the offset 32. The same integer would be a legal amount. The type string is what tells you to follow it.

The ABI Decoder reads the rest according to the ABI or signature you paste. If that field stays empty, it shows the selector and offers a match from its short local list. If the pasted ABI does not fit, it says so instead of falling back to the list. It does not fetch an ABI from the network, and it does not ask for a private key.

Contract creation is not a function call. In that transaction to is empty, and the data is the init code, not a selector plus arguments. The transactions documentation describes this. The Transaction Decoder shows that field; the nonce beside it is explained in What is a nonce?.

An exercise on the placeholder calldata

In the ABI Decoder, paste the signature transfer(address,uint256) and this calldata. It is the three transfer rows above, joined, with 0x only at the start:

0xa9059cbb000000000000000000000000111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000003e8

The address and the amount 1000 should become readable. Then change one digit in the amount and read the new value. Nothing is sent.


Sources:

Specification and recomputation

  • Solidity: Contract ABI Specification (head and tail, offsets excluding the selector, the sam example). Retrieved 10 November 2026.
  • Ethereum Foundation: Transactions (empty to for contract creation). Retrieved 10 November 2026.
  • transfer and setName bytes: recomputed with ethers (id and AbiCoder) on 10 November 2026. Checked against the specification selectors 0xcdcd77c0 and 0xa5643bf2.

Continue reading

  • What the 4-byte selector means
  • What is a nonce?
  • Geld 2.0
More Insights
  • Crypto

    What a Message Signature Proves — and What It Does Not

    A valid signature shows that the key for this address signed exactly these bytes under a specific prefix. It does not show that the text is true or that you should pay.

  • Crypto

    What the 4-Byte Selector Means: How Contracts Find a Function

    A call to transfer(address,uint256) starts with 0xa9059cbb. Those four bytes are Keccak-256 of the canonical signature, and the hash does not give the name back.

  • Crypto

    Learning Bitcoin and Web3: Books, papers, and where to start

    Which books and papers are worth your time depends on the question. Three reading paths, a timeline and annotated tables on founding texts, technology, money, Ethereum, DeFi, privacy, regulation and the critics — with level, access and the tools on this site.

Albert Schaper
About the author

AI expert and entrepreneur with a finance background and a focus on execution. I support companies as a partner and partly with own capital, mainly on strategy, financing and sales, and advise teams on putting AI to work. LinkedIn

← All Insights
AS

AI · Finance · Entrepreneur

Navigation

HomeAboutExpertiseProjectsContactInsightsTools

Projects

Best-AI.orgBitAutorGeld 2.0Pharmaceutical company

Tools

ETH Unit ConverterAddress ValidatorQR Code GeneratorSeed Phrase ValidatorWallet Generator

© Albert Schaper. All rights reserved.

Privacy / Imprint