3

My layman understanding of internal transactions is that they are an abstraction that comes handy to represent all the value transfers that happened "within" a certain transaction, as a result of possibly many smart contract interactions. This allows to batch several ether and token transactions into one, which is how many exchanges save withdrawal fees.

Now, I'd like to be able to uniquely identify an internal transaction, in somehow a similar way to how outputs of a bitcoin transaction are uniquely identified with the couple txid:vout, where vout is the index of the output in the transaction.

In particular, if I ask etherscan about all the internal transactions in txhash 0xfd69178635ed56f7889937c622bde87564d375a4dc00d48397c0232395ffe85c, I get:

[
  {
    "blockNumber": "15234010",
    "timeStamp": "1659052207",
    "from": "0xa9d1e08c7793af67e9d92fe308d5697fb81d3e43",
    "to": "0xe8cc586bf07ff188ab41c85d27e9f32f706c5b58",
    "value": "18815890000000000",
    "contractAddress": "",
    "input": "",
    "type": "call",
    "gas": "90000",
    "gasUsed": "0",
    "isError": "0",
    "errCode": ""
  },
    ...
]

Is the order of those entries well defined, so that I can use the index within that list as a unique identifier for the transfer together with the txhash?

In other words: if I have two internal transactions within an ethereum transaction that have the same from, to, value and ccontractAddress fields, how can I tell them apart?

This becomes especially useful since I can also query internal transaction by involved address, not just by txhash.

EDIT after Lauri's comment: My question is actually twofold:

  • can internal transactions be uniquely identified in ethereum, for instance via deterministic ordering?
  • Is their order well defined in the etherscan response, so i can use the couple (txid, index) as unique identifier for a transfer?
2
  • 1
    Don't have an answer, but remember that Etherscan is just an arbitrary service offering such data. Other similar services possibly offer it differently. Possibly some service even as an endpoint for internal transactions, but no idea what and where. Mar 13 at 19:39
  • Yes, I am fully aware of that, but etherscan is the only free service I found so far that offers an API to retrieve all internal transactions for a given address. My question is actually twofold: whether there exists a unique identifier and how to retrieve/build it. Will clarify on this.
    – St3p
    Mar 15 at 9:01

1 Answer 1

0

yes Bitquery APIs parse internal txs as well. Under every transaction in the explorer you can check all internal transfers. Here's an example: https://explorer.bitquery.io/ethereum/tx/0x85d623afdcc8c9fd8a4911d217a9372c393b4e42597ae4d3aae32c8428d3d07a/transfers

1
  • This does not answer either of my questions. I'm searching for a unique identifier for internal transactions. Etherscan returns them as well, but I'm not sure whether I can rely on the order to identify them.
    – St3p
    Sep 27 at 10:07

Your Answer

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

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