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
traceAddresspath 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
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | transactionHash | string | Yes | Hash of the transaction to retrieve traces for. |
Response
| Type | Description |
|---|---|
| array | Flat 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
Try it live in the Ethereum playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32601 | Method not found | trace namespace not enabled; node requires --gcmode=archive and trace API enabled (Geth), or equivalent flag on Nethermind/Erigon. |
-32602 | Invalid params | Transaction hash is missing or malformed. |
-32000 | transaction not found | Transaction 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=archiveand tracing on). A public light node won't answer. - Its output is not
debug_traceTransaction. There's no opcode-level data here, onlycall,create, andsuicideactions, 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