# trace_transaction - Taiko RPC Method

Returns all traces for a specific transaction on Taiko.

This method requires an archive node. It is not available on full nodes.

## When to Use This Method

- **Get parity-style transaction trace** - Retrieve the full trace of all internal calls, state changes, and value transfers for Taiko mainnet
- **Analyze internal calls and state changes** - See every sub-call, delegate call, and contract creation triggered by a transaction on Taiko
- **Audit transaction execution paths** - Follow the exact flow of execution through contracts to verify correctness
- **Track value flows** - Trace how funds move through multiple contracts in a single transaction

## Best Practices

- Parity-style traces are more detailed than the debug namespace equivalent
- Use trace\_replayTransaction for combined trace, vmTrace, and stateDiff output
- Results include both stateDiff and vmTrace sections for comprehensive analysis
- Requires archive node access; not available on standard full nodes

## Request Parameters

- `txHash` (`DATA, required`): 32-byte transaction hash

## Request Example

```json
{
  "jsonrpc": "2.0",
  "method": "trace_transaction",
  "params": ["0xc9aac5d30a3a9eb839f10db814a2cbe8971212bd8c77f8227d30532873be7bbe"],
  "id": 1
}
```

## Response Fields

This method returns no documented fields.

## Successful Response

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {}
}
```

## Code Examples

cURL
JavaScript
Python

```bash
curl -X POST https://api-taiko-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "trace_transaction",
    "params": ["0xc9aac5d30a3a9eb839f10db814a2cbe8971212bd8c77f8227d30532873be7bbe"],
    "id": 1
  }'
```

```javascript
import { JsonRpcProvider } from 'ethers';

const provider = new JsonRpcProvider('https://api-taiko-mainnet.n.dwellir.com/YOUR_API_KEY');

const traces = await provider.send('trace_transaction', [
  '0xc9aac5d30a3a9eb839f10db814a2cbe8971212bd8c77f8227d30532873be7bbe'
]);
console.log('Traces:', traces.length);
for (const trace of traces) {
  console.log(`  ${trace.action.from} -> ${trace.action.to} (${trace.type})`);
}
```

```python
from web3 import Web3

w3 = Web3(Web3.HTTPProvider('https://api-taiko-mainnet.n.dwellir.com/YOUR_API_KEY'))

traces = w3.provider.make_request('trace_transaction', [
    '0xc9aac5d30a3a9eb839f10db814a2cbe8971212bd8c77f8227d30532873be7bbe'
])
for trace in traces['result']:
    action = trace['action']
    print(f'{action["from"]} -> {action.get("to", "CREATE")} ({trace["type"]})')
```

## Related Methods

- [`trace_get`](https://www.dwellir.com/docs/taiko/trace_get) - Get a specific trace by index
- [`trace_block`](https://www.dwellir.com/docs/taiko/trace_block) - Get all traces in a block
- [`trace_filter`](https://www.dwellir.com/docs/taiko/trace_filter) - Filter traces by criteria
