> ## 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](/nodeapi/about/billing).

***

## **Parameters**

`hash` - string - <span style={{color: "red"}}>Required</span> - The hash of a transaction

`array` - array - <span style={{color: "red"}}>Required</span> - 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": "0xe1d9b2b918e7bf4c27b108c7d78c839356b7c69f",
                    "callType": "call",
                    "gas": "0x2d7308",
                    "input": "0x322f62ba00000000000000000000000035e4876102389f13d78381d317ff4612412a56c9",
                    "to": "0xf0542ed44d268c85875b3b84b0e7ce0773e9aeef",
                    "value": "0x16345785d8a0000"
                },
                "result": {
                    "gasUsed": "0x3ed3d",
                    "output": "0x"
                },
                "subtraces": 1,
                "traceAddress": []
            },
            {
                "type": "call",
                "action": {
                    "from": "0xf0542ed44d268c85875b3b84b0e7ce0773e9aeef",
                    "callType": "call",
                    "gas": "0x8fc",
                    "input": "0x",
                    "to": "0x35e4876102389f13d78381d317ff4612412a56c9",
                    "value": "0xb1a2bc2ec50000"
                },
                "result": {
                    "gasUsed": "0x0",
                    "output": "0x"
                },
                "subtraces": 0,
                "traceAddress": [
                    0
                ]
            }
        ],
        "vmTrace": null
    }
}
```

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

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


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