> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# trace_rawTransaction | Hyperliquid EVM

> The trace_rawTransaction JSON-RPC method executes a raw transaction and returns trace information. Hyperliquid EVM via Chainstack.

<Info>
  This method is available on Chainstack. Not all Hyperliquid methods are available on Chainstack, as the open-source node implementation does not support them yet — see [Hyperliquid methods](/docs/hyperliquid-methods) for the full availability breakdown.
</Info>

The `trace_rawTransaction` JSON-RPC method executes a raw transaction and returns trace information. This method simulates the execution of a raw transaction and provides detailed execution traces, making it useful for analyzing pre-signed transactions and testing transaction execution without broadcasting.

## Parameters

1. **Raw transaction data** (string, required): Raw transaction in hexadecimal format
2. **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 an array of trace objects containing detailed execution information.

### Response structure

**Trace objects:**

* `action` — Details about the call action
* `result` — Execution result
* `traceAddress` — Address path within call hierarchy
* `type` — Type of trace (call, create, suicide, etc.)

## Usage example

### Basic implementation

```javascript theme={"system"}
// Execute a raw transaction with tracing
const traceRawTransaction = async (rawTx, traceTypes = ['trace']) => {
  const response = await fetch('https://hyperliquid-mainnet.core.chainstack.com/YOUR_ENDPOINT/evm', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      jsonrpc: '2.0',
      method: 'trace_rawTransaction',
      params: [rawTx, traceTypes],
      id: 1
    })
  });
  
  const data = await response.json();
  return data.result;
};

// Example usage
const rawTx = '0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89';

traceRawTransaction(rawTx).then(traces => {
  console.log('Raw transaction trace:');
  traces.forEach(trace => {
    console.log(`Type: ${trace.type}`);
    console.log(`Gas used: ${parseInt(trace.result.gasUsed, 16)}`);
  });
});
```

## Example request

<CodeGroup>
  ```shell Shell theme={"system"}
  curl -X POST \
    -H "Content-Type: application/json" \
    -d '{
      "jsonrpc": "2.0",
      "method": "trace_rawTransaction",
      "params": [
        "0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89",
        ["trace"]
      ],
      "id": 1
    }' \
    https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm
  ```

  ```python Python (web3.py) theme={"system"}
  from web3 import Web3

  w3 = Web3(Web3.HTTPProvider("YOUR_CHAINSTACK_ENDPOINT"))

  raw_tx = "0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89"

  # trace_rawTransaction is a non-standard JSON-RPC method, so call it directly.
  response = w3.provider.make_request("trace_rawTransaction", [raw_tx, ["trace"]])
  print(response["result"])
  ```

  ```javascript JavaScript (ethers.js) theme={"system"}
  import { JsonRpcProvider } from "ethers";

  const provider = new JsonRpcProvider("YOUR_CHAINSTACK_ENDPOINT");

  const rawTx =
    "0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89";

  // trace_rawTransaction is a non-standard JSON-RPC method, so send it directly.
  const traces = await provider.send("trace_rawTransaction", [rawTx, ["trace"]]);
  console.log(traces);
  ```

  ```typescript TypeScript (viem) theme={"system"}
  import { createPublicClient, http } from "viem";

  const client = createPublicClient({
    transport: http("YOUR_CHAINSTACK_ENDPOINT"),
  });

  const rawTx =
    "0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89";

  // trace_rawTransaction is a non-standard JSON-RPC method, so request it directly.
  const traces = await client.request({
    method: "trace_rawTransaction",
    params: [rawTx, ["trace"]],
  });
  console.log(traces);
  ```
</CodeGroup>

<Note>
  **Use your own endpoint in your code.** The code examples use a placeholder Chainstack endpoint (YOUR\_CHAINSTACK\_ENDPOINT) — replace it with your own Hyperliquid node endpoint from the [Chainstack console](https://console.chainstack.com/). The curl above uses a shared public endpoint for quick checks only; do not use it in production.
</Note>

## Use cases

The `trace_rawTransaction` method is essential for applications that need to:

* **Pre-signed transaction analysis**: Analyze transactions before broadcasting
* **Offline transaction testing**: Test transaction execution offline
* **Transaction debugging**: Debug transaction execution issues
* **Security analysis**: Analyze transaction security and potential vulnerabilities
* **Gas estimation**: Get accurate gas estimates for raw transactions
* **Development tools**: Build transaction analysis and debugging tools
* **Wallet applications**: Provide transaction previews in wallet interfaces
* **Compliance checking**: Verify regulatory compliance before broadcasting
* **Educational tools**: Create educational content about transaction execution
* **Research platforms**: Support academic and commercial blockchain research

This method provides comprehensive analysis of raw transactions before execution on the Hyperliquid EVM platform.


## OpenAPI

````yaml openapi/hyperliquid_node_api/hyperevm/evm_trace_raw_transaction.json post /evm
openapi: 3.0.0
info:
  title: Hyperliquid EVM API - trace_rawTransaction
  version: 1.0.0
servers:
  - url: >-
      https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274
security: []
paths:
  /evm:
    post:
      summary: trace_rawTransaction
      description: >-
        Executes a raw transaction and returns trace information. This method
        simulates the execution of a raw transaction and provides detailed
        execution traces.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - params
                - id
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  default: '2.0'
                  description: JSON-RPC version
                method:
                  type: string
                  enum:
                    - trace_rawTransaction
                  default: trace_rawTransaction
                  description: The RPC method name
                params:
                  type: array
                  description: 'Parameters: [raw transaction data, trace types array]'
                  default:
                    - >-
                      0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89
                    - - trace
                id:
                  type: integer
                  default: 1
                  description: Request identifier
            example:
              jsonrpc: '2.0'
              method: trace_rawTransaction
              params:
                - >-
                  0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89
                - - trace
              id: 1
      responses:
        '200':
          description: Successful response with trace data
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPC version
                  id:
                    type: integer
                    description: Request identifier
                  result:
                    type: array
                    description: Array of trace objects containing execution information
              example:
                jsonrpc: '2.0'
                id: 1
                result:
                  - action:
                      from: 0x...
                      to: 0x...
                      value: 0x...
                      gas: 0x...
                      input: 0x
                      callType: call
                    result:
                      gasUsed: '0x5208'
                      output: 0x
                    traceAddress: []
                    type: call

````