> ## 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_replayTransaction | Hyperliquid EVM

> Replays a specific transaction and returns trace information. This method provides detailed execution traces for a single transaction by replaying its execution.

<Info>
  This method is available on Chainstack. Not all Hyperliquid methods are available on Chainstack, as the open-source node implementation does not support them yet — see [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown.
</Info>

The `trace_replayTransaction` JSON-RPC method replays a specific transaction and returns trace information. This method provides detailed execution traces for a single transaction by replaying its execution, making it essential for transaction debugging, analysis, and forensic investigation.

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

1. **Transaction hash** (string, required): Hash of the transaction to replay
2. **Trace types** (array, required): Array of trace types to include in response

### Trace types

* `"trace"`: Basic execution trace information
* `"vmTrace"`: Virtual machine execution trace
* `"stateDiff"`: State differences caused by the transaction

## Response

The method returns detailed trace information for the replayed transaction.

### Response structure

**Transaction trace:**

* `trace` — Array of trace objects containing execution details
* Each trace contains action details, results, and call hierarchy

## Usage example

### Basic implementation

```javascript theme={"system"}
// Replay a specific transaction with tracing
const replayTransaction = async (txHash, traceTypes = ['trace']) => {
  const response = await fetch('https://hyperliquid-mainnet.core.chainstack.com/YOUR_ENDPOINT/evm', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      jsonrpc: '2.0',
      method: 'trace_replayTransaction',
      params: [txHash, traceTypes],
      id: 1
    })
  });
  
  const data = await response.json();
  return data.result;
};

// Example usage
const txHash = '0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31';
replayTransaction(txHash).then(result => {
  console.log('Transaction replay result:');
  if (result.trace) {
    result.trace.forEach((trace, index) => {
      console.log(`Trace ${index + 1}:`);
      console.log(`  Type: ${trace.type}`);
      console.log(`  Gas used: ${parseInt(trace.result.gasUsed, 16)}`);
    });
  }
});
```

## Example request

```shell Shell theme={"system"}
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "trace_replayTransaction",
    "params": [
      "0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31",
      ["trace"]
    ],
    "id": 1
  }' \
  https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm
```

## Use cases

The `trace_replayTransaction` method is essential for applications that need to:

* **Transaction debugging**: Debug specific transaction execution issues
* **Forensic analysis**: Investigate suspicious or failed transactions
* **Performance analysis**: Analyze transaction performance and gas usage
* **Development tools**: Build transaction debugging and analysis tools
* **Security auditing**: Audit specific transactions for security issues
* **Educational tools**: Create educational content about transaction execution
* **Research platforms**: Support detailed transaction research and analysis
* **Compliance investigation**: Investigate transactions for regulatory compliance
* **MEV analysis**: Analyze specific transactions for MEV extraction
* **Protocol analysis**: Analyze how specific transactions interact with protocols

This method provides detailed transaction replay capabilities for comprehensive analysis on the Hyperliquid EVM platform.


## OpenAPI

````yaml /openapi/hyperliquid_node_api/evm_trace_replay_transaction.json post /evm
openapi: 3.0.0
info:
  title: Hyperliquid EVM API - trace_replayTransaction
  version: 1.0.0
servers:
  - url: >-
      https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274
security: []
paths:
  /evm:
    post:
      summary: trace_replayTransaction
      description: >-
        Replays a specific transaction and returns trace information. This
        method provides detailed execution traces for a single transaction by
        replaying its execution.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - params
                - id
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  default: '2.0'
                  description: JSON-RPC version
                method:
                  type: string
                  enum:
                    - trace_replayTransaction
                  default: trace_replayTransaction
                  description: The RPC method name
                params:
                  type: array
                  description: 'Parameters: [transaction hash, trace types array]'
                  default:
                    - >-
                      0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31
                    - - trace
                id:
                  type: integer
                  default: 1
                  description: Request identifier
            example:
              jsonrpc: '2.0'
              method: trace_replayTransaction
              params:
                - >-
                  0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31
                - - trace
              id: 1
      responses:
        '200':
          description: Successful response with trace data
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPC version
                  id:
                    type: integer
                    description: Request identifier
                  result:
                    type: object
                    description: Trace data for the replayed transaction
              example:
                jsonrpc: '2.0'
                id: 1
                result:
                  trace:
                    - action:
                        from: 0x...
                        to: 0x...
                        value: '0x0'
                        gas: 0x...
                        input: 0x...
                        callType: call
                      result:
                        gasUsed: '0x5208'
                        output: 0x
                      traceAddress: []
                      type: call

````