Ethereum

Ethereum

trace_transaction

Pass a transaction hash to trace_transaction and you get back the OpenEthereum/Nethermind-style call tree for that one mined transaction: every internal CALL, every CREATE, and every SELFDESTRUCT, flattened into an array where traceAddress encodes each entry's path through the tree. Unlike the replay methods, it doesn't re-execute anything against arbitrary state or hand you opcode-level detail; it reports the call structure as recorded for a transaction that already executed on Ethereum mainnet (chain ID 1). That makes it the lightest way to surface internal ETH transfers, the kind that never appear as ERC-20 logs. Send the hash to https://ethereum.therpc.io/YOUR_API_KEY, served by a trace-enabled archive node.

Use cases

  • List every internal ETH transfer a transaction made, including value moves between contracts that emitted no event and would otherwise be invisible to a log-based scan.
  • Follow funds across a multi-contract DeFi interaction, watching ETH hop from a router into a pool and out to the recipient through the nested call entries.
  • Find the sub-call that reverted a multi-hop transaction by walking the traceAddress path down to the failing branch.
  • Index internal transactions for a block explorer, the data that powers the "Internal Txns" tab you see on Etherscan.

Parameters

#NameTypeRequiredDescription
1transactionHashstringYesHash of the transaction to retrieve traces for.

Response

TypeDescription
arrayFlat array of trace objects, each with `{action, result, subtraces, traceAddress, transactionHash, transactionPosition, blockHash, blockNumber, type}`. `traceAddress` encodes the path through the call tree.

Example request

curl https://ethereum.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_transaction",
"params": ["0x0000000000000000000000000000000000000000000000000000000000000000"],
"id": 1
}'

Try it live in the Ethereum playground.

Errors & troubleshooting

CodeMessageCause
-32601Method not foundtrace namespace not enabled; node requires --gcmode=archive and trace API enabled (Geth), or equivalent flag on Nethermind/Erigon.
-32602Invalid paramsTransaction hash is missing or malformed.
-32000transaction not foundTransaction does not exist or archive trace data is unavailable for that block.

Common pitfalls

  • It needs a trace-enabled archive node (Erigon or Nethermind with the trace API, or Geth built with --gcmode=archive and tracing on). A public light node won't answer.
  • Its output is not debug_traceTransaction. There's no opcode-level data here, only call, create, and suicide actions, so don't reach for it when you actually need a struct/opcode log.
  • A failed transaction returns a truncated tree that stops at the revert point. The trace shows how far execution got before unwinding, not the calls that never ran.

Supported networks

  • Mainnet — Chain ID: 1
  • Sepolia — Chain ID: 11155111

See also

Parameters

0x-prefixed 32-byte hash

curl https://ethereum.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"trace_transaction","params":["0x0000000000000000000000000000000000000000000000000000000000000000"]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.