As you all know, in the Ethereum ecosystem, the biggest challenges at present are low throughput, high gas fees and delays. Although public chains such as Polkadot and NEAR claim to be able to solve such problems. But there is no sign of challenging the ecology of Ethereum. Ethereum 2.0 is still far away at present, so in this gap period, the Layer 2 solution proposed earlier can be said to be born at the right time and develop rapidly.
secondary title
what is layer2? What is Rollup?
To give an inappropriate example, we can regard Ethereum as the central bank, and layer 2 is the main commercial bank, Gongnongjianzhong, all monetary assets are issued and settled at the central bank, and the circulation process can occur at the central bank at the same time and commercial banks. Because if everyone goes to the central bank for settlement, there will be business congestion, so there are other commercial commercial banks to process a large amount of business first, and then settle the overall business results with the central bank, so that they can operate more efficiently. Therefore, for the above problems of Ethereum, the solution can be to deposit the assets of Ethereum into layer2, and its assets flow on layer2, but the final settlement is done on Ethereum.
Another question is about the expansion of the blockchain network. We can compare it to the complexity of the business handled by the central bank and commercial banks. It is easy for individuals to deposit and withdraw money, but we can compare it to a blockchain network that can handle complex corporate business. The problem of expansion.
There are two basic ideas for network expansion: on-chain expansion and off-chain expansion.
On-chain expansion is called Layer 1 expansion, such as increasing the block size, speeding up the block generation time, etc., such as: EOS, ETH2.0, polkadot. It is equivalent to transforming the central bank so that it can meet the daily operation;
Off-chain expansion is called Layer 2 expansion. There are the above four technical solutions, but their essence is the same, which is equivalent to establishing a more reasonable commercial banking system.
Briefly describe the following four options:
First of all, the side chain, which is another blockchain connected to a blockchain, anchors the assets of the main chain to this new blockchain. Sidechains can be operated in many different ways, such as by a trusted third party, a consortium, or a consensus algorithm. The advantage is that the code and data are independent, without increasing the burden on the main chain; the disadvantage is that the security is weak. Currently, high-quality projects include skale, Injective, etc.;
Secondly, the state channel means that both parties to the transaction build a channel under the chain, and after signing with the private key, the transaction is carried out under the chain. State channels are less able to support unplanned large payments. It's like everyone puts money in a wallet under the chain for settlement, and you put 100 yuan, but suddenly there is a payment of 200 yuan, and it cannot be completed. In addition, the state channel does not support smart contracts. Current projects include Celer, Raiden, Liquidity, etc...
Furthermore, Plasma, the plasma chain, is actually a special side chain. Its characteristic is that it cannot be applied to smart contracts, and the burden on users to run nodes is relatively heavy. Projects in this area include: OMG, Matic, and Loom. Since the blockchain technology is very new, everyone is crossing the river by feeling the stones. It is also possible to explore or transform new technical solutions at any time. For example, the Plasma team later The Opimism.io team was derived, that is, the team that proposed optimistic rollup.
secondary title
On the failure of plasma, the rise of rollup
Before rollup, the main solution of layer2 is the side chain.
There are two main reasons why sidechains fail:
(1) Insufficient data availability
Data availability means that the side chain is not like the multi-nodes on the Ethereum, it is difficult to launch a 51% computing power attack. If you want to attack the Ethereum, you need to mobilize massive resources, but the side chain does not need it. Then, the data on the side chain can really Do you trust it? Node miners do not need a lot of resources to modify your data on the side chain, which directly affects the security of users' assets on Ethereum.
(2) Difficulty exiting
When users try to withdraw funds from the sidechain, they must submit an exit transaction request to the sidechain and then wait for a period of time. If a large number of users need to exit a Plasma sidechain, the entire valid state of the chain must be published to the Ethereum mainnet within a valid period. Due to data synchronization issues, it is almost certain that Ethereum will be overwhelmed by a large number of exits. This is the so-called batch exit problem.
secondary title
What are the two types of Rollup: ZK-rollup and Optimistic-rollup, and what are their advantages and disadvantages?
ZK in ZK-Rollup refers to zero-knowledge proof (Zero-Knowledge Proof), which means that the prover can convince the verifier to believe a certain conclusion without providing any useful information to the verifier is correct. For example, someone gave you a letter and wrote a conclusion on the envelope. The content of the letter is the process of proving that the conclusion is correct. The function of zero-knowledge proof is to judge that the conclusion is correct without opening the envelope to see the contents of the letter.
Back to ZK-rollup, we can see him as three parts, namelySmart contracts, intermediary operators and off-chain computations on the Ethereum network。
Smart contracts on the Ethereum main chainIt is used to keep the tokens to be traded. For example, if you want to buy LRC with ETH on Loopring’s exchange, you first need to transfer your ETH to a smart contract to lock it.
Off-chain computing partIt refers to the part of Layer 2 that processes transactions or calculations, and each transaction will generate a conclusion of zero-knowledge proof.
intermediate operatorResponsible for collecting and verifying the zero-knowledge proof conclusion of each transaction, and calculating the overall summary conclusion of this batch of transactions after packaging, and then sending the final conclusion to the Ethereum mainnet for verification.
At present, the development bottleneck of zk-rollup is that although there is not much summary conclusion data sent to the main network each time, the amount of calculation to calculate the summary conclusion through zero-knowledge proof under the chain is very large, which is only It is the transfer data. If the smart contract is integrated off-chain and the data is sent to the chain, the overall data volume will increase by several orders of magnitude, so it is very difficult to calculate this summary conclusion.
This is a basic form of zk-rollup, and the specific form of different projects may be fine-tuned.
Next, optimistic-ROLLUP optimistic rollup, optimistic-rollup is essentially a side chain with a special mechanism:
In the normal side chain, after we anchor the assets, the assets on the side chain will not be actively submitted to the Ethereum main network, and the anchor will only be released when the user makes a request to withdraw. We also talked about the disadvantages of sidechains earlier, and op-rollup is to add fixed rules to the basic structure of sidechains:
In order to solve data availability, add an intermediate operator to maintain the system, and develop a mechanism to ensure data trustworthiness.
In order to solve the difficult problem of withdrawal, op-rollup proposes to submit the side chain data to the Ethereum main network every seven days, so the data on each side chain is limited, and the side chain data is synchronized to the Ethereum main network at fixed intervals.
Optimistic literally means optimism, and he regards all participants as good people by default. It can also be disassembled into three parts as simple as zk-rollup: the smart contract on the Ethereum main chain, the intermediate operator (including side chain nodes) and off-chain calculations, and the smart contract on the Ethereum main chain is also used to keep The token to be traded.
The difference from zk-rollup is that after each confirmation transaction of the op-rollup solution, the intermediate operator does not perform a series of complicated verifications on the transaction results, but directly packs them and sends them within 7 days or a specific time After a certain time, it will be uploaded to the main chain of Ethereum. The intermediate operator not only acts as a carrier, but also as a supervisor. They will check and verify the data packaged by other operators. If any operator is found to be evil, he will report it and will The transaction is rolled back.
The advantage of this is that because the amount of uploaded data is relatively small, smart contracts can be integrated into Layer 2, which is also an important reason why it is favored by Defi leaders such as synthetix and uniswap.
But the disadvantage is also obvious, that is, the data will not be uploaded to the chain until 7 days or longer, so if you lock the token on Layer 2, you need to wait 7 days or longer to withdraw it.
Comparison of zk-rolllup and optimistic-rollup:
Finally, I will compare and summarize the characteristics of the two rollups:
1. zk-rollup is not completely incapable of running smart contracts, but the current efficiency is too low;
2. Regarding security, both have some hidden dangers that need to be overcome, for example, op-rollup may be more risky as the amount of funds increases, while zk-rollup requires a trusted third party;
text
This article only represents TopoBlock's personal views and does not constitute any investment advice or advice.
