Join our community of builders on Discord!

Mainnet API & RPC Reference

The Lightchain AI Mainnet exposes standard Ethereum JSON-RPC endpoints alongside Lightchain-specific extensions for AIVM and PoI interactions.

Endpoints

ProtocolURLUse Case
HTTPShttps://rpc.mainnet.lightchain.aiStandard JSON-RPC
HTTPS (secondary)https://rpc2.mainnet.lightchain.aiSeparate node; use as a fallback (recent state only)
HTTPS (secondary)https://rpc3.mainnet.lightchain.aiSeparate node; recent state only; also serves debug and txpool
Archivehttps://archive.mainnet.lightchain.aiHistorical state (eth, net, rpc, web3)
WSSwss://rpc.mainnet.lightchain.aiSubscriptions and real-time events
Beacon APIhttps://beacon.mainnet.lightchain.aiBeacon chain API (blob retrieval, EIP-4844)
RPC endpoints may be rate-limited during periods of high demand. If you experience throttling, consider running your own mainnet node.

Rate Limits

The public endpoints publish no fixed rate limit and may be rate-limited during periods of high demand.

Supported JSON-RPC Methods

Standard Ethereum Methods

All standard Ethereum JSON-RPC methods are supported. Commonly used methods include: Querying State
MethodDescription
eth_blockNumberReturns the latest block number
eth_getBalanceReturns the balance of an address
eth_getTransactionByHashReturns transaction details by hash
eth_getTransactionReceiptReturns the receipt of a transaction
eth_getBlockByNumberReturns block details by number
eth_getBlockByHashReturns block details by hash
eth_getCodeReturns the bytecode at an address
eth_getStorageAtReturns storage at a position
eth_callExecutes a read-only call
eth_getLogsReturns logs matching a filter
Sending Transactions
MethodDescription
eth_sendRawTransactionSubmits a signed transaction
eth_estimateGasEstimates the gas for a transaction
eth_gasPriceReturns the current gas price
eth_getTransactionCountReturns the nonce for an address
Subscriptions (WebSocket)
MethodDescription
eth_subscribeSubscribe to events (newHeads, logs)
eth_unsubscribeUnsubscribe from an event stream

Lightchain-Specific Methods

Lightchain adds no custom JSON-RPC methods. The public mainnet endpoint serves the eth, net, rpc and web3 namespaces. AI inference does not go through JSON-RPC. It runs through the protocol contracts (JobRegistry and SessionManager; see Contract Addresses) or through the Developer API. Model availability, fees and limits are read from AIConfig with ordinary eth_call.

Example Requests

Get Latest Block Number

CodeBASH
Response:
CodeJSON

Get Account Balance

CodeBASH

Subscribe to New Blocks (WebSocket)

CodeJAVASCRIPT

Error Codes

CodeMessageDescription
-32600Invalid RequestMalformed JSON-RPC request
-32601Method Not FoundThe method does not exist
-32602Invalid ParamsInvalid method parameters
-32603Internal ErrorServer-side processing error
-32000Transaction UnderpricedGas price too low
-32001Nonce Too LowTransaction nonce already used
-32700Parse ErrorInvalid JSON payload

Health Check

Verify that the RPC endpoint is responding:
CodeBASH
Expected result: "9200" (the chain ID as a string).

Resources


Last updated: May 2026