debug_traceBlockByHash
Last updated:
`debug_traceBlockByHash` re-executes all transactions contained in the block with the given hash and returns an EVM trace for each transaction, in block order. It is the hash-addressed counterpart to [`debug_traceBlockByNumber`](./debug_traceBlockByNumber.md) and produces the same per-transaction trace shape as [`debug_traceTransaction`](./debug_traceTransaction.md).
Use it when you need to reconstruct exactly what happened inside a block — internal calls, value transfers, reverts, and state changes — without tracing each transaction individually. Common uses are indexing internal transactions, reconciling token transfers, and post-mortem analysis of a failed or exploited block.
Tracing replays the full block against an archived state, so it is significantly more expensive than a normal read. It is gated to the **pro** and **business** tiers and rate limited more tightly than `eth_*` reads. Choose a tracer with the `tracer` option to control the output: omit it for the raw opcode-level struct log, or pass a built-in tracer such as `callTracer` (call tree) or `prestateTracer` (touched state) for a compact, structured result.
Parameters
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| result | object |
Examples
curl https://<your-endpoint>/ \
-X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"debug_traceBlockByHash","params":[]}'const res = await fetch("https://<your-endpoint>/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"id": 1,
"method": "debug_traceBlockByHash",
"params": [],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"debug_traceBlockByHash","params":[],"jsonrpc":"2.0"})
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet.
- Credit cost: 5 per call.
FAQ
- What does debug_traceBlockByHash do?
- Replays every transaction in a block (identified by its hash) through the EVM and returns a trace for each one.
- How many credits does debug_traceBlockByHash cost?
- debug_traceBlockByHash costs 5 credit(s) per call on Triport by default.
- Is debug_traceBlockByHash available over WebSocket?
- debug_traceBlockByHash is an HTTP JSON-RPC method.