Optimism is a layer 2 (L2) scaling solution for Ethereum. As an L2 solution Optimism operates on top of Ethereum’s mainnnet and because of this can utilize Ethereum’s strong security and support Ethereum dApps. All transactions that occur on Optimism are eventually posted and validated on the mainnet of Ethereum using Optimistic Rollups.
Founded by Jinglan Wang, Karl Floersch, and Kevin Ho in 2019, Optimism continues to grow as an L2 solution that offers higher throughput and reduced expenses compared to Ethereum.
The Optimism API allows applications to connect to an Optimism node that is part of the Optimism network. Developers can interact with on-chain data and send different types of transactions to the network by utilizing the endpoints provided by the API. The API follows a JSON-RPC standard. JSON-RPC is a stateless, lightweight, remote procedure call (RPC) protocol encoded in JSON.
Explained in the Optimism API Quickstart Guide
As a Layer 2 solution, Optimism is an Optimistic Rollup network. Optimistic rollups (ORUs) run parallel to the Ethereum Mainnet. ORUs bundle multiple transactions into one transaction and send them back to the Ethereum Chain. Optimistic rollups assume all transactions are valid unless challenged by a fraud-proof, which makes the chain extremely scalable.
Yes! Optimism is fully compatible with all Solidity smart contracts and Ethereum libraries. As Optimism acts as a second layer operating on top of the main Ethereum network, it can utilize the Ethereum Virtual Machine just like Ethereum.
The Optimistic Virtual Machine (OVM) is an EVM-compatible virtual machine that executes transactions “optimistically,” which means it relies on the L1 chain to arbitrate disputes concerning the correctness of state transitions using fraud proofs.
Adding Optimism to the Metamask takes four steps:
- Create a free Alchemy account
- Create an API key
- Choose custom RPC in Metamask
- Fill in the Optimism network details
Developers should use the Optimism Goerli testnet and a Goerli faucet to get test ETH when testing Optimism applications.
If you sign in to your Alchemy account, you’ll get 5x more ETH. On Goerli, developers can get 0.05ETH every 24 hours, and use that on the testnet to make sure their applications are working properly before putting them on the Optimism mainnet.
To start building a dApp on Optimism, sign up for Alchemy and log in. Then click the “Apps” tab and “Create App”, and you’re ready to build your new app on the Optimism mainnet!
You can find a number of bridges to use on the Optimism site. To use one of these bridges, connect your Metamask wallet to send and receive tokens between Optimism and Ethereum. Cross-chain bridges are instrumental components of the multi-chain future of blockchain.
Many Web3 wallets can be used on Optimism. As Optimism continues to grow, it supports many of the most popular wallets. Some wallets that people choose to use on Optimism include Metamask, Ledger Nano X, and SafePal S1.
Optimism uses ETH tokens for gas, and because Optimism transactions are bundled using Optimistic Rollups, the gas costs to complete the transaction on the Optimism network are usually cheaper than native transactions on Ethereum.
Some of the most popular dApps on Optimism include Perpetual, Lyra, Synthetix, and Synapse.
Perpetual is a DeFi dApp that allows users to exchange perpetual contracts. Lyra, one of the first Dapps built natively on Optimism, is a crypto options exchange. Synthetix is a DeFi protocol built for trading derivatives trading, and Synapse is a cross-chain protocol for swapping assets between blockchains.
Withdrawing ETH from Optimism takes three easy steps: go to The Optimism Gateway, enter the amount you would like to remove from the network, and click “Withdraw”. Because Optimism uses fraud poofs, it takes 7 days for withdraws to Ethereum to be completed.
Optimism uses the JSON-RPC API standard. The Optimism JSON-RPC API serves as the backbone for the Optimism network and powers any blockchain interaction.
In aggregate, this API suite allows users to read block/transaction data, query chain information, execute smart contracts, and store data on-chain. Developer interacts with Optimism’s base JSON-RPC APIs to communicate with its decentralized network of nodes.
When accessing the Optimism network via a node provider, API providers like Alchemy require developers to use an API key to query the blockchain.
For the best development experience, we recommend that you sign up for a free API key! With a dedicated API key, developers can:
- access higher request throughput and increased concurrent requests
- query enhanced APIs, gaining access to free archive data, logs, and API abstractions
- Leverage individualized usage metrics
Three libraries support Optimism, including Alchemy-web3, Web3.js, and Ethers. Of these three, Alchemy is an improvement over Web3 and Ethers libraries, providing enhanced API calls, upgraded WebSockets, and many other benefits.
Before you get started, update your Optimism RPC URL to Alchemy.
You can find the list of all the methods Alchemy support for the Ethereum API on the Optimism API Endpoints page.
Don't worry, we got you. Check out our feel free to post in discord with any questions you have!