> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# trace_transaction | Base

> Base API method trace_transaction provides a detailed trace of a single transaction's execution. Available on Base via Chainstack.

Base API method `trace_transaction` provides a detailed trace of a single transaction's execution. This method is essential for developers, auditors, and blockchain analysts who need to examine the execution steps of a transaction, including contract calls, state changes, and event emissions. It offers insights into the transaction's behavior on the Ethereum Virtual Machine (EVM) and its impact on the blockchain state.

## Parameters

* `transactionHash` — The hash of the transaction you wish to trace, specified as a hexadecimal string.

## Response

* `result` — An array containing the trace data for the specified transaction. Each element in the array represents a step in the transaction's execution, detailing operations such as calls to other contracts, value transfers, and the execution outcomes.

## Use case

The `trace_transaction` method is invaluable for conducting in-depth analyses of transactions. Developers can use it to debug and optimize smart contract interactions, auditors can employ it to ensure transaction security and integrity, and analysts might use it to investigate transaction patterns or detect anomalies. This method provides a detailed view of how a transaction interacts with the blockchain, which is crucial for understanding its effects and ensuring its correctness.


## OpenAPI

````yaml /openapi/base_node_api/trace_transaction.json POST /2fc1de7f08c0465f6a28e3c355e0cb14
openapi: 3.0.0
info:
  title: trace_transaction example
  version: 1.0.0
  description: >-
    This API example demonstrates how to use the trace_transaction method to
    retrieve a detailed execution  trace of a transaction, identified by the
    transaction's hash.
servers:
  - url: https://base-mainnet.core.chainstack.com
security: []
paths:
  /2fc1de7f08c0465f6a28e3c355e0cb14:
    post:
      tags:
        - Debug Operations
      summary: trace_transaction
      operationId: traceTransaction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - id
                - params
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: trace_transaction
                id:
                  type: integer
                  default: 1
                params:
                  type: array
                  items:
                    type: string
                  default:
                    - >-
                      0x317888c89fe0914c6d11be51acf758742afbe0cf1fdac11f19d35d6ed652ac29
      responses:
        '200':
          description: Detailed execution trace of the specified transaction
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object
                    properties:
                      structLogs:
                        type: array
                        items:
                          type: object
                        description: >-
                          An array of execution steps (opcodes) taken by the
                          transaction.
                      gas:
                        type: integer
                        description: The gas provided by the transaction.
                      returnValue:
                        type: string
                        description: The return value of the transaction, if any.
                      gasUsed:
                        type: integer
                        description: The total gas used by the transaction.
                      failed:
                        type: boolean
                        description: Indicates whether the transaction failed.
                    description: The detailed execution trace of the transaction.

````