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

> The trace_replayBlockTransactions JSON-RPC method replays all transactions in a block and returns trace information for each transaction.

<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_replayBlockTransactions` JSON-RPC method replays all transactions in a block and returns trace information for each transaction. This method provides detailed execution traces for all transactions in a specific block by replaying their execution, making it essential for comprehensive block analysis.

## Parameters

1. **Block identifier** (string, required): Block number, hash, or "latest"/"earliest"/"pending"
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 transactions

## Response

The method returns an array of trace results for each transaction in the block.

### Response structure

**Block trace results:**

* Array of trace results, one per transaction in the block
* Each result contains detailed execution traces for the transaction

## Usage example

### Basic implementation

```javascript theme={"system"}
// Replay all transactions in a block with tracing
const replayBlockTransactions = async (blockIdentifier, 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_replayBlockTransactions',
      params: [blockIdentifier, traceTypes],
      id: 1
    })
  });
  
  const data = await response.json();
  return data.result;
};

// Example usage
replayBlockTransactions('latest').then(results => {
  console.log(`Replayed ${results.length} transactions`);
  results.forEach((result, index) => {
    console.log(`Transaction ${index + 1}:`);
    if (result.trace) {
      result.trace.forEach(trace => {
        console.log(`  Gas used: ${parseInt(trace.result.gasUsed, 16)}`);
      });
    }
  });
});
```

## Example request

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

  ```python Python (web3.py) theme={"system"}
  from web3 import Web3

  w3 = Web3(Web3.HTTPProvider("YOUR_CHAINSTACK_ENDPOINT"))

  # trace_replayBlockTransactions has no typed wrapper in web3.py — use the generic JSON-RPC call
  response = w3.provider.make_request(
      "trace_replayBlockTransactions",
      ["latest", ["trace"]],
  )
  print(response["result"])
  ```

  ```javascript JavaScript (ethers.js) theme={"system"}
  import { JsonRpcProvider } from "ethers";

  const provider = new JsonRpcProvider("YOUR_CHAINSTACK_ENDPOINT");

  // trace_replayBlockTransactions has no typed wrapper in ethers.js — use the generic send method
  const result = await provider.send("trace_replayBlockTransactions", [
    "latest",
    ["trace"],
  ]);
  console.log(result);
  ```

  ```typescript TypeScript (viem) theme={"system"}
  import { createPublicClient, http } from "viem";

  const client = createPublicClient({
    transport: http("YOUR_CHAINSTACK_ENDPOINT"),
  });

  // trace_replayBlockTransactions has no typed action in viem — use the generic request method
  const result = await client.request({
    method: "trace_replayBlockTransactions",
    params: ["latest", ["trace"]],
  });
  console.log(result);
  ```
</CodeGroup>

<Note>
  **Use your own endpoint in your code.** The code examples use a placeholder Chainstack endpoint (YOUR\_CHAINSTACK\_ENDPOINT) — replace it with your own Hyperliquid node endpoint from the [Chainstack console](https://console.chainstack.com/). The curl above uses a shared public endpoint for quick checks only; do not use it in production.
</Note>

## Use cases

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

* **Block analysis**: Analyze complete blocks with detailed execution traces
* **Performance monitoring**: Monitor transaction execution performance across blocks
* **Analytics platforms**: Build comprehensive blockchain analytics tools
* **Forensic investigation**: Investigate suspicious blocks with complete trace data
* **Compliance monitoring**: Monitor regulatory compliance across entire blocks
* **Development tools**: Build block-level debugging and analysis tools
* **Research platforms**: Support detailed blockchain research and analysis
* **Security auditing**: Audit block execution for security issues
* **MEV analysis**: Analyze Maximum Extractable Value opportunities across blocks
* **Protocol monitoring**: Monitor protocol behavior across multiple transactions

This method provides comprehensive block-level transaction replay capabilities with detailed traces on the Hyperliquid EVM platform.


## OpenAPI

````yaml openapi/hyperliquid_node_api/hyperevm/evm_trace_replay_block_transactions.json post /evm
openapi: 3.0.0
info:
  title: Hyperliquid EVM API - trace_replayBlockTransactions
  version: 1.0.0
servers:
  - url: >-
      https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274
security: []
paths:
  /evm:
    post:
      summary: trace_replayBlockTransactions
      description: >-
        Replays all transactions in a block and returns trace information for
        each transaction. This method provides detailed execution traces for all
        transactions in a specific block.
      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_replayBlockTransactions
                  default: trace_replayBlockTransactions
                  description: The RPC method name
                params:
                  type: array
                  description: 'Parameters: [block identifier, trace types array]'
                  default:
                    - latest
                    - - trace
                id:
                  type: integer
                  default: 1
                  description: Request identifier
            example:
              jsonrpc: '2.0'
              method: trace_replayBlockTransactions
              params:
                - latest
                - - trace
              id: 1
      responses:
        '200':
          description: Successful response with trace data for all transactions
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPC version
                  id:
                    type: integer
                    description: Request identifier
                  result:
                    type: array
                    description: Array of trace results for each transaction in the block
              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

````