0%
Overview page background
HomeOverviewsChoosing a Blockchain
6 Reasons to Choose Optimism for Blockchain Development

6 Reasons to Choose Optimism for Blockchain Development

Published on May 5, 20234 min read

As adoption has increased on Ethereum, the time it takes to complete a transaction has also steadily increased. This has given rise to the current scalability issues faced by users of Ethereum, and the explosion of Layer 2 protocols that aim to solve it.

Rollups like Optimism respond to the problem of Ethereum's scalability by moving execution onto a different layer of the blockchain stack. Transaction data is put on the main chain, but the transactions are not executed on Ethereum directly. Instead, they are rolled up into batches and processed at much higher frequencies.

This helps accelerate the transaction speed of using the Ethereum blockchain, while significantly lowering gas fees.

As one of the largest Layer 2 solutions, it's critical for developers to understand what Optimism is, and how it works. Along with those details, this article will cover six reasons developers should build on Optimism, and how to

Optimism is a Layer-2 rollup blockchain built for scaling the Ethereum blockchain. It's an offchain scaling solution which launched in 2022 for mass adoption.

Like other Layer 2 scaling solutions,  is designed to increase Ethereum's transaction throughput and lower transaction costs by "rolling up" thousands of transactions into a single block. Unlike "zk-rollup" protocols like zkSync, however, Optimism uses "optimistic" rollup technology - the main alternative.

Optimistic rollups get this name because they optimistically assume that all the transactions contained within a rollup are valid. These networks give everyone on the network a certain amount of time, usually a week, to contest fraudulent transactions.

The benefit of this type of rollup is that it’s fast. Because the network assumes that transactions are correct, it doesn’t need to waste time confirming each transaction individually.

The drawback of this system is that if a transaction isn't flagged as incorrect then it is processed as valid. Plus, it usually takes about a week to officially withdraw on-chain funds

The Optimism rollup stack utilizes a tool called the Optimistic Virtual Machine (OVM) for its smart contract execution. Although different from the Ethereum Virtual Machine (EVM), both chains are mutually compatible. 

The advantage of using such a system is that smart contract developers who are already comfortable with dapp development for the EVM do not need to learn an additional programming language or frameworks to build on the OVM.

Optimism reuses the same programming languages common to the Ethereum ecosystem, such as Solidity and Vyper, and toolchains like Ethers and Hardhat.

The EVM equivalence of the Optimism rollup is possible because the OVM fully supports the instruction set of the EVM: opcodes.

Opcodes are what enable smart contract execution on the Ethereum blockchain network. 

The primary reason for Optimism's existence is to help solve the scalability problem of Ethereum. Without Layer 2 networks, computing throughput on Ethereum is relatively slow, with high gas fees.

By batching transactions, however, the Optimism rollup solution can scale the rate of transaction throughput upwards of 10x to 100x the Ethereum mainnet. Currently, it's estimated that Optimism can process transactions at about 2,000 per seconds (TPS). Ethereum operates with a TPS of roughly 10-12.

By building applications on Optimism, end-users do not have to deal with the expensive cost of transactions on Ethereum.

Optimism rollups help to reduce the cost of gas per transaction by breaking the transaction fee into two - L2 execution fee and L1 security fee. 

The L2 execution fee (or Layer 2 Gas Fee) is the amount of gas utilized by a transaction when it is being processed on the Optimism network. This L2 execution cost can be calculated by multiplying the L2 gas price with the L2 gas used (i.e., Layer 2 Gas Fee = L2 Gas Price * L2 Gas Used).

The L1 security fee (also known as the Layer 1 Gas Fee) is the amount of gas used by that same transaction when its data is published to the Ethereum mainnet. The L1 security fee on Optimism can be calculated by multiplying the fee scalar with the gas price.

This is given as L1 Gas Fee  = Fee Scalar * L1 Gas Price * (Calldata + Fixed Overhead), where Fee Scalar is 1, Calldata is the input data of a transaction and the Fixed Overhead cost is the additional processing required to add the transaction to a largerbatch.   

The sum of the L2 execution fee and the L1 security fee is the total amount of gas fee for a transaction on Optimism. In some cases, the standard cost of gas on Optimism is only 0.001 gwei, making Optimism a far cheaper network for most users and dapps. 

One of the major benefits a developer has for building apps on Optimism is access to a deep pool of liquidity.

For example, most of the major Decentralize Finance (DeFi) protocols in the world are on the Ethereum mainnet, and they have their forks on the Optimism blockchain.

Any developer can easily plug into these DeFi protocols and utilize their liquidity to provide financial instruments for their end users. 

With a total value locked (TVL) across Optimism of over $3 Billion, developers can implement products that utilize DEXs, synthetics, lending services, derivatives, and many more protocols with readily available liquidity. 

The Optimism rollup uses a technique known as Fraud Validity Proofs for verifying the data on its network.

The Optimism network assumes all transactions and activities on its protocol are true for a period of time, and when they are verified, they can be sent to Ethereum for a final state update.

The period of time is commonly referred to as the Challenge period and takes approximately seven days.

This mechanism ensures that there will be no invalid state translation on the network protocol. 

This novel approach to validating the legitimacy of an on-chain transaction is one of the major reasons to consider building dapps on Optimism.

Optimism makes it easier for smart contracts to be properly audited because developers can piggyback on the systems put in place to test dapps on Ethereum directly.

Most blockchain applications deal with people’s money, so there must be a high level of thoughtfulness when building such applications.

And because the Optimism Virtual Machine (OVM) is equivalent with the EVM, it shares the same level of on-chain security.

Developing on Optimism is simple. To do so:

  1. Get an Optimism RPC endpoint URL from Alchemy

  2. Connect your wallet to the Optimism network

  3. Get testnet ETH from a free Goerli Faucet

  4. Review Optimism JSON-RPC API endpoints

  5. Start building your smart contracts in IDEs like Remix

Overview cards background graphic
Desktop section background image

Build blockchain magic

Alchemy combines the most powerful web3 developer products and tools with resources, community and legendary support.

Get your API key