BNB Smart Chain

BNB Smart Chain

trace_transaction

Give trace_transaction one BSC transaction hash and it returns the OpenEthereum/Nethermind-style call tree for that single historical transaction: every internal call, contract creation, and self-destruct it set off. The chain runs on BNB gas and carries most of the BEP-20 economy, so a single swap or router call can fan out into dozens of nested sub-calls. The traceAddress on each entry encodes its position in that tree, which lets you rebuild the nesting exactly. Send the request to chain ID 56 at https://bsc.therpc.io/YOUR_API_KEY. It reads far more easily than the opcode-level debug tracers when you are following money rather than instructions, but it still leans on a trace-enabled archive node to reach historical state.

Use cases

  • List every internal BNB transfer inside a transaction, including the ones that never surfaced as events.
  • Follow fund flow across several contracts in a layered DeFi interaction like a multi-hop swap.
  • Walk the call tree to pin down which sub-call triggered a revert inside a multi-hop transaction.
  • Index internal transactions to power a block explorer's internal-transfer view.

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://bsc.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 BNB Smart Chain 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 (Geth with --gcmode=archive plus trace, or Erigon/Nethermind running their trace API), so most public light nodes and lower tiers will not serve it.
  • Its output is not debug_traceTransaction output. There is no opcode-level detail here, only call, create, and self-destruct actions.
  • A failed transaction comes back truncated at the revert point instead of as a full execution path.

Supported networks

  • Mainnet — Chain ID: 56
  • Testnet — Chain ID: 97

See also

Parameters

0x-prefixed 32-byte hash

curl https://bsc.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.