Topic zero usually identifies the event’s canonical shape.
LET’S PICTURE IT
A full-length label names a kind of record before its fields are interpreted.
SEE IT FOR YOURSELF
From an emitted Transfer event to a receipt logStep 1 / 4
A token implementation may update balances and emit its standard Transfer event. State and the emitted record are related but distinct.
A token implementation may update balances and emit its standard Transfer event. State and the emitted record are related but distinct.A non-anonymous Transfer event uses the full thirty-two-byte Keccak-256 signature digest as topic zero, not a four-byte function selector.In the common ERC-20 shape, from and to occupy topics one and two. The raw value is a thirty-two-byte data word. Other standards can index fields differently.An application can decode receipt logs under the correct ABI. A matching signature does not establish that an unknown emitter is an honest token.
Animated local teaching model. No wallet, RPC or live blockchain data. Some labels and hashes are abbreviated for readability.
Form the canonical signature
For the common Transfer event, the canonical text is Transfer(address,address,uint256). Parameter names and the indexed keyword do not belong in that signature text.
Keep the full digest
A non-anonymous event uses the entire thirty-two-byte Keccak-256 digest as topic zero. Do not shorten it to the four bytes used for function selectors.
Preserve the index schema separately
The signaturehash does not tell you which fields were indexed. You still need the event declaration to divide argument values between remaining topics and data.
Check the emitting address
Any contract can emit a matching topic. The topic identifies a claimed shape, while the emitter, network and implementation provide essential context for interpreting the record.
Inspect the example
event Transfer(address indexed from, address indexed to, uint256 value)
topic 0: 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef
topic 1: 0x0000000000000000000000000000000000000000000000000000000000000001
topic 2: 0x0000000000000000000000000000000000000000000000000000000000000002
data: 0x0000000000000000000000000000000000000000000000000000000000000064
Toy emitter; from address 1; to address 2; raw amount 100.
No token decimals or verified token identity are implied.
Compare topic zero with the eight-digit selector in the ABI encoder.