Solidity Function Selector

Compute the 4-byte function selector for any Solidity function signature — the same selector that appears in transaction call-data.

Canonical form
transfer(address,uint256)
4-byte selector (function ID)
0xa9059cbb
Event topic (32-byte hash)
0xa9059cbb2ab09eb219583f4a59a5d0623ade346d962bcd4e46b11da047c9049b

The selector is the first 4 bytes of Keccak-256 of the canonical signature — the same prefix that appears in every transaction's call-data. Also used as the topic0 for Solidity events.