All you need to know about Optimism

All you need to know about Optimism

Exploring one of Ethereum's most exciting Layer 2 rollups -> Optimism, It helps Ethereum users save on gas fees by rolling up batches of transactions, using a technology known as optimistic rollups.

image.png

Why are there issues in the Ethereum network?

Ethereum is a decentralised computer powered by nodes all over the world. Each node has to store and process data that goes through the Ethereum network, hence there is a limited amount of data that can be processed at any one time. We could increase the amount of data Ethereum processes, but nodes would have to upgrade accordingly. This reduces the number of individuals that can run a node as not everyone can afford a high spec computer, reducing Ethereum’s decentralisation and censorship-resistance.

The Binance Smart Chain (BSC) took this approach by forking Ethereum’s code and relying on a set of 21 validators to support the network, successfully creating a thriving ecosystem. However, this solution comes with its own issues. There was an exploit on a protocol in BSC, stealing $31 million of users’ funds. In response, Binance announced that it will freeze these funds if it makes it onto their exchange, the only way to withdraw from BSC at the moment. Binance was able to thwart the efforts of malicious actors but has shown that they have the power to decide which transactions get approved.

This goes against the ethos of Ethereum, which wants to build a credibly neutral platform capable of supporting a global ecosystem of finance and other applications. So how does Ethereum solve this? Through Optimistic Rollups.

Ethereum is already scaling without 2.0

You must have been living under a rock if you haven’t heard of Ethereum 2.0. What you may not know is that Ethereum is scaling with or without it and shifting from a Proof-of-Work (PoW) to Proof-of-Stake (PoS) consensus model is only the beginning.

The ultimate goal is to move from monolithic to modular blockchains, creating a whole new framework for blockchain scalability in the process. A monolithic blockchain is a blockchain that computes and processes everything on a single chain. The majority of Layer 1 blockchains are monolithic.

On the other hand, modular blockchains split chains up into data availability, execution, and security layers. In the case of Ethereum, the L1 becomes the security and data availability layer while the Layer 2s on top serve the purpose of execution.

The goal of L2s is to be able to do anything that a monolithic L1 can do, but better, and to be fully compatible with other L2s. Optimism is an example of an Ethereum L2 aiming to do just that.

The Blockchain Trilemma

The reason for this scaling problem can be found in the so-called blockchain trilemma. According to this, a blockchain must make compromises in terms of security, scalability, and decentralization. In very simplified terms, developers have to decide which of the two of these three properties they want to optimize for. For example, if one wants to ensure a certain level of security, it must be understood that, in this case, scalability is inversely proportional to decentralization. Comparable to Bitcoin, the Ethereum blockchain was optimized for security and decentralization, while scalability was sacrificed. As the number of transactions increases, the Ethereum network becomes increasingly busy — if users still want to use the Ethereum blockchain, they are forced to pay excessively high transaction fees. Optimized scaling of the Ethereum blockchain and the associated lower transaction fees would lead to increased user-friendliness and the development of new use cases.

Optimism: Solving the Blockchain Trilemma

If Ethereum wants to keep up with the growing competition, innovations are needed. According to Vitalik Buterin (co-founder of Ethereum), the key to Ethereum’s scaling problem can be found in rollups.

Approaches: Rollups

Rollups are a scaling solution where transactions are bundled and compressed off-chain before being verified on the consensus layer. This ultimately allows multiple transactions to be “aggregated” to a single on-chain transaction. The result of verifying multiple transactions simultaneously is increased efficiency; in parallel, the number of possible transactions that can be executed increases, resulting in increased scalability. Suddenly, Ethereum can scale from what used to be 15 transactions per second (tps) to 3000+ tps — without compromising on security.

There are two types of rollups:

Optimistic Rollups -> Implemented at Arbitrum, Optimism

ZK Rollups -> Used By ZKSync, StarkNet, Polygon Hermez In short:

Optimistic rollups assume that the bundles of transactions are valid and are published accordingly. Within a certain period of time, other participants then have the opportunity to prove that the data is incorrect by means of “fraud proof”. In this case, the data is rolled back. The participant receives a reward. The longer this “challenge period” is chosen, the greater the likelihood of preventing the publication of incorrect data on Ethereum’s Layer1. In direct trade-off to this, is that it takes longer for the transaction to become final on Layer1. In reality, this leads to the consequence that it takes up to seven days to withdraw one’s funds. Remedies in this regard can be provided by intermediaries who, for a fee, payout the user’s funds immediately on Layer1 and take on this waiting time and the risk of an incorrect transaction.

ZK rollups, on the other hand, are based upon a pessimistic view of the world. Unlike fraud proofs, validity proofs are generated with each bundle and presented with the Layer1 data to prove that all data is correct. This cryptographic proof (called ZK-SNARK) can be easily verified on-chain for correctness, regardless of the size of the data bundle or how much computational power was required for the transactions it contains. The transaction is written directly to the Layer 1 blockchain. Problem: loss of efficiency.We would learn more about these in a different blog 🙌.

image.png

Optimism

Optimism is a Layer 2 scaling solution for Ethereum that can support all of Ethereum’s Dapps. Instead of running all computation and data on the Ethereum network, Optimism puts all transaction data on-chain and runs computation off-chain, increasing Ethereum’s transactions per second and decreasing transaction fees. Tests have shown a 143x decrease in transaction fees on Synthetix Exchange and up to a 100x decrease on Uniswap. Since transaction data still stays on the Ethereum network, this scaling solution does not sacrifice Ethereum’s decentralisation or security for scalability.

How to use Optimism

To use Optimism, you’ll have to deposit your ETH or ERC-20 tokens to the Optimism token bridge. This allows you to transact on Ethereum through Optimism. You can convert your tokens back to the Ethereum mainnet once you’re finished.

In order to deposit your tokens, you’ll have to deposit them through the Optimism Gateway. You can connect to the Gateway through a Web3 wallet, like MetaMask. Deposits take about twenty minutes, and MetaMask quoted us $18 in fees to transfer 1 ETH.

Optimism advised that it would take a week and $52.72 to withdraw the funds. This delay is a feature of the week-long challenge time baked into Optimism’s optimistic rollup.

Once you’ve deposited funds on Optimism, you can use them within supported decentralized applications. Uniswap, for instance, allows you to trade through Optimism to save on fees. All you have to do is select Optimism from the menu of networks; then, you can trade as normal.

Conclusion

The prospect of scaling for Ethereum is positive news for the network and the Dapps on Ethereum. An increase in the number of users would mean more people are holding ETH to transact on the network, and cheaper fees would allow for larger trading volumes on exchanges like Synthetix and Uniswap. The narrative for Ethereum has never been better, through the growth of DeFi, NFTs, EIP1559’s slated launch and its upcoming scalability.