Optimism RPC
What is Optimism?
Optimism is a Layer 2 scaling solution for Ethereum that uses optimistic rollup technology to increase throughput while maintaining Ethereum's security. Optimism processes transactions off-chain and posts compressed transaction data to Ethereum mainnet, inheriting its security guarantees through a 7-day fraud proof window.
Optimism implements the Optimism Virtual Machine (OVM), which is EVM-equivalent at the bytecode level. The network uses sequencers to order transactions and produce blocks with 2-second block times. The network supports cross-chain messaging through its native bridge contracts, allowing assets and data to move between L1 and L2. Optimism uses ETH for gas fees and implements the same account model and transaction types as Ethereum.
Interacting with Optimism
The Optimism JSON-RPC API extends the standard Ethereum JSON-RPC interface with L2-specific functionality. Since Optimism maintains EVM equivalence, developers can use existing Ethereum tools and libraries without modification.
With this API, you can:
- Execute all standard Ethereum JSON-RPC methods (eth_call, eth_sendTransaction, eth_getBalance)
- Access Optimism-specific methods for L2 operations and gas estimation
- Query L1 to L2 message status and cross-chain transaction receipts
- Retrieve L2 block and transaction data including L1 batch information
- Subscribe to real-time events via WebSocket connections
You can access the API by:
- Running a local Optimism node (op-node and op-geth)
- Using a hosted provider such as a Quicknode Optimism endpoint, which provides instant access to mainnet and testnet with archive data support
支援的網路
Quicknode provides access to the following Optimism networks:
Complete reference for developers building on Optimism with Quicknode:
快速入門
Get started with Optimism quickly. Follow our step-by-step quickstart to set up your endpoint and make your first API request.
供應商端點
Learn how to configure and manage your Optimism endpoints for optimal performance and reliability.
API 概覽
探索受支援的 API、網路、Quicknode 以及增強的 API 功能,以建構功能強大的應用程式。
附加元件
Discover endpoint add-ons that extend your Optimism development workflow.
Endpoint
透過身分驗證、白名單機制及最佳安全實務,確保您的端點安全。
錯誤代碼
Understand common error codes and troubleshooting steps for Optimism API requests.