A Layer 2 Guide for Beginners
Original source: Ethereum enthusiasts
In the cryptocurrency industry, whenever a bull market begins, there is a flood of false news. Many side chain projects can mislead users into believing that they are legitimate Layer 2 scalability solutions. This article aims to show beginners what blockchain is LAYER2. Therefore, completeness and rigor have to be sacrificed for readers' convenience.
In general, the Layer 1 blockchain is more secure and fluid, while the Layer 2 blockchain relies on the Layer 1 blockchain to provide security and liquidity.
If you are a beginner, especially a beginner, please follow me through a simple example.
Let's say you have 100 DAI on the Ethereum blockchain, and that's what your MetaMask shows. But how does MetaMask know? Because it communicates with the Ethereum peer-to-peer network via Infura (Ethereum Node as a Service Provider). But what does it really mean to have 100 Dai? It means that DAI contracts (software made up of code and data that runs on the Ethereum blockchain) have your address (as you see in MetaMask) and the number displayed next to it is 100.
Back to the question of how to tell if a new blockchain is Layer 2. Suppose there's a new blockchain called Macau. For some reason (want to buy something, trade at a lower gas price or get an experience), you want to transfer your own 100 DAI from Ethereum to the Macau chain.
How will you transfer the 100 DAI to Macau? Send an email to Vitalik's MasterNode to help you transfer it? Of course not, you're actually sending your 100 DAI to another contract on the Ethereum blockchain, commonly known as a "deposit" contract (like a casino's deposit window). But as the author says, this is for ease of understanding).
The Macau chain validators/miners can see your deposits as they are monitoring the Ethereum blockchain and specifically the Macau deposit contracts. At this point, one of the verifiers/miners tells the others, "Hey! Come and see, everybody! A client is coming! Get to work!" Then he said to you, "Welcome. Glad to have you with us. Here are your 100 synthetic DAI from the Macau block I just dug/verified. Hope you have fun."
"Entering Macau" is actually some JavaScript on your website communicating with Macau's peer-to-peer network. It's like when you borrow on the Aave website or trade on Uniswap, you "enter Ethereum" : these JavaScript scripts on the front end create the loan/exchange transaction for you, and then notify your MetaMask. When you see the gas fee, you buzz for five minutes before clicking "OK" to sign and broadcast your deal. You're familiar with the process.
Macau is the same. If MACAU is a fork of Ethereum (like Binance's BSC or Avalanche's C-Chain) then the whole process is actually pretty much the same as you only need to use MetaMask and you don't need to use a proprietary wallet to sign created transactions (since blockchains like Ethereum /BSC all use the same address format and cryptographic signing mechanism).
Let's say you play Texas and double your 100 SDAI to 200 SDAI (the extra 100 SDAI you won from an opponent who also locked up DAI in a Macau deposit contract on Ethereum).
Now for the crucial part:
At this point, because of security and liquidity (or because you don't care about the thousands of dollars in gas fees), you want to get your principal and interest back and put it on Ethereum. If you can get 200 DAI from a MACAU deposit contract (again, it's on the Ethereum blockchain) anytime, anywhere, and no one can stop you (only if these two conditions are met), MACAU is Layer 2 Blockchain.
If a Macau validator can theoretically prevent you from retrieving 200 DAI, or simply steal them (take them yourself), Macau is not a Layer 2 blockchain, but a side chain.
If theoretically you can withdraw more money (say 300 DAI), Macau is not Layer 2 blockchain.
When we talk about scalability solutions, it always comes back to the question, "Who controls the exit?"
How to make the deposit contract on Ethereum smarter to prevent cheating by you, other Macau users, and Macau miners/verifiers/operators?
As you can imagine, this is not an easy task, as it requires the Deposit Contract to be able to see where the money is going on Macau in real time: if you win 100 SDAI on Macau an hour ago, you can withdraw 100 DAI to Ethereum, but you could lose that money the next game! Therefore, the contract needs to be able to keep track of all of this, as well as the current status of Macau.
Early solutions such as state channels and Plasma do this by programming fraud claims and dispute resolution logic into deposit/withdrawal contracts on Layer 1. However, they all impose heavy burdens on users, such as:
It wasn't until the rollup solution came along that it really solved these tricky problems. Rollup requires that all data required for user exit is available at Layer 1. Each time a state changes on Layer 2, the rollup operator discloses the transaction data that caused the state change on Layer 1. Therefore, the execution on Layer 2 and the data update on Layer 1 are synchronized. If you want to learn more about Rollup, please read these articles: Introduction, Advanced, Advanced (ZK-Rollup), and Optimistic Rollup.
The ROLLUP scheme ensures that all relevant parties are honest through mathematical (ZKRU) or cryptographic money economy (ORU) guarantees. If the Rollup operator disappears or begins to misbehave [spammer, review, or (in the case of optimistic Rollup) commit fraud], the user can always use the data on Layer 1 to safely withdraw funds. This data is stored in rollup contracts on Ethereum Layer 1, so the only thing a user needs to trust is that Layer 1 will execute these contracts honestly (the same trust assumption is used for other Layer 1 contracts, such as MakerDAO MCD and AVE).
End of the text.
Note 1:
Other Layer 1 chains, such as Near, Polkadot and Cosmoshub, can also become Ethereum rollups. All they need to do is create a bridge that adheres to the Rollup design pattern and publish the necessary data to Ethereum, just like other Rollups do.
Note 2:
The ZK Rollup scheme uses validity proof to prove the correctness of Rollup state updates. Each time the rollup status is updated, the validation is verified on Layer 1. Therefore, such schemes can prevent fraud. However, the data is still posted on the chain. That way, if the Rollup operator disappears, the user can still use the data to submit a withdrawal request on their own.
Note 3:
Can Bitcoin have Layer 2?
I can't. Bitcoin lacks the programming components and state plumbing to create complex Layer 1 contracts to handle disputes and/or verify proof of validity. 3 . Of course, you may have heard that you don't have to give up ownership of your token to use a Bitcoin side chain, but don't believe the fake marketing. 4 .
"What about the Lightning Network? Lightning networks are L2 only in theory. In practice, however, the average user almost always trusts a third party to monitor the entire system (for the reasons described in the section on state channels above), which means that in practice it is not L2.
Rollup is the only Layer 2 scalability solution that can ensure that users are safe because the export of funds is tightly controlled by Ethereum Layer 1.
Back to the side chain:
If Rollup is so magical, why would anyone choose to create a side chain that (a) requires an extra assumption of trust and (b) has not been accepted by the market for the last 7 years? 5 ?
Side chains survive because such schemes are easy to construct. A lot of people just build up a side chain and they get VC money and they issue tokens. 6 .
In fact, in one afternoon, you can build an Ethereum side chain: all you have to do is build a basic contract on Ethereum like a smart wallet that allows people to deposit money and then fork out Geth (pick a new chain ID for your side chain and rebuild it)... Look! That's almost it... Uh, well, almost... You also need to hire a few sailors and a graphic designer to design a great website... But a lot of VCs will be happy to help you out. They can deploy a lot of bots.
Some scammers will trick you into thinking that side chains are Layer 2 solutions, or even advertise that their side chains are safer than Rollup's. In the end, however, it is a simple question: who controls the export of money? In the Rollup scenario, the export of funds is controlled and protected by the EVM of Ethereum Layer 1.
Main points of this article:

- The "Weaknesses" column reflects the existence of the problem in different colors (i.e., how much we can circumvent these problems by design). For example, Rollup's data requirements can be easily met (as planned by "data availability as a service providers" such as Ethereum 2.0 and LazyLedger) without sacrificing decentralization because the data is "cold" -- that is, full nodes do not execute Rollup data -- and the cost of disk space is low
Footnote:
1: If it is a state channel, there is no "Macau" chain at all, and users interact directly with each other. For example, you pledge DAI on Ethereum, open a status channel with a bunch of PALS, and then start exchanging messages to update the state of the game, such as "I discard my card, as proof of this cryptographic signature". When the game is over, you can submit the latest snapshot of Texas to the contract on Ethereum and withdraw your balance. The same goes for the payment channel and the chess channel. While the status channel scheme eliminates the risk from a malicious side chain operator, the user still needs to be vigilant in case a counterparty tries to initiate a withdrawal using an outdated valid state. Therefore, withdrawals usually have a waiting period for other participants to verify their validity and challenge them. For example, if you ask for a withdrawal and submit a valid proof that you won, other players may challenge you to use the results of your recent loss to them to survive the fake proof and submit the contract.
For Plasma Cash, the user inherits and must store a complete transaction history of every token they receive, which takes a lot of time.
3. Think of it this way: EVM will provide you with the building blocks to "3D-print" any object you're interested in; Bitcoin scripts are the Swiss Army Knife (thank you Vitalik Buterin) and can only be used for limited purposes.
4: Nic Carter, who spoke on this show, is not an investor in this side chain, but Nic Carter sponsors his podcast.
5: Centralized exchanges are really side chains, and very popular. Users' funds are not sent to a "deposit contract", as described here, but to an address controlled by a centralised exchange. However, centralized exchanges do not advertise themselves as "scalable solutions", and users know that they need to be trusted to deposit their money in centralized exchanges.
There are, of course, exceptions. XDAI side chains are very popular in the Ethereum community and are particularly suited to micropayments and quick experimentation. However, the XDAI team and community will never make false claims to hide the truth about security tradeoffs from users.
The original link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia