The Eve of Layer2 Explosion: An Overview of Mainstream Rollup Solutions and DeFi Application Progress
This article was published by Blockchain Study Society, author: Jing Kai.
Layer 2 is one of the clear development trends in the crypto community in 2021, and which Layer 2 technologies popular DeFi projects choose for scaling has garnered close attention from the industry. This article summarizes the latest developments of Layer 2 on Ethereum and the scaling progress of popular DeFi projects, providing readers with a relatively accurate understanding of the current Layer 2 advancements.
Despite recent concerns in the market triggered by the rise in long-term U.S. Treasury yields, which cast a shadow over the cryptocurrency market, causing Ethereum's price to pull back from over $2000 to below $1500, transaction fees on Ethereum remain high.
As shown in the figure below, data from Etherscan indicates that a typical ERC20 token transfer currently costs around $9, equivalent to a KFC family bucket. Meanwhile, a transaction on Uniswap costs about $27, enough to buy four ten-inch Sultan King durian pizzas.
Rollup is the Focus of Scaling
In a recent article by DeFiPrime, various options for Ethereum scaling were summarized.
Although there are many other options for scaling Layer 2 solutions besides Rollup, such as Plasma, state channels, Sidechain, and Commit-chain, the Rollup-focused scaling direction set by Vitalik Buterin last year appears to be a more realistic choice in the medium term.
How popular DeFi projects and protocols respond to user growth and the existing limitations of Ethereum, how they choose Layer 2 solutions, and how we, as DeFi users, can use them at this stage are the directions we need to focus on next. The article may inevitably miss some points and is only intended to spark discussion; readers are encouraged to provide feedback and additional insights.
Four Common Rollup Solutions
Optimistic Rollup
Optimism has implemented the ORU (Optimistic Rollup) solution, attracting attention from Uniswap and Compound, and has received deep involvement from the synthetic asset trading platform Synthetix after its mainnet pre-launch. Optimism recently announced that it will launch its mainnet in March.
The Optimism solution creates the OVM, equivalent to the EVM runtime environment on Ethereum, allowing dApp developer teams to smoothly migrate L1 contracts to Layer 2. It is expected that Optimism's solution can increase TPS to over 20,000.
In addition to Synthetix, Uniswap also plans to use Optimism's solution for scaling, and there is currently a game version demo based on the Optimism network called Unipig. Compound is also expected to adopt Optimism's solution. From the current progress, Optimism should go live on the mainnet earlier than Zk Sync.
Readers interested in the Optimism architecture can refer to the following image.
Source: https://community.optimism.io/docs
ZK Rollups
Several projects have implemented the ZRU (ZK Rollups) architectural approach, including zkSync and Loopring.
Among them, the most noteworthy is ZkSync from Matter Labs, which has already launched its mainnet but has not yet provided a general solution. On October 10 last year, Matter Labs collaborated with the DeFi protocol Curve, which focuses on stable swaps, to launch the zkSync L2 smart contract testnet named Zinc Alef. Demo address.
This testnet supports the Zinc programming language, allowing smart contracts to run on the Zinc VM. Smart contracts deployed on this network can interoperate. However, existing contracts need additional effort to compile into versions that support the Zinc VM, as the Zinc programming language, according to the project's introduction, is not Turing complete and has some limitations. Matter Labs has stated that it will continue to improve Zinc to become a Turing complete language.
According to the summary, in addition to Curve, StablePay and GitCoin also plan to adopt Matter Labs' zkSync solution as a scaling option. SushiSwap mentioned in its January 2021 roadmap that it would use zk Rollups as its final L2 scaling solution. The Balancer protocol also stated that its only internal Layer 2 research expansion option is zk Rollups, but no further information on Balancer Layer 2 has been seen yet.
The Loopring protocol has been live on the mainnet for over a year, primarily focusing on trading (AMM, order book DEX). Additionally, the once-popular ZkSwap attracted attention with its airdrop token and other marketing actions.
Arbitrum
Another noteworthy solution is Arbitrum, created by Offchain Labs, which uses a similar implementation method to Optimism's ORU. It is still in the testing phase. The project team has provided several demos to demonstrate how DeFi operates on Arbitrum.
According to the project team, the teams developing and participating in the DeFi demo on Arbitrum include Bancor, Bounce, Burgerswap, Hop, MCDEX (the first project to migrate to Arbitrum), and Swapr. Additionally, the team has forked popular projects like Uniswap (called Arbiswap) and Balancer for demonstration purposes. Some project demo operations will be introduced later.
StarkEx
StarkEx operates similarly to zk Rollup, but under a Validium system architecture, data validation is handled off-chain, which improves processing capacity but sacrifices some security. Personally, I believe StarkEx can be loosely categorized under the Zk-Rollup type.
This week, the decentralized contract trading platform dYdX announced that it has launched internal testing on the Layer 2 network supported by StarkEx, currently offering perpetual contract trading for three trading pairs: BTC/USD, ETH/USD, and LINK/USD.
The DeFi community has responded positively to this. DeFiant believes that dYdX's move sends a positive signal, indicating that Ethereum's scaling solutions have matured enough to support large DeFi protocols like dYdX, providing users with a faster and cheaper trading experience.
Other projects that have decided to adopt StarkEx include the DeFi aggregator Paraswap and applications like DeversiFi.
Will Layer 2 Solutions Issue Tokens?
This is a question that many people are concerned about. According to information compiled by the media outlet "Deep Tide TechFlow":
Matter Labs founder Alex Gluchowski stated that zkSync will issue a governance token.
Offchain Labs (the team behind the Arbitrum solution) will follow up with a token issuance.
Starkware will also follow up with a token issuance.
This month, Optimism just announced that it has secured $25 million in Series A funding led by a16z crypto venture capital, and plans to publicly launch its mainnet in March. Although there is no clear information, in my view, it is only a matter of time before Optimism issues a token.
If the issued token has an airdrop plan to incentivize users to migrate to the Layer 2 network, starting to pay attention to and use related DeFi applications now will increase the chances of receiving an airdrop. Of course, some projects have not officially launched yet, so risk management is naturally an essential task.
Scaling Choices for Popular DeFi
As mentioned above, Optimism, Zk Sync, Arbitrum, and StarkEx are currently the most common Layer 2 solutions. Next, we will summarize the Layer 2 solutions adopted by several DeFi applications from the project perspective, and if a project already has a demo or has gone live, we will list the corresponding examples. Please note that the following descriptions only indicate the status of Layer 2 solutions.
Uniswap: Undecided
When the Uniswap V3 version will go live is currently unknown. Based on the limited information available, we might expect to see the integration of Layer 2 solutions in the V3 version, but this remains speculative. Many speculations about Uniswap's scaling solution point to Optimistic Rollup. Uniswap's founder Hayden Adams stated that the V3 version "solves all problems."
Unipig is an early demo developed by the Uniswap + Optimism (or the former Plasma Group) team, showcasing an example of Uniswap + Layer 2 (Optimism implementation) example.
However, based on my testing, Unipig has not continued operations and has completed its historical mission; Unipig's Twitter has also remained inactive since October 2019.
What scaling solution will Uniswap adopt? Which will prevail, zk Sync or Optimism? To be honest, there is still no conclusion. Considering that Optimism's Ethereum mainnet is set to launch next month, I hope we can get answers sooner.
Synthetix: Live, Using Optimism Solution
Currently, the Optimism mainnet is in trial operation and is scheduled to launch publicly next month, while Synthetix is one of the earliest adopters and is currently the almost sole entry point interacting with the Optimism Ethereum network.
In the 2021 roadmap article, Synthetix's founder mentioned:
Transitioning to Optimistic Ethereum (Layer 2 scaling solution) will alleviate many issues we faced in 2020. This transition has two main advantages: lower gas costs and higher throughput. Lower gas costs benefit all users and make the system more efficient. Higher throughput will reduce oracle latency in our collaboration with Chainlink, enabling improvements through synthetic futures and many other protocols.
In previous articles, I introduced how to use the Synthetix Layer 2 version, and I will briefly repeat it here.
Synthetix provides incentives for users migrating to Layer 2. The following image shows that the current annualized yield for SNX collateral is 32.23%, with a total of 4 million SNX in Layer 2.
Log in using the MetaMask wallet, and if you have SNX in your wallet, you can click the upper right corner "2-deposit SNX" to transfer SNX from L1 to L2. This step is necessary for subsequent operations and has a delay of about five minutes. If there are any outstanding debts on L1, they need to be repaid first before proceeding.
Then, go to Mintr L2
Again, log in using the MetaMask wallet. You can perform operations such as minting, burning, claiming rewards, and withdrawing tokens.
Unlike the high gas consumption on L1, on L2, you only need to sign to confirm, and currently, there are no transaction fees as the project team covers them.
dYdX: Live, Using StarkWise Solution
dYdX has chosen the StarkWise solution to deploy its Layer 2 version of perpetual contract trading, which is currently in internal testing and has officially launched on the mainnet. As shown in the image above, you can submit an internal testing application through the project homepage.
After submitting a few days ago, I have not yet received an email notification, so I cannot present the actual operations to readers. The following image is a screenshot of the dYdX test version, which shows the same interface as the current one, supporting three trading pairs: BTC/USD, ETH/USD, and LINK/USD, with oracle services provided by ChainLink.
dYdX's announcement also demonstrates their determination to migrate perpetual contract products to Layer 2 and plans to close accounts on L1:
After the new product is publicly released, existing perpetual contract products will run in parallel with Layer 2. In a few weeks, L1 perpetual contract accounts will gradually terminate, and users will need to close their positions on L1 and then open new positions on Layer 2.
In the announcement, dYdX also stated their reasons for choosing StarkWise, considering the low migration costs and the ability to provide users with the best trading experience, while similar Optimistic Rollup solutions have not undergone practical testing, and the withdrawal time from Layer 2 to Layer 1 is too long, leading dYdX to turn to StarkWare.
According to the project team, the improvements brought by the zk Rollup Layer 2 solution mainly include: no gas fees, significantly lower trading thresholds (0.001 BTC, 0.01 ETH, and 1 LINK), and the realization of cross-margin trading, allowing for higher leverage, lower liquidation, faster oracles, and instant trade settlement.
Of course, different project teams have their own considerations, and dYdX's opinions here are for reference only; readers may want to compare for themselves.
Curve: Testing, Using zkSync Solution
Curve has adopted zkSync as its Layer 2 scaling solution, currently running on the Rinkeby test network, so please switch your wallet network to the Rinkeby test network when interacting.
Click the green button "connect wallet," and you will be redirected to the zkSync login page.
Log in using wallets like MetaMask, and you will be redirected back to the Curve L2 application. Next, send a tweet to obtain some test tokens (click the "get some trial tokens!" button to send a tweet), and you can participate in the testing.
Arbitrum Rollup
Finally, let's introduce several DeFi projects and demos using the Arbitrum Rollup solution, which is similar to Optimistic Rollup, compatible with EVM, and employs multi-round interactions to improve overall experience and efficiency. Although Optimistic Rollup and zk Rollup have received more attention, it is important not to overlook Arbitrum Rollup, as the Layer 2 track is still in its early stages.
According to project announcements, multiple project teams will adopt the Arbitrum solution. Currently, the teams developing and participating on Arbitrum include Bancor, Bounce, Burgerswap, Hop, MCDEX (the first project to migrate to Arbitrum), Augur, and Swapr. Arbitrum provides a portal dashboard listing these applications.
As the first project to migrate to Arbitrum, MCDEX mentioned their reasons in an article, summarizing them for interested readers:
Functionally, zk Rollup is a more ideal technical solution. However, although zk Rollup will support general EVM smart contracts in the future, the final product will take a long time to arrive, and the technical maturity and progress do not meet the requirements;
The decentralization levels of OptimismOVM and Offchain Arbitrum are comparable, both being good solutions;
However, considering on-chain costs, technical maturity (documentation, code, test networks for evaluation), developer friendliness, and sequencing models, MCDEX V3 chose the Arbitrum solution.
Next, let's see how to try various applications on Arbitrum Rollup. Supported wallets include: MetaMask, MathWallet, Portis, Fortmatic, WalletConnect, and Burner.
To experience applications on Arbitrum Rollup, there are a few preparations to make.
Set Up the Test Network
Arbitrum Rollup has launched its own test network. In MetaMask, select custom network and fill in the following parameters (https://faucet.arbitrum.io/):
Network Name can be set as desired.
RPC URL set to: https://kovan3.arbitrum.io/rpc
ChainID set to: 79377087078960
Claim Test Tokens
On the page, click the top prompt to go to the link.
After completing the test network configuration, you will see your address.
Click "Claim," sign in MetaMask, and claim some test tokens.
After a moment, you will see the test tokens credited, and you can proceed to testing.
Due to space limitations, I won't elaborate on the specific operational methods for the projects. Currently, you can check the list page for applications available for testing on Arbitrum.
Note that it is still in the testing phase and has not officially launched the mainnet.
Some examples are as follows:
MCDEX:
Bancor:
Arbiswap:
Conclusion
Layer 2 will be a battlefield of mixed competition this year, with various solutions emerging around Ethereum scaling and the respective alignments of DeFi applications, creating a combination of airdrop incentives + Layer 2 + DeFi that can sustain high interest for a long time.
This article focuses on the four types of Rollup solutions and summarizes the scaling options for several DeFi projects, such as Curve, Uniswap, Synthetix, dydx, Bancor, and Augur. However, due to the complexity of the information and the author's focus, it is inevitable that some points may be missed, and readers are encouraged to provide criticism and corrections.
The competition among Layer 2 projects will continue for a long time. As users and investors, participating from multiple angles and delaying our statements may be a more prudent choice. Of course, Layer 2 scaling will also come with several issues, such as security and interoperability, and we need to be patient, as this journey may not be short.