1

Is there something equivalent to w3.eth.getTransaction(txHash), for Substrate based chains using python?

1
  • Could you select an answer if any one of them answers your question? Sep 8, 2022 at 13:43

1 Answer 1

3

Transaction hashes have a different meaning in Polkadot than in Ethereum.
Ethereum TX hashes uniquely identify a transaction in a Block.
TX hashes in Polkadot are not necessarily unique. They are calculated from the function name and its argument values. So they identify a Transaction regardless of whether it's inside a block or not.
Many Polkadot Transactions will therefore share the same hash.

Transactions in Polkadot are identified by their block-number and the index that they have in that block. For example #11831228-2 is transaction 2 in Block 11831228.

Have a look at py-substrate-interface which has an example on how to list the extrinsics of a block.

1
  • There is indeed as far as I know no index available to lookup extrinsic by its hash in the Substrate RPC. You will need a third-party indexer for that
    – Arjan
    Sep 8, 2022 at 18:29

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.