Turn a function name and typed arguments into bytes.
LET’S PICTURE IT
An ABI is the form both sides agree to use: this field is an address, this one is a number, and this action has a specific name.
SEE IT FOR YOURSELF
Build a transfer call from typed fieldsStep 1 / 4
The standard transfer interface takes an address and a raw integer amount. This diagram uses address one and amount one hundred.
The standard transfer interface takes an address and a raw integer amount. This diagram uses address one and amount one hundred.Keccak-256 of the canonical signature supplies the first four bytes. The transfer selector is a9059cbb.An address is twenty bytes. Standard ABI encoding adds twelve zero bytes on the left to fill one thirty-two-byte word.The integer one hundred is hex 64, left-padded in word one. Selector plus two words produces sixty-eight bytes of standard calldata.
Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.
An interface, not the whole program
The Application Binary Interface describes functions, arguments, return values, events and errors. It lets a wallet or app construct calls and interpret results. It does not explain every permission or guarantee that the deployed code matches your expectations.
Pick a function with four bytes
For transfer(address,uint256), take Keccak-256 of that exact canonical signature, then keep its first four bytes: 0xa9059cbb. That selector starts the calldata. A selector is short, so collisions are possible; it is not a globally unique identity.
Encode the arguments
An address is left-padded to a 32-byte word. A uint256 also occupies a 32-byte word. Dynamic values such as strings use offsets and separate data sections. Decode using a known interface: arbitrary bytes do not tell you their intended types by themselves.
Try both directions
Use the ABI encoder for transfers, approvals, strings and custom function declarations. Then paste its result into the calldata decoder. The trace separates the selector, raw words and decoded arguments so you can connect the readable request with its binary representation.