Some scammers will fool you and say that the side chain is a Layer 2 solution, and even more will advertise that their side chain is safer than Rollup. However, in the final analysis, this is just a very simple question: Who controls the export of funds? In the Rollup scheme, the export of funds is controlled and protected by the EVM of Ethereum Layer 1.
Original title: “Layer 2 Guide for Beginners”
Written by: Ali Atiia
Translation & Proofreading: Min Min & A Jian
In the cryptocurrency industry, whenever a bull market opens, there will be overwhelming false news. Many sidechain projects will mislead users into believing that they are justified Layer 2 scalability solutions. This article aims to explain to beginners what kind of blockchain is Layer 2. Therefore, in order to facilitate readers’ understanding, completeness and rigor are inevitably sacrificed.
Generally speaking, the Layer 1 block chain has higher security and liquidity, and the Layer 2 block chain relies on the Layer 1 block chain to provide it with security and liquidity.
If you are a beginner, especially a newcomer, please show me a simple example first.
Suppose you have 100 Dai on the Ethereum blockchain, and the same is displayed on your MetaMask. But how does Metamask know? Because it communicates with the Ethereum peer-to-peer network through Infura (Ethereum Node as a Service Provider). But what does it mean to have 100 Dai? It means that the Dai contract (software composed of code and data running on the Ethereum blockchain) has your address (as you can see in MetaMask), and the value displayed next to the address is 100.
Back to the question of how to distinguish whether the new blockchain is Layer 2. Suppose there is a new blockchain called Macau. For some reason (want to buy something, trade at a lower gas price, or get a certain experience), you want to transfer your own 100 Dai from Ethereum to the Macau chain.
How would you transfer this 100 Dai to Macau? Send an email to Vitalik’s Masternode and ask him to help you transfer? Of course not, you are actually sending your 100 Dai to another contract on the Ethereum blockchain , which is commonly referred to as a “deposit” contract (like the deposit window of a casino) (Translator’s Note: Actually it is in In the Dai contract, transfer 100 Dai from your account and then transfer it to another account; but as the author said, this is for ease of understanding).
- Step 1: Send 100 Dai to Macau’s deposit contract on the Ethereum blockchain.
The validators/miners of the Macau chain can see your deposit because they have been monitoring the Ethereum blockchain, especially Macau’s deposit contract. At this time, one of the validators/miners told others: “Hey! Come and see, everyone! A customer is here! Work hard!” Then he said to you, “Welcome, and I’m glad you can join us. These are your 100 synthetic Dais from the Macau block I just dug out/verified. I hope you have fun.”
- Step 2: You have obtained 100 IOUs (like casino chips) from Macau. With these IOUs, you can get back the Dai locked in your deposit contract on Ethereum. We call these IOUs Synthetic Dai (sDai for short).
The so-called “enter Macau” actually means that some Javascript scripts on a certain website you are on are communicating with Macau’s peer-to-peer network. This is like, when you borrow on the Aave website or trade on the Uniswap website, you “enter the Ethereum”: these front-end Javascript scripts create a loan/exchange transaction for you, and then notify your MetaMask. After seeing the gas fee, you babble for 5 minutes before you click “Confirm” to sign and broadcast your transaction. You are familiar with this 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 the same, because you only need to use MetaMask, not a dedicated wallet to sign the created Transactions (because blockchains such as Ethereum/BSC use the same address format and cryptographic signature mechanism).
- Step 3: Use 100 sDai on Macau for trading, liquidity mining, investment, etc.
Suppose you play Texas and double the principal of 100 sDai to 200 sDai (the extra 100 sDai is you won from your opponent, and they also locked a position in the Macau deposit contract on Ethereum Dai).
Attention, now is the most critical part 👏 :
At this time, considering security and liquidity (or don’t care about the gas fee of the thousand dollars), you want to get back the principal and interest and put it on Ethereum. If you can get back 200 Dai from the Macau deposit contract (again, this contract is on the Ethereum blockchain) anytime and anywhere, and no one can stop you (only if these two conditions are met), Macau is Layer 2 blockchain🎉🍾.
If in theory Macau’s validators can prevent you from retrieving 200 Dai, or steal them directly (take it yourself), Macau is not a Layer 2 blockchain, but a side chain🤮.
If in theory you can withdraw more funds (such as 300 Dai), Macau is not a Layer 2 blockchain.
When we talk about scalability solutions, we always return to the question of “who controls exports”?
How to make the deposit contract on Ethereum smarter to prevent you, other Macau users and Macau miners/validators/operators from cheating?
As you can imagine, this is not an easy task, because it requires the deposit contract to be able to understand the flow of funds on Macau in real time: Assuming that you win 100 sDai at Macau 1 hour ago, you can withdraw 100 Dai to the ether On the square, but you may lose the money in the next game! Therefore, the contract needs to be able to understand all these conditions, as well as the latest status of Macau.
Early solutions such as State Channel and Plasma were to program fraud statements and dispute resolution logic into the deposit/withdrawal contract on Layer 1 . However, they all impose a heavy burden on users, such as:
Users must always monitor the Layer 1 contract on Ethereum online to challenge/stop/punish malicious withdrawals that threaten their assets.
The user must store the data necessary to raise a dispute. In the state channel [1] scheme, this data is usually the counterparty’s signature to prove the state change in the channel (for example, “Alice: I promise to pay 10 Dai to Bob” or “Charlie: I promise to move the car to H5 on the chessboard”).
Only for Plasma: Users are susceptible to two aspects: (a) The amount of data that needs to be stored increases greatly, because the data required by users is part of the global state of the Plasma chain, not just the data of the counterparty of the state channel [2], (b) Data withholding attack, that is, Plasma operators (block producers) try to make malicious withdrawals while withholding the data required by the user to initiate the challenge. This further increases the complexity of the security logic for withdrawals on Layer 1.
It wasn’t until the Rollup program appeared that these thorny problems were really solved. Rollup requires that all data needed when users log out can be obtained on Layer 1. Whenever the state on Layer 2 changes, the Rollup operator will disclose 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: introductory , advanced , advanced (zk-rollup) and advanced (optimistic rollup) .
The Rollup scheme uses mathematical methods (ZKRU) or cryptographic currency economy (ORU) guarantees to ensure that all relevant parties are honest. If the rollup operator disappears or starts messing up [spamming, censoring, or (in the Optimistic Rollup scheme) committing fraud], users can always use the data on Layer 1 to safely withdraw funds. These data are stored in the Rollup contract on Ethereum Layer 1, so the only thing users need to trust is that Layer 1 will execute these contracts honestly (other Layer 1 contracts also use the same trust assumptions, such as MakerDao MCD and Aave, etc.).
The end of the text 🤝.
* Remark 1: *
Other Layer 1 chains, such as NEAR, Polkadot, and CosmosHub, can also become Ethereum’s Rollup. They only need to create a bridge that adheres to the Rollup design pattern and publish the necessary data to Ethereum, just like other Rollups do.
Remark 2:
The ZK Rollup program uses a validity certificate to prove the correctness of the Rollup status update. Whenever the Rollup status is updated, the validity proof will be verified on Layer 1. Therefore, this type of program can prevent fraud. However, the data still has to be published on the chain. In this way, if the Rollup operator disappears, users can still use the data to submit withdrawal requests themselves.
Remark 3:
Can Bitcoin have Layer 2?
No way. Bitcoin lacks programming components and state pipeline systems, and cannot create complex Layer 1 contracts to handle disputes and/or verify validity proofs [3]. Of course, you may have heard the saying that there is no need to give up the ownership of the tokens to use the Bitcoin sidechain. Don’t believe these false marketing[4]
“What about the Lightning Network?” The Lightning Network is only L2 in theory. But in fact, ordinary users almost have to trust a third party to monitor the entire system (for the reason, see the section on the state channel above), which means that it is not L2 in practice.
Rollup is the only Layer 2 scalability solution that can guarantee users peace of mind, because the export of funds is firmly controlled by Ethereum Layer 1.
Speaking back to the side chain :
If Rollup is so magical, why would anyone choose to create a sidechain that (a) requires additional trust assumptions and (b) has not been recognized by the market for the past 7 years[5]?
The side chain is lingering because this type of scheme is easy to construct . Many project parties just construct a side chain hastily, they can use venture capital investment 🤡, and then issue tokens[6].
In fact, you can build an Ethereum sidechain in just one afternoon: you only need to build a smart wallet-like basic contract on Ethereum to allow people to deposit funds, and then fork Geth (for your Select a new chain ID for the side chain and rebuild it)…voila! This is not enough… well, it’s almost… you have to hire some navy, and then ask a graphic designer to design a tall website… but many venture capital institutions must be happy to help you. They can deploy a large number of robots.
Some scammers will fool you and say that the side chain is a Layer 2 solution, and even more will advertise that their side chain is safer than Rollup. However, in the final analysis, this is just a very simple question: Who controls the export of funds? In the Rollup scheme, the export of funds is controlled and protected by the EVM of Ethereum Layer 1.
Key points of this article :
At present, any chain that claims that TPS exceeds 2000 and uses scalability projects as a selling point is likely to be a side chain, requiring users to make some undisclosed trust assumptions.
After the ETH2 data shard is online, Rollup’s TPS may reach more than 10,000. This type of program has a great demand for data.
Rollup is the only Layer 2 scalability solution that does not require users to make additional trust and/or liveness assumptions.
The side chain exists so far because this type of scheme can be constructed within an hour, usually to raise funds and issue tokens.
Before using a chain, check the export of funds and the trust assumptions you must make to (a) ensure that the chain is safe, and (b) you can safely retrieve the funds. Project parties usually use a lot of marketing rhetoric and absurd arguments to conceal the safety trade-offs that the project makes to improve performance.
Other Layer 1 chains can act as Ethereum’s Rollup. They only need to follow Rollup’s design model and publish the necessary data on Ethereum.
Layer 2 without liveness assumption cannot be built on Bitcoin because it lacks the necessary programming elements and state pipeline system to obtain Layer 1 security.
| Pros | Disadvantages | Is it Layer 2?
—|—|—|—
Plasma | Throughput (General Computing) | High client data requirements, withdrawal waiting period, liveness assumptions, data withholding attacks from operators | Technically yes, but in fact not
State channel | Speed, low client data requirements | Liveness assumption, withdrawal waiting period, low capital efficiency, general calculations are difficult/unachievable | Almost yes
Optimistic Rollups | Protected by Layer 1 | Withdrawal waiting period, large data space demand | Yes
ZK Rollups | Protected by Layer 1 | Large demand for data space | Yes
Sidechain | Not Applicable| Needs Escrow| No
The “Disadvantages” column reflects the existence of problems through different colors (that is, how far we can avoid these problems through design). For example, Rollup’s data requirements can be easily met (as planned by Ethereum 2.0 and LazyLedger and other “data availability as service providers”) without sacrificing decentralization, because data is “cold”, ie , Full nodes will not execute Rollup data, and the cost of disk space is very 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 pledged a sum of Dai on Ethereum, opened a state channel with a group of friends to play poker, and then began to exchange information to update the game state, such as “I fold the card, and use this cryptographic signature as proof”. After the game is over, you can submit the latest snapshot of this round of Texas to the contract on Ethereum, and then withdraw your balance. The same is true for payment channels and chess channels. Although the state channel scheme can eliminate the risk from malicious sidechain operators, users still need to be vigilant to prevent counterparties from attempting to initiate withdrawals using outdated valid states. Therefore, withdrawals usually have a waiting period for other participants to verify their validity and initiate challenges. For example, if you request a withdrawal and submit a valid proof to prove that you have won, other players may challenge you to survive the fake proof using the game result you recently lost to them and submit it to the contract.
2: Taking Plasma Cash as an example, users will inherit and must store the complete transaction record of each token they receive, which takes a lot of time.
3: You can think of it this way: EVM can provide you with basic materials, allowing you to “3D print” any objects you are interested in; Bitcoin scripts are like Swiss army knives (thanks to Vitalik Buterin) and can only be used for limited purposes .
4: Nic Carter who spoke in this episode is not an investor in this side chain, but Nic Carter sponsored his podcast.
5: Centralized exchanges are indeed side chains, and they are very popular. The user’s funds are not sent to the “deposit contract” as mentioned in this article, but to an address under the control of a centralized exchange. However, centralized exchanges did not advertise themselves under the banner of “scalability solutions.” Users know that depositing funds in centralized exchanges requires trust.
6: Of course there are exceptions. The xDai sidechain is very popular in the Ethereum community, especially suitable for small payments and fast experiments. However, the xDai team and community will never conduct false propaganda to cover up the truth about the security trade-off issue to users.
Source link:gourmetcrypto.substack.com