The web3.js (1.0) docs helpfully list the return values from a contract event subscription. I've noticed that there is an additional return value id that isn't listed there but is returned with the rest of the log data. An example of one is log_6b4f6cdd.

I'm looking for something that can help me uniquely identify a particular event even within a single tx or block. Is the id unique at least within a given contract?

2 Answers 2


You can uniquely identify a particular event with the transactionHash combined with the logIndex.

I'm not sure what the id value is you're getting. Using a geth node, I don't get it.


Use this code to uniquely identify the event:

const eventId = { blockHash, transactionHash, logIndex }

Note that blockHash is required because there may be multiple events with the same topic in a single transaction.

Also, blockHash is required instead of blockNumber to make the code robust against chain reorgs (different blockHash, same blockNumber).

  • how will blockHash help in this situation of multiple events of same topic in same transaction? won't the block also be the same for them too?
    – user566245
    Feb 22, 2023 at 3:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.