POST
/
efb0a5eccd2caa5135eb54eba6f7f300
curl --request POST \
  --url https://optimism-mainnet.core.chainstack.com/efb0a5eccd2caa5135eb54eba6f7f300 \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "debug_traceTransaction",
  "id": 1,
  "params": [
    "0x2f6ff16a96580e1d51b91314c1bdf9339f2f7ce0e7a22228bbc65f419dd7be51"
  ]
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": {
    "structLogs": [
      {}
    ],
    "gas": 123,
    "returnValue": "<string>",
    "gasUsed": 123,
    "failed": true
  }
}

The debug_traceTransaction RPC method retrieves a detailed execution trace of a transaction, identified by the transaction’s hash. This method is crucial for developers and analysts who need to understand the execution flow of a transaction, including all the operations (opcodes) executed, gas usage, and the transaction’s outcome.

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Request

To use debug_traceTransaction, send a POST request with a JSON RPC call in the body.

Parameters

  • Transaction Hash (string): The hash of the transaction to trace.

Response

The response includes a detailed execution trace of the transaction, providing insights into each step of the transaction’s execution.

  • result (object): The detailed execution trace, including:
    • structLogs (array): An array of execution steps (opcodes) taken by the transaction.
    • gas (integer): The gas provided by the transaction.
    • returnValue (string): The return value of the transaction, if any.
    • gasUsed (integer): The total gas used by the transaction.
    • failed (boolean): Indicates whether the transaction failed.

Use case

The debug_traceTransaction method is essential for:

  • Developers debugging smart contract interactions.
  • Analysts conducting forensic analysis of transactions.
  • Tools and services that provide insights into Ethereum Virtual Machine (EVM) execution.

Body

application/json
jsonrpc
string
default:2.0
required
method
string
default:debug_traceTransaction
required
id
integer
default:1
required
params
string[]
required

Response

200 - application/json
Detailed execution trace of the specified transaction
jsonrpc
string
id
integer
result
object

The detailed execution trace of the transaction.