debug_traceTransaction - Base RPC Method
Trace a transaction execution on Base. Requires archive node for debugging consumer dApps, SocialFi, NFT marketplaces, and merchant payment integrations.
Base RPC endpoint: endpoint URLs, plans and pricing.
Traces a transaction execution on Base by transaction hash.
Archive Node Required
This method requires an archive node. It is not available on full nodes.
When to Use This Method
- Analyze transaction execution step-by-step - Trace every opcode and internal call in a completed transaction for consumer dApps, SocialFi, NFT marketplaces, and merchant payment integrations
- Debug failed transactions - Pinpoint the exact opcode and call depth where a transaction reverted on Base
- Examine internal call traces - Follow the full call tree including delegate calls and contract creations
- Gas usage profiling - Measure gas consumption per opcode to identify optimization opportunities
Best Practices
- Requires archive node access; not available on standard full nodes
- Traces can be very large for complex transactions with many internal calls
- Use tracer options like
onlyTopCallorcallTracerto limit output size - Store traces off-chain for analysis rather than querying repeatedly
{
"jsonrpc": "2.0",
"method": "debug_traceTransaction",
"params": ["0x5c884a466fb59ee69114a0c99cb15d4d8af670a37be53fd59ffda3b5566b4269", {"tracer": "callTracer"}],
"id": 1
}Tracer Options
{}- Default opcode tracer (verbose){ tracer: "callTracer" }- Call tree tracer{ tracer: "prestateTracer" }- Pre-state tracer
Code Examples
Related Methods
debug_traceCall- Trace without executingdebug_traceBlockByNumber- Trace entire block
debug_traceCall
Simulate a call on Base with debug_traceCall and get opcode, callTracer or prestateTracer output at any block, without sending a transaction.
trace_block
Get traces for all transactions in a block on Base. Requires archive node for consumer dApps, SocialFi, NFT marketplaces, and merchant payment integrations.