Compare the question, not just the envelope
These examples describe upstream network APIs. Similar request envelopes do not make their methods or results interchangeable. Use the official references alongside the network guides before implementing a real client.
| Network | Method | Purpose | Context to preserve |
|---|---|---|---|
| Ethereum | eth_chainId | Network identity | Expected chain configuration |
| Ethereum | eth_getBalance | Native balance | Address, wei, block reference |
| Solana | getBalance | Native balance | Public key, lamports, context |
| Solana | getSlot | Observed slot | Cluster and commitment policy |
| Bitcoin | getblockchaininfo | Node chain context | Configured node and network |
| Bitcoin | gettxout | Inspect an unspent output | Transaction, index, mempool option |
READ-ONLY EXAMPLE / eth_getBalance
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getBalance",
"params": [
"0x0000000000000000000000000000000000000000",
"latest"
]
}Response handling checklist
Check HTTP status, JSON parsing, RPC error fields, expected identifiers, and method-specific result types. Do not assume that a successful HTTP response means the requested method returned a usable result.
About protocol versions
The Bitcoin sample uses a legacy-compatible JSON-RPC 1.0 envelope. Ethereum and Solana samples use JSON-RPC 2.0. Check your node version and provider contract instead of forcing one protocol declaration onto every source.
Upstream references
Verify exact method details in the Ethereum RPC reference, Solana RPC documentation, and Bitcoin RPC reference.