POST
/
evm
trace_replayTransaction
curl --request POST \
  --url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "trace_replayTransaction",
  "params": [
    "0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31",
    [
      "trace"
    ]
  ],
  "id": 1
}'
{
  "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"
      }
    ]
  }
}
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.
Get your own node endpoint todayStart 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.

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

// 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
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.

Body

application/json

Response

200 - application/json

Successful response with trace data

The response is of type object.