Antler by Autoflux

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.

Path: api-reference

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_getTransactionReceipt
  • eth_call, eth_estimateGas, eth_sendRawTransaction, eth_getBalance, eth_getCode, eth_getStorageAt
  • eth_getLogs, eth_getProof (for merkle-proof based tooling)
  • Standard net_, web3_, and admin_ 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

  • OptimismPortaldepositTransaction, proveWithdrawalTransaction, finalizeWithdrawalTransaction, depositTransactionCount.
  • CrossDomainMessengersendMessage, relayMessage, messageNonce, failedMessages (for replayable failed relays).
  • L1StandardBridgedepositETH, depositERC20, finalizeETHWithdrawal, finalizeERC20Withdrawal.
  • SystemConfigbatcherHash, overhead, scalar, gasLimit, setSystemConfig.
  • DisputeGameFactorycreate, gameAtIndex, gameCount.
  • L2 predeploysL2ToL1MessagePasser, L1Block, L2StandardBridge, GasPriceOracle, WETH9, at deterministic addresses.

Edge cases

  • optimism_syncStatus shows 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_rollupConfig or the Superchain Registry.
  • GasPriceOracle's getL1Fee/getL1GasUsed return values in wei on the L2 using the current L1 basefee; they are estimates, and the actual fee is computed at execution time.

Interface

Interface
text
# op-geth (execution) — standard Ethereum JSON-RPC
eth_blockNumber, eth_getBlockByNumber, eth_getTransactionByHash,
eth_call, eth_getBalance, eth_estimateGas, eth_getLogs,
eth_getProof, eth_getStorageAt, web3_clientVersion
 
# op-node (consensus) — rollup-specific methods
optimism_syncStatus → { current_l1, current_l2, head_l1, unsafe_l2, ... }
optimism_outputAtBlock → (blockNumber) → { outputRoot, timestamp, l2BlockNumber }
optimism_rollupConfig → the chain's rollup configuration
rollup_getPayload → latest safe/unsafe L2 payload attributes
admin_nodeInfo, admin_peers
 
# op-batcher / op-proposer admin RPC (on dedicated ports)
optimism_batcher_channelState
optimism_batcher_forceSubmitChannel
 
# engine API (op-node ↔ op-geth), go-ethereum's Engine namespace
engine_forkchoiceUpdated, engine_newPayload, engine_getPayload,
engine_getPayloadV3, engine_getPayloadV4, engine_exchangeCapabilities
 
STATUSinterface