Identity & evidence3 min read

Indexed Event Topics vs ABI Data Fields

Decode indexed and non-indexed Solidity event arguments correctly, including dynamic-type hashes and why some original values cannot be recovered from topics.

Editorial illustration accompanying indexed event topics vs abi data fields.

Overview

When translating these concepts into an integration, keep the scope described by the wallet history api with the result. The examples in wallet transaction history and smart contract event logs show how the same distinction affects neighbouring data questions.

Solidity events divide arguments between topics and data according to their declaration. A decoder must follow the ABI layout rather than assume every argument appears as an ordinary value in the data payload.

Read the event declaration

For non-anonymous events, the first topic identifies the event signature. Indexed arguments occupy additional topics according to ABI rules. Dynamic indexed values are represented by hashes of their encoded content, so the topic is not generally the original string or array. Non-indexed arguments are decoded from the data field.

Worked example: an indexed label

An event indexes a dynamic string label. The topic contains a hash representation, not a directly readable label. Displaying that hash as the original text is incorrect. A known candidate can sometimes be checked against the encoding rule, but arbitrary original content cannot simply be decoded from the hash.

Test ABI mismatches

Include anonymous events, overloaded names and dynamic non-indexed arrays. Validate emitting contract and topic count before interpreting values. Preserve undecodable logs and the ABI reference used. A successful byte parser does not by itself establish that the chosen event declaration belongs to that contract at that historical block.

A practical acceptance test

Include a non-anonymous event, an anonymous event and an indexed dynamic string. Verify the correct topic layout for each. The dynamic topic should remain a hash representation, not fabricated readable text. A mismatched ABI must produce a bounded decoding failure with raw topics and data preserved for later inspection.

Questions about the topic

Frequently asked questions

Can an indexed dynamic string always be recovered?

No. The topic contains a hash representation rather than the full original value.

Do anonymous events use the same signature-topic layout?

No. Their topic layout must be handled according to the ABI.

Standards & technical documentation

Further reading

{{TODO: author name}}

Practical explanations of blockchain data, software integration and the context behind a record.

About Indexbase
← Back to all articles

Build with better context.

Get an update when private beta opens.

Form setup in progress. Nothing entered here is sent or saved. {{TODO: endpoint}} See the full form and email alternative.