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

# debug_traceBlockByHash | Monad

> Monad API method that returns traces for all transactions in a block specified by block hash. debug_traceBlockByHash on Monad via Chainstack.

Monad API method that returns traces for all transactions in a block specified by block hash. This method is useful for analyzing all transaction executions within a specific block when you have its hash.

> [!WARNING]
>
> **Monad-specific behavior**:
>
> * The trace options object parameter **must be explicitly provided**. Unlike standard EVM clients where this parameter is optional, Monad RPC will return an error (`-32602 Invalid params`) if the parameter is omitted. Always include the trace options, even if empty (`{}`).
> * When an empty trace options object `{}` is provided, Monad defaults to `callTracer` instead of struct logs, because Monad does not currently support opcode-level struct logs at the VM level.

## Parameters

* `data` — the 32-byte hash of the block.
* `object` (optional) — the tracer options:
  * `tracer` — the tracer to use (e.g., `callTracer`, `prestateTracer`)
  * `tracerConfig` — configuration options for the tracer
  * `timeout` — timeout for the trace operation

## Response

* `result` — an array of trace results, one for each transaction in the block. The structure of each trace depends on the tracer used.

## `debug_traceBlockByHash` code examples

```javascript ethers.js theme={"system"}
const { ethers } = require("ethers");

const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");

async function traceBlock() {
  const blockHash = "0xca92186826cafb24b161537b96b287e8e1d57427343459c06d9e23eada1436f6";
  const traces = await provider.send("debug_traceBlockByHash", [
    blockHash,
    { tracer: "callTracer" }
  ]);
  console.log(`Traced ${traces.length} transactions`);
  traces.forEach((trace, i) => {
    console.log(`Transaction ${i}:`, trace.result?.type || 'unknown');
  });
}

traceBlock();
```

```python web3.py theme={"system"}
from web3 import Web3

node_url = "CHAINSTACK_NODE_URL"

web3 = Web3(Web3.HTTPProvider(node_url))

block_hash = "0xca92186826cafb24b161537b96b287e8e1d57427343459c06d9e23eada1436f6"
traces = web3.provider.make_request('debug_traceBlockByHash', [block_hash, {'tracer': 'callTracer'}])
print(f'Traced {len(traces["result"])} transactions')
for i, trace in enumerate(traces['result']):
    print(f'Transaction {i}: {trace.get("result", {}).get("type", "unknown")}')
```

## Use case

A practical use case for `debug_traceBlockByHash` is investigating specific blocks identified through external sources (like block explorers or incident reports) to understand the exact execution flow of all transactions they contain.


## OpenAPI

````yaml openapi/monad_node_api/debug_and_trace/debug_traceBlockByHash.json POST /
openapi: 3.0.0
info:
  title: Monad Node API
  version: 1.0.0
  description: This is an API for interacting with a Monad node.
servers:
  - url: https://monad-mainnet.core.chainstack.com/mt_c524ad9781ae5dccd9ac6f5b0370e
security: []
paths:
  /:
    post:
      tags:
        - Debug and Trace
      summary: debug_traceBlockByHash
      operationId: debug_traceBlockByHash
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: debug_traceBlockByHash
                params:
                  type: array
                  default:
                    - >-
                      0xca92186826cafb24b161537b96b287e8e1d57427343459c06d9e23eada1436f6
                    - tracer: callTracer
      responses:
        '200':
          description: Array of trace results for each transaction.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: array
                    items:
                      type: object

````