BNB Smart Chain

BNB Smart Chain

trace_replayBlockTransactions

Where trace_block gives you only the call tree, trace_replayBlockTransactions re-executes every transaction in a BSC block from scratch and lets you keep up to three artifacts per transaction: the call-tree trace, the opcode-level vmTrace, and the stateDiff. You choose which through traceTypes. Point it at chain ID 56 via https://bsc.therpc.io/YOUR_API_KEY. The state diff is what earns the cost. For each transaction it records the precise balance, nonce, code, and storage mutations the execution caused. Replaying a whole block this way is the most demanding call in the trace namespace, and it only works against a trace-enabled archive node holding that block's state.

Use cases

  • Generate a full state-diff audit for every transaction in a block and feed it into a chain analytics pipeline.
  • Rebuild all BNB and token balance changes inside a block for accounting or reconciliation.
  • Replay a known MEV block end to end to see exactly how the bundle played out.

Parameters

#NameTypeRequiredDescription
1blockParameterstringYesBlock whose transactions to replay.
2traceTypesarrayYesOne or more of `"trace"`, `"vmTrace"`, `"stateDiff"`. At least one value is required.

Response

TypeDescription
arrayArray of per-transaction replay results in block order. Each element has the same shape as trace_replayTransaction output, plus `transactionHash`.

Example request

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "trace_replayBlockTransactions",
"params": [
"latest",
[
"trace"
]
],
"id": 1
}'

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

CodeMessageCause
-32601Method not foundtrace namespace not enabled or not supported by this client.
-32602Invalid paramsblockParameter is malformed or traceTypes is empty or contains unknown values.
-32000block not foundBlock does not exist or archive trace data is unavailable for that block.

Common pitfalls

  • It is the costliest call in the trace namespace. Replaying every transaction and computing each requested trace type can time out on a busy block.
  • A trace-enabled archive node is required, and lower service tiers often rate-limit or refuse the call outright.
  • All three traceTypes on a dense block can return hundreds of megabytes, so ask for the narrowest set of artifacts that answers your question.

Supported networks

  • Mainnet — Chain ID: 56
  • Testnet — Chain ID: 97

See also

Parameters

hex block number or "latest" | "earliest" | "pending"

["trace"] | ["trace","vmTrace","stateDiff"]

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"trace_replayBlockTransactions","params":["",[]]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.