In this track: ABI encoding foundations
advanced · 4 MIN READ

Encode an address word

Twenty address bytes occupy the lower-order part of a word.

LET’S PICTURE IT

A fixed-size address fits into a wider envelope with blank space before it.

SEE IT FOR YOURSELF
Build a transfer call from typed fieldsStep 1 / 4
Build a transfer call from typed fieldstransfer(address,uint256)Recipient: 0x0000…0001Raw amount: 100Diagram labels abbreviate addresses; the lab shows full bytes4-byte selectora9059cbbEach box is one byte; this prefix is not a 32-byte wordWord 0 · recipient address12 zero bytes20 address bytes000…0001Left padding preserves the lower-order address valueSelector4 bytesa9059cbbAddress32 bytesword 0Amount32 bytesword 1 → 0x644 + 32 + 32 = 68 bytesThe integer does not contain token decimals or market price

The standard transfer interface takes an address and a raw integer amount. This diagram uses address one and amount one hundred.

Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.

Count the original bytes

An Ethereum address is twenty bytes, commonly displayed as forty hex digits after 0x. Standard ABI encoding gives the address a thirty-two-byte slot.

Add twelve leading bytes

The remaining twelve bytes are zeros on the left. There are twenty-four leading zero hex digits before the forty address digits.

Checksum is display information

Mixed-case EIP-55 letters do not alter the encoded address bytes. A valid checksum helps with formatting mistakes but does not identify the recipient’s honesty or network deployment.

Distinguish bytes20

A fixed bytes20 value has a different ABI alignment rule from address. Two values containing similar twenty-byte content are not interchangeable without their type context.

Follow the bytes

types: address
values: ["0x0000000000000000000000000000000000000001"]
no function selector prefix

word 0 · argument offset 0 bytes
0x0000000000000000000000000000000000000000000000000000000000000001

The address occupies the last twenty bytes.

TURN UNDERSTANDING INTO PRACTICEOpen the ABI encoder →
QUICK CHECK · NO PRESSURE

How many leading zero bytes pad an address to a standard ABI word?

Your progress stays in this browser.
Keep exploring the original referenceSolidity documentation ↗

Original explanations by EtherTools. Examples are educational and source-linked; this site is independent of the Ethereum Foundation. Our approach.