DeFi+Layer2 has become a trend, who is more popular in Layer2? What are the opportunities?

区块链研习社
本文约5754字,阅读全文需要约23分钟
Which Layer 2 solution did Synthetix and Uniswap use?

The DeFi battle is in full swing, and the leaders have opened up another battlefield. Top DeFi players such as Uniswap, Aave, and Synthetix have all started to explore the feasibility of Layer2 + DeFi. The reasons are obvious: Ethereum’s record-breaking gas fees, the status quo of blocking the network without paying attention, and more importantly, Ethereum Fang 2.0 is officially launched and available, and it will not fail for two or three years.

For DeFi applications, there are not many options: either choose other public chains for multi-line operations, or use Layer 2 on an existing basis. The former may be worth considering for new DeFi teams, but veteran DeFi players naturally prefer the Layer 2 solution: it is still a familiar operation, and the performance is improved several times, and users hardly need to learn anything extra.

So what is the Layer2 second layer solution? What Layer2 solutions are available? Let's take a look at the Layer 2 solutions that the leading DeFi projects have chosen.

image description

Source: Block123

The transaction processing capability of Ethereum is like a typewriter in the last century. If you are not careful, it will get stuck. In order to ensure that high-value transactions can be prioritized on Ethereum, the ordering of transactions is exactly the same as that of Bitcoin: the highest price wins, taking into account the history of transactions.

Ethereum adopts the gas mechanism. If the transaction volume is slightly larger, the gas fee will soar, and small transactions are no longer expected to be completed: often the handling fee of an ordinary transaction exceeds the transaction volume itself. This is especially true for transactions in DeFi. After all, performing an operation on Uniswap or AAVE involves higher complexity and higher handling fees.

Vitalik, the creator of Ethereum, once said on Twitter: "Project parties and users should migrate to the Rollup-type two-layer network as soon as possible, and this may be a trend in DeFi in the second half of the year." Vitalik also commented on other solutions, if only Token transfer transaction, LoopRing, OMG can also be used.

Problems exist objectively, but the solutions are different.

Ethereum 2.0 uses the PoW mechanism to migrate to the PoS mechanism to increase transaction throughput. Coupled with the fragmented transaction processing mechanism, it is expected to greatly improve the status quo. But the long distance can’t quench the near thirst. Ethereum 2.0 has been upgraded step by step, and now it’s not halfway there. When Ethereum 2.0 fully supports complex applications such as DeFi, your newborn cutie may be able to go to soy sauce.

The other way, Layer 2, is to build a second layer on the existing Ethereum network as an expansion solution, which has become a more practical and accessible option. Especially for DeFi, which is popular and eager to gain more users, the reality is in front of us: for giant whales, the transaction fee is just a luxury lunch; but for retail investors, the high fee is like a high wall blocking the way , which is daunting. This is also one of the reasons why DeFi, which started on Ethereum, is gradually overflowing to other public chains.

Layer2 is expected to add fire to DeFi with a smoother transaction experience and lower transaction fees. Of course, the Layer 2 solutions are not unified, and each solution has its own advantages and disadvantages, which all depend on the choice and balance of the project party. Now that you know what the Layer2 expansion plan is useful for, you might as well imagine yourself as the project party: the banquet is open, what can I order on the Layer2 menu? How each family tastes, you have to see it before you know.

Layer2 players, are you ready?

Since Layer2 is going to be useful, there must always be a distinction between which is better. This article starts with the requirements of DeFi applications for Layer 2, and sees what Layer 2 solutions are currently available.However, limited by the author's knowledge and vision, it is inevitable that there are too many subjective factors. Readers are invited to learn from and criticize and correct.

We start with a table.

image description

Source: MatterLabs, Chinese translation: Jing Kai

According to the above menu, assuming you are a DeFi creator, what type of Layer2 may be considered?

First of all, DeFi applications need to support smart contracts, preferably smart contracts with strong flexibility.

According to this,The two solutions of state channel (State Channel) and Plasma, if not necessary, will not be the preferred choice. Because they have limited support for smart contracts.

Second, the consideration of financial security.

DeFi is an asset-heavy application, which means that if the Layer 2 solution is to be competent, it must have better certainty and fewer risk factors. DeFi creators also have the spare power to continue to improve the security of funds in other aspects. Layer 2 often needs to use the verifier to act as an intermediary role, which brings the risk of a middleman. Does the verifier have the authority to freeze funds or even divide up user funds and run away with money? This is especially important for DeFi.

According to MatterLabs' evaluation, SideChain and Validum are more dependent on intermediate validators, and DeFi needs to be carefully considered when choosing a Layer 2 solution. According to the evaluation criteria listed by MatterLabs in the figure above, the potential risk of the side chain scheme is relatively high in terms of the danger of hot wallet leakage attacks and the risk of encountering attacks on the token design mechanism.

Some reviewers also believe that SideChain's side chain method cannot be regarded as Layer 2 strictly speaking. Although the sidechain solution has some possible problems, because SideChain is more flexible and has a wider scope, the specific security and practicality depend on the specific implementation.

It should be reminded that although MatterLabs lists several mainstream solutions, in the actual implementation, it is not either one or the other. For example, MaticNetwork is a Layer-2 expansion solution that combines Plasma and sidechain solutions.

According to a CoinDesk report on August 3, MaticNetwork created a $5 million DeFi incubation fund to attract DeFi projects to create solutions on maticNetwork, and has already attracted multiple DeFi projects. WazirX, India's largest exchange, created the AMM Swap DeFi project on Matic; based on Matic Network's Layer 2 DeFi lending agreement, there is also an example of EasyFi.

Third, the Layer2 solution will involve the issue of asset processing efficiency after all.

This falls under the usability category.The withdrawal time and whether the transaction can be confirmed instantly are two aspects worthy of attention.For the solutions of Plasma and Optimistic rollups, it can be seen from the table that the withdrawal time is expected to be longer. However, if a liquidity provider is introduced, the corresponding withdrawal time will be greatly reduced, and DeFi solutions usually have an LP design at present, so although the 1-week withdrawal time shown in the figure seems bizarrely long, it is only a theoretical prediction. It is only an estimate, and the actual time to realize it will be much less than this value.

Finally, we look at the performance aspect.

The reason why I put it at the end is not because performance is not important, but because this is a problem that must be solved by the Layer 2 solution, so the difference between each company is actually not that big. Whether based on ETH or ETH2.0, several Layer 2 solutions can be significantly improved. The indicators in this area are not very informative in excluding layer2 solutions. Of course, the evaluation perspective here is different, and Layer 2 is only viewed from the perspective of implementation.

To briefly summarize,With the help of the list summarized by MatterLabs, we initially evaluated different Layer 2 solutions from the perspective of DeFi project parties. On the whole, the solutions of zkRollup and OptimisticRollup are relatively more advantageous, while the two solutions of State Channel (State Channel) and Plasma will not become the preferred choice of DeFi due to their limited support for smart contracts.

Two schemes, zkRollup and OptimisticRollUp, are mentioned here and will be briefly introduced. We will see several DeFi projects using the rollup scheme later in this article.

Rollup can be thought of as a sidechain, as blocks are generated and snapshots are periodically sent to the main Ethereum chain.

The reason why Rollup is favored by many project parties is inseparable from its efforts in de-trusting: Rollup’s solution assumes that operators cannot be trusted, they will cheat, they will be lazy and drop the chain, or share Fork and other malicious behaviors, the Rollup scheme prevents this to avoid affecting the operation of the protocol. In addition, the important point is that as long as they can cooperate, the nodes or verifiers on Rollup can realize instant exit.

Due to limited space, we will not delve into the two solutions of rollup (zkrollup and OptimisticRollup), but let's take a look at how Vitalik thinks about it.

Vitalik's view on Rollup as a Layer 2 solution

On September 2, Vitalik discussed Ethereum's transaction supply and demand mechanism and some solutions to improve performance on Twitter. In Vitalik's view, transaction fees are high and can only be resolved through capacity expansion. There are two types of solutions to improve performance:

  • rollup scheme

  • Fragmentation mechanism

Tether, Gitcoin and other applications have chosen the zkrollup solution to improve performance. The upcoming Optimistic Rollup solution provides a more general solution because it provides comprehensive support for EVM contracts.

Optimistic and zero-knowledge prove that zkrollup can increase the performance by about 200 times by processing most transactions at Layer2, from 15tps to about 3000 tps. In this way, the gas fee on the chain will not be reduced, but since most transactions are in rollup, the actual fee paid by the user has been reduced hundreds of times. In the long run, the sharding mechanism of Ethereum 2.0 can improve performance and increase scalability.

Rollup: the preferred choice for DeFi projects

Above, we compared multiple Layer 2 solutions, and focused on the analysis of the Rollup ( zkrollup, Optimistic rollup ) solution. Theoretically speaking, rollup wins in many schemes, and from Vitalik's point of view, he himself is optimistic about the Rollup scheme as a realistic choice for Ethereum expansion.

Next, let's take a look at how the current hot DeFi projects, such as Uniswap, AAVE, Synthetix and other projects, plan to apply the Layer 2 solution to improve performance.

Synthetix's layer2 solution: Using Optimistic Rollup, the test network enters the first stage

Synthetix is ​​the first synthetic asset management and trading platform on Ethereum. Recently, Synthetix has cooperated with the Optimism team to promote the application of Optimistic Rollup on the Synthetix platform and create a Layer 2 solution to bring a better user experience. Specifically, the bottom layer relies on the OVM (Optimistic Virtual Machine) created by Optimism as a virtual machine that supports all Layer2 protocols.

On September 25th, Synthetix launched the Optimistic testnet of the Ethereum Layer 2 expansion solution, and users can conduct fast transactions on the Layer 2 network. Stakers with 1 to 2500 SNX can be eligible to participate in the test and receive rewards. SynthetixDAO will provide 50,000 SNX every week as a mortgage reward for participating in the testnet, and the reward distribution will last for a total of 4 weeks.

According to Synthetix's blog, using SNX on OE (Optimistic Etherum, that is, the side chain adopting the Optimistic Rollup scheme) is a key step for the rapid development of the DeFi ecosystem to achieve full scalability, allowing anyone around the world to Use DeFi without high gas costs.

In short, Synthetix uses the Optimistic Rollup solution to achieve Layer 2 expansion, and it is making good progress. The current stage, call it: Fomalhaut. At this stage, the purpose is to test and reduce the cost of receiving rewards for SNX small stakers. The second upgrade called Deneb is expected to be performed on September 29 to reduce gas costs.

Unipig: When Uniswap meets Layer 2 expansion plan

Uniswap is working on its V3 version. Hayden Adams, the founder of Uniswap, said on Twitter that V3 will "solve all problems." Some commentators believe that Uniswap V3 will implement the Layer 2 solution. However, there is no official introduction on this.

As a sample demo of Uniswap Layer2, Unipig's solution has already been launched in October 2019, showing the basic operation of Uniswap + Layer2. See address: https://unipig.exchange

Unipig, like Synthetix, also adopts the Optimistic Rollup scheme expansion, demonstrating the possible UX improvement using Layer2. It was jointly created by Uniswap and Plasma Group.

In the current Demo, Layer 2 deposit and withdrawal functions are not implemented. Instead, let users participate in it by airdropping test tokens. Unipig has a statistics page that lists the performance improvements brought about by the current Demo adopting the OR scheme:

AAVE: Layer2 will be adopted, but the details are not yet known

AAVE is a popular asset lending DeFi platform on Ethereum, and it is currently ranked among the top. Last month, AAVE stated that the interest-bearing token "aTokens" (used to represent encrypted mortgage assets on the platform) obtained by users' mortgage assets on its platform will integrate Ethereum Improvement Proposal (EIP) 2612, so that authorization can be achieved without consuming gas .

In DeFi applications on Ethereum, it is often necessary to initiate a transaction authorization in advance before allowing the next operation. And AAVE also stated that the team is actively researching to introduce aToken into the Layer2 solution.

Compound: consider moving to Layer2 or other public chains

According to the block rhythm report, on August 21, David Kajpust from the Graph team said on Twitter that Compound is secretly considering transferring to Layer 2 or other public chains because the Gas fee is too high.

So far, no further reports have been seen showing what kind of plan Compound will take. However, the EasyFi mentioned above, as an imitation of Compound, can be used as an example to show what kind of experience Compound + Layer2 will have.

According to the EasyFi blog, EasyFi is a general-purpose second-layer digital asset lending protocol. A DeFi system built on the Matic network. The Matic network went live on May 31, 2020, using Plasma as a scaling solution. EasyFi's goal is to focus on credit protocols that allow borrowers easy and reliable access to all types of credit assets.

When EasyFi started, V1 was created as a fork of Compound Finance, from the Ethereum main chain to the Matic network, realizing a mortgage-backed loan agreement combining Layer 2 schemes.

Curve: Layer 2 solution will be adopted in the future

On August 17th, Charlie of the Curve team mentioned in replying to netizens in the telegram group:

summary

summary

From the analysis of several leading DeFi projects in this article, it can be seen that it is only a matter of time before DeFi projects adopt the Layer 2 solution. Although we have not seen the whole picture, after comparing multiple Layer2 expansion schemes, we can draw a preliminary conclusion from various considerations. Optimistic Rollup (or zkRollup can also be considered among them) scheme may become a DeFi that adopts Layer2 scheme Item preferred.

The important role of Layer2 is indispensable in the midfield battle of DeFi. What are the potential investment opportunities in each Layer2 scheme? May wish to leave it as an open topic to discuss together.

The upgraded version of DeFi Investment Training Camp 2.0 is launched

Disclaimer: This article is the author's independent opinion, and does not represent the position of the Blockchain Institute (public account), nor does it constitute any investment opinion or suggestion.

Disclaimer: This article is the author's independent opinion, and does not represent the position of the Blockchain Institute (public account), nor does it constitute any investment opinion or suggestion.