API Reference
The RPC surface and on-chain interfaces builders actually call: op-geth/op-node RPC methods, engine API, and the core Solidity contracts.
Third-party documentation. This is independently authored analysis of the public Optimism (OP Stack) codebase — not the official docs, and not reviewed or endorsed by the Optimism (OP Stack) team.
API Reference
The OP Stack exposes three distinct surfaces: the execution RPC (op-geth, standard Ethereum JSON-RPC), the consensus/rollup RPC (op-node and the operator services), and the on-chain interfaces (the Solidity contracts on L1). Most application developers only use the first; operators and infrastructure builders use all three.
Execution RPC (op-geth)
Identical to go-ethereum for standard operations:
eth_blockNumber,eth_getBlockByNumber/Hash,eth_getTransactionByHash,eth_getTransactionReceipteth_call,eth_estimateGas,eth_sendRawTransaction,eth_getBalance,eth_getCode,eth_getStorageAteth_getLogs,eth_getProof(for merkle-proof based tooling)- Standard
net_,web3_, andadmin_namespaces
Rollup RPC (op-node)
optimism_syncStatus— the canonical head, safe head, unsafe head, current L1, and the sync stage. The single most useful health/debug endpoint.optimism_outputAtBlock(blockNumber)— returns the output root for an L2 block, the basis for proving withdrawals.optimism_rollupConfig— the chain's full rollup configuration (contracts, genesis, channel timeouts, etc.).rollup_getPayload,rollup_derivePayloadAttributes— internal payload plumbing used by node operators.
Operator admin RPC
optimism_batcher_channelState,optimism_batcher_forceSubmitChannel— on op-batcher's separate admin port.optimism_proposer_outputL2Block,optimism_proposer_outputRoot— on op-proposer's admin port.admin_nodeInfo,admin_peers— P2P diagnostics on op-node.
Engine API (op-node ↔ op-geth)
Not something application developers call, but the protocol heart: engine_forkchoiceUpdated, engine_newPayload, engine_getPayload (and the V3/V4 blob-capable variants), engine_exchangeCapabilities. The engine's rollup PayloadAttributes carry the L1 origin and forced deposits.
Key on-chain interfaces
- OptimismPortal —
depositTransaction,proveWithdrawalTransaction,finalizeWithdrawalTransaction,depositTransactionCount. - CrossDomainMessenger —
sendMessage,relayMessage,messageNonce,failedMessages(for replayable failed relays). - L1StandardBridge —
depositETH,depositERC20,finalizeETHWithdrawal,finalizeERC20Withdrawal. - SystemConfig —
batcherHash,overhead,scalar,gasLimit,setSystemConfig. - DisputeGameFactory —
create,gameAtIndex,gameCount. - L2 predeploys —
L2ToL1MessagePasser,L1Block,L2StandardBridge,GasPriceOracle,WETH9, at deterministic addresses.
Edge cases
optimism_syncStatusshows three heads — tools must decide which to trust. For anything with financial impact, use the safe head, not the unsafe head.- The rollup config differs per chain (different contract addresses, batch inbox, chain ID). Never hardcode it; read it from
optimism_rollupConfigor the Superchain Registry. - GasPriceOracle's
getL1Fee/getL1GasUsedreturn values in wei on the L2 using the current L1 basefee; they are estimates, and the actual fee is computed at execution time.
Interface
# op-geth (execution) — standard Ethereum JSON-RPCeth_blockNumber, eth_getBlockByNumber, eth_getTransactionByHash,eth_call, eth_getBalance, eth_estimateGas, eth_getLogs,eth_getProof, eth_getStorageAt, web3_clientVersion# op-node (consensus) — rollup-specific methodsoptimism_syncStatus → { current_l1, current_l2, head_l1, unsafe_l2, ... }optimism_outputAtBlock → (blockNumber) → { outputRoot, timestamp, l2BlockNumber }optimism_rollupConfig → the chain039;s rollup configurationrollup_getPayload → latest safe/unsafe L2 payload attributesadmin_nodeInfo, admin_peers# op-batcher / op-proposer admin RPC (on dedicated ports)optimism_batcher_channelStateoptimism_batcher_forceSubmitChannel# engine API (op-node ↔ op-geth), go-ethereum039;s Engine namespaceengine_forkchoiceUpdated, engine_newPayload, engine_getPayload,engine_getPayloadV3, engine_getPayloadV4, engine_exchangeCapabilities
