Understanding trace_transaction on EVM Blockchains

If you’ve ever tried to understand why a transaction behaved differently than expected, or you needed to dig deeper than what logs and receipts tell you, then you’ve probably bumped into one important truth: on EVM blockchains, the “real action” often happens behind the scenes. Internal calls, delegated logic, token transfers, and hidden execution paths—none of these appear in a normal transaction receipt. That’s where EVM Traces come in, and one of the most powerful tools for extracting them is the JSON-RPC method trace_transaction.

This article breaks down how trace data works, why you need an Ethereum archive node or Erigon archive node to use it, and how NOWNodes makes the whole process much simpler by offering ready-to-use tracing endpoints.


What is trace_transaction?

A typical transaction on Ethereum might look simple from the outside: one address calls a contract, gas is consumed, and a result is returned. But inside that single action can be:

  • Multiple internal function calls
  • delegatecall operations switching execution context
  • Token transfers triggered deep inside the logic
  • Fallback and metadata calls
  • Balance checks, approvals, read-only staticcalls

Developers need visibility into all of this—especially when:

  • A smart contract behaves unpredictably
  • A transaction results in unexpected side effects
  • You’re writing complex DeFi logic
  • You’re auditing execution or replaying historical behavior

trace_transaction reveals the entire execution path, step by step.

Why Tracing Needs an Archive Node

To reconstruct the internal behavior of a transaction—especially one that happened months or years ago—the node must recreate the exact blockchain state at that block.

That’s only possible with an archive-level client. This includes in Erigon/Ethereum archive node.

It stores all historical states, not just recent ones. Running them yourself requires terabytes of storage and constant maintenance—which is exactly why most developers prefer infrastructure providers.

How to Use trace_transaction

NOWNodes makes tracing extremely straightforward. Once you have your API key, you can send a call like this:

curl -L \
  --request POST \
  --url 'https://eth-archive.nownodes.io/' \
  --header 'Content-Type: application/json' \
  --data '{
    "jsonrpc": "2.0",
    "method": "trace_transaction",
    "params": [
      "0x3a02f0e98ae5f67cbb64fc22ae778a4262068ec1d60d4d458adca01e8306f81a"
    ],
    "id": 1
  }'

The response provides a detailed list of every internal action triggered during execution—who called whom, how much gas was used, what data was passed, and how each subcall ended.

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "action": {
        "from": "0xacd472dde54aaed9f82cc8d4ea597100729ba82e",
        "callType": "call",
        "gas": "0x40cc8",
        "input": "0x651e723c000000000000000000000000df9c4aecf82c00aa706d16d6f7c9956d045686a500000000000000000000000000000000000000000000000000000000568e1338",
        "to": "0x7de5aba7de728950c92c57d08e20d4077161f12f",
        "value": "0x1"
      },
      "blockHash": "0xe05c06583c7764449a6faa62ecb9860a788d887ec2aa0c7b4cdfba61889904e7",
      "blockNumber": 810399,
      "result": {
        "gasUsed": "0x250b6",
        "output": "0x0000000000000000000000000000000000000000000000000000000000000001"
      },
      "subtraces": 2,
      "traceAddress": [],
      "transactionHash": "0x3a02f0e98ae5f67cbb64fc22ae778a4262068ec1d60d4d458adca01e8306f81a",
      "transactionPosition": 0,
      "type": "call"
    },
    {
      "action": {
        "from": "0x7de5aba7de728950c92c57d08e20d4077161f12f",
        "callType": "delegatecall",
        "gas": "0x1a4b8",
        "input": "0x70a08231000000000000000000000000acd472dde54aaed9f82cc8d4ea597100729ba82e",
        "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
        "value": "0x0"
      },
      "blockHash": "0xe05c06583c7764449a6faa62ecb9860a788d887ec2aa0c7b4cdfba61889904e7",
      "blockNumber": 810399,
      "result": {
        "gasUsed": "0xb4a",
        "output": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000"
      },
      "subtraces": 0,
      "traceAddress": [
        0
      ],
      "transactionHash": "0x3a02f0e98ae5f67cbb64fc22ae778a4262068ec1d60d4d458adca01e8306f81a",
      "transactionPosition": 0,
      "type": "delegatecall"
    },
    {
      "action": {
        "from": "0x7de5aba7de728950c92c57d08e20d4077161f12f",
        "callType": "staticcall",
        "gas": "0x13880",
        "input": "0x18160ddd",
        "to": "0x6b175474e89094c44da98b954eedeac495271d0f",
        "value": "0x0"
      },
      "blockHash": "0xe05c06583c7764449a6faa62ecb9860a788d887ec2aa0c7b4cdfba61889904e7",
      "blockNumber": 810399,
      "result": {
        "gasUsed": "0x5dc",
        "output": "0x000000000000000000000000000000000000000000000001158e460913d00000"
      },
      "subtraces": 0,
      "traceAddress": [
        1
      ],
      "transactionHash": "0x3a02f0e98ae5f67cbb64fc22ae778a4262068ec1d60d4d458adca01e8306f81a",
      "transactionPosition": 0,
      "type": "staticcall"
    }
  ]
}

If you’ve ever needed to understand “why did this contract behave this way?” you’ll instantly see the value.

When Traces Solve Problems That Logs Can’t

Even well-designed smart contracts can hide their most important interactions inside internal calls. Tracing helps reveal:

  • Unexpected delegatecall chains
  • Hidden token transfers
  • Unusual gas spikes
  • Execution branches triggered by specific inputs

Many developers use traces during audits, when investigating on-chain exploits, or when rewriting older dApps. Others rely on them to understand DeFi protocols’ internal logic—something logs alone can’t always explain.

And if you’re building analytics tools or monitoring complex contract flows, trace data becomes absolutely essential.

Final Thoughts

trace_transaction gives developers something that’s often missing when working with EVM blockchains: complete transparency. Instead of guessing what a smart contract does internally, you can see every call, every interaction, and every piece of data exchanged during execution.

Paired with NOWNodes’ archive infrastructure—whether you choose an Ethereum archive node or Erigon archive node—you get reliable, production-grade access to everything happening inside the EVM.