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

# trace_replayTransaction

Replays a transaction, returning the traces.

This method will use `270` [Compute Units](https://docs.validationcloud.io/nodeapi/about/billing.md).

***

> [!NOTE]
>
> Traces need the state of the traced block, so World Chain Mainnet can trace the last 10,064 blocks, about 5.6 hours at World Chain's 2-second block time. Older blocks return JSON-RPC error `-32603` with a message that contains `insufficient changesets to revert to block`.

## **Parameters**

`hash` - string - Required - The hash of a transaction

`array` - array - Required - The type of trace, which can be one of the following:

* `vmTrace` string - To get a full trace of the virtual machine's state during the execution of the given transaction, including for any subcalls
* `trace` - string - To get the basic trace of the given transaction
* `stateDiff` - string - To get information on altered Ethereum state due to execution of the given transaction

## **Returns**

`object` - object - The block trace object with the following fields:

* `output` - string - The data returned as output encoded in hexadecimal format
* `stateDiff` - object - The altered state due to execution of the given transaction, or null if not available
* `trace` - array - An array of basic trace objects for the given transaction containing:
  * `action` - object The ParityTrace action object containing call details
    * `from` - string - The address of the sender
    * `callType` - string - The type of method such as call, staticcall, delegatecall
    * `gas` - string - The gas provided by the sender, encoded as hexadecimal
    * `input` - string - The input data sent along with the transaction
    * `to` - string - The address of the receiver
    * `value` - string - The integer of the value sent with this transaction, encoded as hexadecimal
  * `result` - object - The execution result of the trace
    * `gasUsed` - string - The amount of gas used by this trace
    * `output` - string - The return value of the contract call, empty if no RETURN executed
  * `subtraces` - integer - The number of subtraces (internal calls) within this trace
  * `traceAddress` - array - The list of addresses where the call executed, including parent calls and order
  * `type` - string The type of the trace, such as call or create
* `vmTrace` - object - The full trace of the virtual machine's state during execution, including sub-calls, or null if not available

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
// Result
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "output": "0x",
    "stateDiff": null,
    "trace": [
      {
        "type": "call",
        "action": {
          "from": "0x009dcf67cc6d08394d72ddff30c14b7012896c29",
          "callType": "call",
          "gas": "0x8f47b",
          "input": "0x765e827f0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000009dcf67cc6d08394d72ddff30c14b70...",
          "to": "0x0000000071727de22e5e9d8baf0edac6f37da032",
          "value": "0x0"
        },
        "result": {
          "gasUsed": "0x5f002",
          "output": "0x"
        },
        "subtraces": 3,
        "traceAddress": []
      },
      {
        "type": "call",
        "action": {
          "from": "0x0000000071727de22e5e9d8baf0edac6f37da032",
          "callType": "call",
          "gas": "0x148e8",
          "input": "0x19822f7c0000000000000000000000000000000000000000000000000000000000000060d6e226fa264ba5a15cb5e225de120b01776eb9359bda510a214c238d...",
          "to": "0xa380ef7797fb48ddc63a085b815a74981e6a3dbf",
          "value": "0x0"
        },
        "result": {
          "gasUsed": "0x65ea",
          "output": "0x00006b12967b00006b129fdb0000000000000000000000000000000000000000"
        },
        "subtraces": 1,
        "traceAddress": [
          0
        ]
      },
      {
        "type": "call",
        "action": {
          "from": "0xa380ef7797fb48ddc63a085b815a74981e6a3dbf",
          "callType": "delegatecall",
          "gas": "0x13063",
          "input": "0x19822f7c0000000000000000000000000000000000000000000000000000000000000060d6e226fa264ba5a15cb5e225de120b01776eb9359bda510a214c238d...",
          "to": "0x29fcb43b46531bca003ddc8fcb67ffe91900c762",
          "value": "0x0"
        },
        "result": {
          "gasUsed": "0x520c",
          "output": "0x00006b12967b00006b129fdb0000000000000000000000000000000000000000"
        },
        "subtraces": 1,
        "traceAddress": [
          0,
          0
        ]
      }
    ],
    "vmTrace": null
  }
}
```

```bash title="mainnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl https://mainnet.worldchain.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"trace_replayTransaction","params":["0x976ede826ce145939ff1d6ba66d01aa5c8e9aea7fba57db427949a4516f870ce",["trace"]],"id":1}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.