Optimism is a layer 2 blockchain that aims to enhance the functionalities of Ethereum.
Processing speed and gas cost are among the weak points in many blockchains. Improvements in these areas are needed to decongest the network and improve blockchain performance. Optimism and its technology have achieved this improvement in the Ethereum blockchain, in addition to reducing the cost of transaction fees (gas).
What is Optimism?
It is a Layer 2 (Layer 2 or L2) blockchain based on Ethereum that aims to decrease the cost per transaction and increase processing speed.
History of Optimism
Optimism has marked a roadmap that can be consulted on its website, for the moment the steps taken are as follows:
- June 2019: the solution on which Optimism’s blockchain is based, Optimistic Rollups, is presented.
- October 2019: Optimism’s testnet, called Unipig, is launched.
- September 2020: the Optimism testnet becomes compatible with the Ethereum virtual machine (EVM).
- January 2021: its Alpha mainnet is launched.
- October 2021: its mainnet is made equivalent to the EVM.
- December 2021: its mainnet is configured open sourceFebruary 2023: Bedrock, the upgrade to Optimism, is launched. In this same month Coinbase joins as lead developer of the OP Stack codebase, and as a new L2 blockchain built on top of it, called Base.
How does Optimism work?
To achieve the much desired optimization of blockchains, in this case Ethereum, it is necessary to achieve increased transaction processing speed, thus reducing network congestion. For this purpose, layer 2 solutions, such as Optimism, contribute with their technology to achieve this.
Optimism in turn uses an Ethereum mechanism called Optimistic Rollups. Optimistic Rollups are layer 2 protocols that extend Ethereum’s layer 1 processing power by allowing transactions to be processed outside the blockchain. This causes the processing speed to increase. These rollups in addition to improving scalability by 10 to 100 times also reduce the required gas cost per transaction.
Optimism is in continuous synchronization with Ethereum, communications between both blockchains is constant and is done through smart contracts, being able to send different cryptoassets between them, such as ether or different ERC-20, ERC-721 and ERC-1155 tokens, as it does not have any native cryptoassets. When a number of given transactions have been processed in Optimism a single transaction is generated that encompasses all of them and sent to the main chain, Ethereum. The reduction in gas costs occurs because since it is a single transaction these costs are divided among the different users whose transactions are part of that single transaction that is sent to Ethereum.
Off-chain transaction processing, i.e. on the Optimism blockchain, is performed on the Optimism Virtual Machine (OVM) which is the execution environment for smart contracts running on an Optimistic Rollup and running on top of the Ethereum blockchain.
Blocks
Block production with the Optimism scheme is managed by a figure called a sequencer, which receives and commits transactions and provides status updates, builds and executes Layer 2 blocks, and sends transactions to Layer 1.
The blocks generated on the Optimism chain were stored in an Ethereum smart contract called the Canonical Transaction Chain. In Q1 2023, and with the Optimism update called Bedrock, the storage of blocks is already done on an Ethereum chain address without a contract, so as to reduce gas costs on this L1 chain. The pending blocks are sent in large batches to the Ethereum mainnet so as to reduce the gas cost per transaction.
This new update of Optimism, Bedrock, introduces different technical modifications regarding the management and execution of the blocks that you can consult in English.
Superchain
The Optimism project raises, in this search for the improvement of blockchain features, why instead of working in isolation creating different blockchains not to take advantage of what each of these blockchains offer and walk together hand in hand to achieve a common goal.
This is what Optimism calls the Superchain.
The Superchain aims to integrate otherwise isolated layer 2 blockchains into a single interoperable system.
One such blockchain that is integrated into this Superchain is Base, Coinbase’s blockchain, which relies on Optimism’s technology, specifically it is based on Optimism’s OP Stack.
Advantages and disadvantages of Optimism.
Advantages:
Greater scalability. With Optimism, transactions can be handled faster.
Low gas rates. Off-chain and large batch transaction processing significantly reduces gas fees per transaction.
Portability. Developers can easily migrate their DApss from Ethereum to Optimism, as the Ethereum virtual machine (EVM) and Optimism virtual machine (OVM) are fully compatible.
Disadvantages:
Security. Despite the fact that Optimism is quite secure it is necessary to improve this feature still.
Centralization. At the moment the Optimism team is the one managing the network, so centralization to some extent is present, although in the near future their goal is to eliminate this feature.
Withdrawals. This is one of the biggest drawbacks, the delay in cash withdrawals as external validators are needed, which delays the process.