BNB Smart Chain
trace_replayTransaction
For forensic work on a single BSC transaction, trace_replayTransaction is the sharpest tool in the namespace. It re-runs one historical transaction against the block state it executed in and returns whatever you ask for through traceTypes: the trace call tree, the vmTrace opcode stream, the stateDiff, or any mix of the three. Direct it to chain ID 56 at https://bsc.therpc.io/YOUR_API_KEY. The stateDiff is where forensics happens. It tags every touched account with =, +, -, or *{from,to}, so you can read off exactly how each balance, nonce, code blob, and storage slot moved. That replay against original state is what makes it heavy, and what ties it to a trace-enabled archive node that still keeps the history.
Use cases
- Reconstruct the exact storage mutations a historical transaction caused, slot by slot, for a forensic write-up.
- Read the stateDiff to find which storage slot or balance check tripped a revert.
- Build a complete audit trail of balance and storage changes for compliance or reconciliation.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | transactionHash | string | Yes | Hash of the transaction to replay. |
| 2 | traceTypes | array | Yes | One or more of `"trace"`, `"vmTrace"`, `"stateDiff"`. At least one value is required. |
Response
| Type | Description |
|---|---|
| object | `{output, trace?, stateDiff?, vmTrace?}` — `trace` is the call tree, `stateDiff` maps each affected address to balance/nonce/code/storage diffs using `=` (unchanged), `+` (created), `-` (deleted), `*{from,to}` (modified), `vmTrace` is the Parity-format opcode trace. |
Example request
Try it live in the BNB Smart Chain playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32601 | Method not found | trace namespace not enabled or not supported by this client (primarily OpenEthereum/Nethermind/Erigon). |
-32602 | Invalid params | Transaction hash is missing/malformed or traceTypes is empty or contains unknown values. |
-32000 | transaction not found | Transaction does not exist or archive trace data is unavailable for that block. |
Common pitfalls
- Asking for
vmTraceon a complex transaction produces enormous output, so reach fortraceorstateDiffwhen you do not need opcode detail. - A trace-enabled archive node is required, and lower tiers may rate-limit the method or not expose it at all.
- The
vmTraceshape is Parity-specific. Do not confuse it with the structLog format that Geth'sdebug_traceTransactionreturns.
Supported networks
- Mainnet — Chain ID: 56
- Testnet — Chain ID: 97
See also
Parameters
0x-prefixed 32-byte hash
["trace"] | ["trace","vmTrace","stateDiff"]