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?