Skill 1.1.1

Explain how applications communicate with Ethereum nodes through JSON-RPC

Key Concepts

An Ethereum execution client such as Geth exposes a JSON-RPC interface: a client sends a JSON object naming a method and its parameters, and the node replies with a JSON result. Methods in the eth_ namespace read chain data (eth_blockNumber, eth_getBalance, eth_getLogs), simulate calls (eth_call, eth_estimateGas) and submit transactions (eth_sendRawTransaction). The net_ and web3_ namespaces return network and client information.

Numbers in JSON-RPC are hexadecimal strings, such as "0x7a69" for chain ID 31337, and amounts are always in wei. Libraries such as web3.js convert these values into JavaScript types, encode contract calls using the ABI and decode the results, but every operation ends as a JSON-RPC request to some node.

Applications reach a node in one of three ways: a node the team runs itself, a commercial node provider such as Infura or Alchemy reached through an API key in the URL, or the user's browser wallet, which forwards requests to the wallet's own node connection.