I'm launching an author_submitAndWatchExtrinsic and would like to get the Tx Hash as well:







But from the websocket I can only get this information.

I would like to understand how to identify my Tx in the block, because I have to understand if it was executed successfully or not, it's not enough for me to know if it was included in a finalized block.

Is there no way to recover at least the Tx Hash?

According to documentation https://wiki.polkadot.network/docs/build-protocol-info#unique-identifiers-for-extrinsics

The correct way to uniquely identify an extrinsic on a Substrate-based chain is to use the block ID (height or hash) and the extrinsic's index. Substrate defines a block as a header and an array of extrinsics; therefore, an index in the array at a canonical height will always uniquely identify a transaction. This methodology is reflected in the Substrate codebase itself, for example to reference a previous transaction from the Multisig pallet.

But in this case how to identify the Index of my extrinsic the in finalized block?

1 Answer 1


In Substrate-based chains like Polkadot, a transaction's hash only serves as a fingerprint of the information within a transaction, is not unique, and there are times when two transactions with the same hash are both valid. See an example here: Why could we find the same transaction hash in 3 different blocks?.

With the author_submitAndWatchExtrinsic you get the hash of the block when is finalised and with that you can query the block and comparing it with your extrinsic hash you can construct your extrinsic ID: block ID (height or hash) and the extrinsic's index.

You can see a code snippet of how to do it in Polkadot JS and a bit more detailed explanation about extrinsic IDs here: Best practices for generating and monitoring transactions

  • author_submitAndWatchExtrinsic doesn't return Hash of Tx, so I'm not able to lookup my TX within the finalized blockhash. (in case I have multiple calls to the smartcontratc in the block).
    – FedeC87p
    Commented Aug 27, 2023 at 18:32
  • you are not getting this {"jsonrpc":"2.0","method":"author_extrinsicUpdate","params":{"subscription":"esTxSZq5YkhTEBOD","result":{"finalized":"0xa7ddecc6399afee1dd175b273f70f161513e524b50d292c50823e35506591ecc"}}}?
    – Alex Bean
    Commented Aug 28, 2023 at 6:24
  • this is the blockhash 0xa7ddecc6399afee1dd175b273f70f161513e524b50d292c50823e35506591ecc ( shibuya.subscan.io/block/… ) inside you can see on subscan that contains contracts (call), but I don't find how to retrieve HASH from this call, it seems strange to me
    – FedeC87p
    Commented Aug 28, 2023 at 6:30

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.