Skip to main content
POST
/
35848e183f3e3303c8cfeacbea831cab
trace_replayBlockTransactions
curl --request POST \
  --url https://bsc-mainnet.core.chainstack.com/35848e183f3e3303c8cfeacbea831cab \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "trace_replayBlockTransactions",
  "params": [
    "0x23a25c2",
    [
      "trace"
    ]
  ]
}
'
import requests

url = "https://bsc-mainnet.core.chainstack.com/35848e183f3e3303c8cfeacbea831cab"

payload = {
"id": 1,
"jsonrpc": "2.0",
"method": "trace_replayBlockTransactions",
"params": ["0x23a25c2", ["trace"]]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
id: 1,
jsonrpc: '2.0',
method: 'trace_replayBlockTransactions',
params: ['0x23a25c2', ['trace']]
})
};

fetch('https://bsc-mainnet.core.chainstack.com/35848e183f3e3303c8cfeacbea831cab', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://bsc-mainnet.core.chainstack.com/35848e183f3e3303c8cfeacbea831cab",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => 1,
'jsonrpc' => '2.0',
'method' => 'trace_replayBlockTransactions',
'params' => [
'0x23a25c2',
[
'trace'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://bsc-mainnet.core.chainstack.com/35848e183f3e3303c8cfeacbea831cab"

payload := strings.NewReader("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"trace_replayBlockTransactions\",\n \"params\": [\n \"0x23a25c2\",\n [\n \"trace\"\n ]\n ]\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://bsc-mainnet.core.chainstack.com/35848e183f3e3303c8cfeacbea831cab")
.header("Content-Type", "application/json")
.body("{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"trace_replayBlockTransactions\",\n \"params\": [\n \"0x23a25c2\",\n [\n \"trace\"\n ]\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://bsc-mainnet.core.chainstack.com/35848e183f3e3303c8cfeacbea831cab")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": 1,\n \"jsonrpc\": \"2.0\",\n \"method\": \"trace_replayBlockTransactions\",\n \"params\": [\n \"0x23a25c2\",\n [\n \"trace\"\n ]\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": {}
}
BNB API method trace_replayBlockTransactions replays transactions in a specified block individually, returning the trace data for each transaction. This method is invaluable for developers, auditors, and analysts who wish to inspect the execution path of transactions within a block, including calls to other contracts, state changes, and execution outcomes, without affecting the live blockchain.

Parameters

  • blockHash or blockNumber — The hash or number of the block whose transactions you want to replay, specified as:
    • Hexadecimal — for the block hash.
    • Hexadecimal or decimal number — for the block number.
  • traceTypes — An array of strings specifying the types of traces to return for each transaction, with options including:
    • vmTrace — virtual machine trace.
    • trace — standard trace.
    • stateDiff — state difference.

Response

  • result — An array containing the trace data for each transaction in the specified block. Each item in the array represents the trace of a single transaction, detailing calls to contracts, value transfers, and other relevant state changes that occurred during its execution.

Use case

The trace_replayBlockTransactions method is particularly useful for conducting detailed analyses of block transactions. Developers can use it to debug contract interactions within a specific block, auditors can use it to verify the correctness and security of transactions, and analysts might use it to study transaction patterns or detect anomalies. This method provides a granular view of transaction execution, which is essential for understanding complex interactions on the blockchain.

Body

application/json
id
integer
default:1
jsonrpc
string
default:2.0
method
string
default:trace_replayBlockTransactions
params
(string | string[])[]

Response

200 - application/json

Result of replaying block transactions with trace.

jsonrpc
string
id
integer
result
object
Last modified on May 18, 2026