Four bytes cannot uniquely label every possible function signature.
LET’S PICTURE IT
A short badge number can be reused when the space of possible names is much larger than the badge space.
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.
The selector space is finite
Four bytes provide 2³² possible bit patterns. The set of possible function signatures is far larger, so collisions exist even with a cryptographic hash.
A collision does not break the full hash
Keeping only four bytes deliberately discards most of the digest. A short-prefix collision is not the same as finding two inputs with the same complete Keccak-256 output.
Dispatch needs context
The target contract determines how selectors are handled. A signature database can suggest a candidate name but does not prove the intended function at every address.
Validation still matters
A correct ABI and deployed-code context help interpret a request. Never treat a decoded familiar name as sufficient evidence of a contract’s permissions or safety.
Follow the bytes
Full Keccak-256 digest: 32 bytes
Function selector prefix: 4 bytes
Selector possibilities: 2^32
Discarded digest bytes are not part of ordinary dispatch.
Short identifiers are useful without being globally unique.