Explain what's layer 2 in blockchain in plant language

Imagine you and your friends want to keep track of some information, like how much money you owe each other. One way to do this is to write everything down on a piece of paper, and update it every time someone owes someone else some money. This is like the "base layer" of keeping track of information.

But let's say that you and your friends start to get a lot of transactions, and it's becoming hard to keep everything organized on that one piece of paper. You might decide to create a new system, like a notebook, where you can write down all the transactions in one place, and then update the main piece of paper less frequently. This notebook is like a "second layer" on top of the paper, which makes it easier to manage everything.

In the world of blockchain, a "layer 2" solution works in a similar way. The base layer is the main blockchain, which keeps track of all the transactions that are happening. But if there are a lot of transactions, it can become slow or expensive to use the main blockchain for everything. So a layer 2 solution is like a second layer on top of the main blockchain, which can handle a lot more transactions, and then update the main blockchain less frequently. This can make transactions faster and cheaper for everyone involved.

There are different types of layer 2 solutions, but some common examples include "off-chain" networks or "sidechain" that allow for more transactions to occur without overloading the main blockchain. Overall, layer 2 solutions are a way to make blockchain technology more scalable and efficient for everyone.

The battle of layer 2
The battle of layer 2

Arbitrum and Optimistic Rollups are both Layer 2 scaling solutions for Ethereum, designed to address the blockchain's scalability and high transaction fees.

The main difference between Arbitrum and Optimistic Rollups lies in their approach to achieving scalability. Optimistic Rollups use a technique called "optimistic execution," where transactions are initially executed off-chain and then validated on-chain after the fact. This means that the Rollup chain assumes that all transactions are valid and only enforces the validation rules if someone disputes a transaction. If a transaction is disputed, the Rollup chain can revert to the previous state and try again.

On the other hand, Arbitrum uses a technique called "optimistic roll-in," where the Rollup chain periodically sends a summary of its state to the main Ethereum network. This summary is called a "proof-of-inclusion," which allows the Ethereum network to verify the Rollup chain's transactions and update the main network's state accordingly.

In terms of their benefits, Optimistic Rollups have been around longer and have a more mature ecosystem of developers and applications. However, they can have longer latency and higher gas costs, since every disputed transaction needs to be rerun on-chain. Arbitrum, on the other hand, has a faster response time and lower gas costs since the verification process is done periodically rather than on a per-transaction basis. However, it is still a newer technology and may have less developer support and fewer applications available.

Overall, both Arbitrum and Optimistic Rollups are promising Layer 2 scaling solutions for Ethereum, and which one to use may depend on specific use cases and application requirements.