What is a Method ID?
Ethereum relies on a unique identifier, known as a Method ID or a function selector, to differentiate between different functions or methods within a smart contract.
Method ID is the first 4 bytes of the Keccak-256 hash of the function signature that specifies which functions to be called. The function signature includes the function name and its parameters' types which are separated by a single comma, with no spaces in between.
The Method ID for the function signature is the first 4 bytes (or the first 8 digits) of the Keccak-256 hash.
For functions of contracts that have been verified on Etherscan, the function name will be displayed in the 'Method' column in Transactions page.
Retrieve the corresponding Method ID by going to:
Transaction details page > Input Data field
We automatically match functions for an unverified contract with known functions from verified contracts on Etherscan by comparing bytecode using a process called Similar Match.
As a result, the Method ID displayed for this function may not be 100% reliable.
For unidentified functions, the Method ID is displayed instead:
Method ID Collision
Since only the first 4 bytes of a hashed function signature are used, Method ID collisions have a possibility to occur.
For example, the Method ID 0x00000000
may represent more than one function signature:
Trolls or malicious actors may use these collisions to fool you. Always be mindful of this when browsing Methods on Etherscan!