1

Given the results from a JSON-RPC call (calling a Parity Archive Node), is there any way to tell if a transaction is an Internal Transaction other than looking at the Gas Used in the Transaction Receipt and assuming that all Internal Transactions will not have a Gas Used of 21,000?

Here's an example Transaction that is an Internal Transaction:

curl --data '{"method":"eth_getTransactionByHash","params":["0xc10dc94647a1b79ba475a388b4a5f264e6a2d56f6586579cf635672162be545b"],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

And the output:

{"jsonrpc":"2.0","result":
{"blockHash":"0xcc66cae4d1d4b42fe055b62f0abdae1920310409d09552570955392adcfca01c",
"blockNumber":"0x1e84fc","condition":null,"creates":null,
"from":"0xa49ba69549a3313a9bb03f6fadaf7bc9e09777b5",
"gas":"0x15f90",
"gasPrice":"0x4a817c800",
"hash":"0xc10dc94647a1b79ba475a388b4a5f264e6a2d56f6586579cf635672162be545b",
"input":"0x0f2c9329000000000000000000000000023f0263868a48436dca3c951656a6c6f0191dc5000000000000000000000000a49ba69549a3313a9bb03f6fadaf7bc9e09777b5",
"networkId":null,
"nonce":"0x1",
"publicKey":"0x72a2913a7c9b3aeb5af0c59db52da5db4e5b68b7abc3cf469625147825009e181418da4106aa8add9459886a4926be64b3e15d8a35a8a4907da6957b71e65619",
"r":"0x8a581d305ffe09d9dd807782a3449f6e97d994630cd0f034f31c932d29e6df13",
"raw":"0xf8b4018504a817c80083015f9094aa1a6e3e6ef20068f7f8d8c835d2d22fd51164448a016905a6fad2940fc388b8440f2c9329000000000000000000000000023f0263868a48436dca3c951656a6c6f0191dc5000000000000000000000000a49ba69549a3313a9bb03f6fadaf7bc9e09777b51ba08a581d305ffe09d9dd807782a3449f6e97d994630cd0f034f31c932d29e6df13a061800116d1fcb7bb6a94b102f79547e3a012ff0a46084a3a53245e987c863765",
"s":"0x61800116d1fcb7bb6a94b102f79547e3a012ff0a46084a3a53245e987c863765",
"standardV":"0x0",
"to":"0xaa1a6e3e6ef20068f7f8d8c835d2d22fd5116444",
"transactionIndex":"0x1a",
"v":"0x1b",
"value":"0x16905a6fad2940fc388"}
,"id":1}
1

An "internal transaction" isn't really a transaction. It would be better referred to as a call. Referring to it as a transaction is a terminological fudge that arose when people tried to make Ethereum block explorers using a paradigm inherited from bitcoin.

An "internal transaction" does not have a transaction hash, a signature, a nonce etc, except to the extent that those are inherited from the actual transaction that it is part of.

The transaction in your example is not an "internal transaction". If it was, it wouldn't have a transaction hash.

  • Thanks for this explanation, I haven't read anything this concise in all the documentation. To modify my question slightly, this transaction here is shown as having an "Internal Transaction", or message call. It must be the transaction that the real message call will inherit a transaction hash/nonce/signature from. Is there any forensic evidence that this transaction is different from an external transaction other than the gas used? – edwin.greene Jan 8 '18 at 13:43
  • What you're linking to is an external transaction, not a call (aka "internal transaction"). It makes a call, which you can see by clicking on the "Internal transactions" tab. – Edmund Edgar Jan 10 '18 at 0:04
1

From my continued investigation, it seems that the best way to determine if a message is called (also referred to as a contract transaction/internal transaction) is to determine if there is code within the Addresses of the involved parties. Using a Parity Archive node, this involves using get_EthCode and seeing if there is anything present (other than a default value of 0x) in the returned String.

Get_EthCode is documented here: https://paritytech.github.io/wiki/JSONRPC-eth-module#eth_getcode

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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