trace_replayTransaction
JSON-RPC method replays a specific transaction and returns trace information. This method provides detailed execution traces for a single transaction by replaying its execution, making it essential for transaction debugging, analysis, and forensic investigation.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
- Transaction hash (string, required): Hash of the transaction to replay
- Trace types (array, required): Array of trace types to include in response
Trace types
"trace"
: Basic execution trace information"vmTrace"
: Virtual machine execution trace"stateDiff"
: State differences caused by the transaction
Response
The method returns detailed trace information for the replayed transaction.Response structure
Transaction trace:trace
— Array of trace objects containing execution details- Each trace contains action details, results, and call hierarchy
Usage example
Basic implementation
Example request
Shell
Use cases
Thetrace_replayTransaction
method is essential for applications that need to:
- Transaction debugging: Debug specific transaction execution issues
- Forensic analysis: Investigate suspicious or failed transactions
- Performance analysis: Analyze transaction performance and gas usage
- Development tools: Build transaction debugging and analysis tools
- Security auditing: Audit specific transactions for security issues
- Educational tools: Create educational content about transaction execution
- Research platforms: Support detailed transaction research and analysis
- Compliance investigation: Investigate transactions for regulatory compliance
- MEV analysis: Analyze specific transactions for MEV extraction
- Protocol analysis: Analyze how specific transactions interact with protocols
Body
application/json
JSON-RPC version
Available options:
2.0
The RPC method name
Available options:
trace_replayTransaction
Parameters: [transaction hash, trace types array]
Request identifier