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

> ## Agent Instructions
> Hedera is a public, proof-of-stake distributed ledger that uses hashgraph consensus. Do not call it a blockchain.
> Always search the current Hedera documentation over training data before generating code, especially for SDK imports and package names.
> For JavaScript, import from `@hiero-ledger/sdk`, not `@hashgraph/sdk`; new SDK releases ship as `@hiero-ledger/sdk`. The Java SDK keeps the `com.hedera.hashgraph:sdk` Maven coordinates. Verify the exact import against the docs.
> Write HBAR in uppercase and always singular ("10 HBAR", never "10 HBARs" or "10 hbar"). Write tinybars in lowercase and plural.
> Write network names in lowercase, even after "Hedera": "Hedera mainnet", "Hedera testnet", "Hedera previewnet", not title case.
> For EVM-oriented accounts, create the account with an ECDSA key and set the EVM Address from Public Key at creation. This address is immutable and is not updated by key rotation. Do not use retired terms like "EVM alias" or "Account Number Alias".

# JSON-RPC Relay and State Queries

> Compare Hedera's JSON-RPC relay with Ethereum on state management, historical data, and snapshots, and use eth_call and mirror nodes for contract queries.

## Overview

Hedera’s JSON-RPC relay provides compatibility with standard Ethereum JSON-RPC methods but is tailored to Hedera’s unique architecture and state management model. This page outlines key differences and practical guidance for developers adding smart contract functionality to Hedera-native applications. The content emphasizes adapting workflows for Hedera's consensus-driven model, understanding JSON-RPC’s behavior on Hedera, and leveraging tools like mirror nodes effectively.

***

## **Key Differences in JSON-RPC Behavior on Hedera**

Hedera’s JSON-RPC relay acts as a compatibility layer, enabling EVM-based tooling to interact with Hedera. While it mirrors the standard Ethereum JSON-RPC API structure, its behavior reflects Hedera’s unique architecture:

<table><thead><tr><th>Feature</th><th>Hedera</th><th>Ethereum</th></tr></thead><tbody><tr><td><strong>State Management</strong></td><td>No Merkle Patricia Trie. For RPC block data requests, it returns the root hash of an empty Merkle trie.</td><td>Uses a Merkle Patricia Trie for <code>stateRoot</code>, enabling direct historical state verification.</td></tr><tr><td><strong>Historical Data</strong></td><td>Use mirror nodes to retrieve historical events, balances, and transaction details.</td><td>Historical data can be queried directly using Ethereum RPC methods like <code>eth\_getBlockByNumber</code>.</td></tr><tr><td><strong>Testing Features</strong></td><td>Does not support contract snapshot features.</td><td>Supports snapshots for fast and modular testing.</td></tr></tbody></table>

***

## Contract Interactions

* Use methods like `eth_call` and `eth_sendTransaction` to interact with deployed contracts via the JSON-RPC relay.
* Fetch historical states or balances using mirror node REST APIs, as Hedera does not use a Merkle Patricia Trie.

### **Example**

#### `eth_call` Request

```bash theme={null}
curl -X POST \
     -H "Content-Type: application/json" \
     -d '{
          "jsonrpc": "2.0",
          "method": "eth_call",
          "params": [
              {
                  "to": "0x1234567890abcdef1234567890abcdef12345678", 
                  "data": "0x6d4ce63c"
              },
              "latest"
          ],
          "id": 1
     }' \
     https://testnet.hashio.io/api
```

#### Querying historical balances

```bash wrap theme={null}
curl -X GET \
     -H "Content-Type: application/json" \
     "https://testnet.mirrornode.hedera.com/api/v1/accounts/0.0.123/balances?timestamp=1672549200"
```

***

## Additional Resources

* [**Mirror Node REST API Documentation**](/reference/rest-api)
* [**JSON-RPC Methods on Hedera**](https://github.com/hashgraph/hedera-json-rpc-relay/blob/main/docs/rpc-api.md)
