Alex, the head of ZKSwap development, talked about the project development process and the development opportunities of Layer 2 DEX.
Interviewee: Alex, ZKSwap Development Leader Interview & Writer: Alice Qu
“Running on the Layer 2 track, brand new ZK-Rollups+AMA mode, multi-stage test network…” Since the early days of the first phase of the test network, it has a lot of “hot spots” ZKSwap, take the layer 2 Dongfeng has become a strong competitor in the DEX Hundred Regiment Battle.
In order to have a deeper understanding of the project and to better grasp the market trends, we invited Alex, the head of ZKSwap development, to review the project, the status quo of DEX, the upcoming mainnet of ZKSwap, the potential development in 2021, etc. Topics were discussed, and the following is the core content of this interview.
ZKSwap’s “Half-Year Summary”
As the price of Ethereum continues to break through historical highs, the performance bottleneck of the Ethereum network has become increasingly prominent, and the high gas fee has become the biggest challenge for DEX. At present, the expansion and speed of Ethereum has become a top priority, and Layer 2 has naturally become the focus of everyone’s attention.
The ZKSwap project started in August last year. The outbreak of DeFi last summer made the ZKSwap team realize that with the development of DeFi, the Ethereum main chain will certainly not be able to support a large number of applications, so many applications will inevitably migrate to Layer 2. Therefore, the ZKSwap team believes that the development of ZKSwap is a step that came into being and followed the trend.
Alex said that although there are many Layer 2 products on the market, most of them are currently in the Demo stage and the user experience is relatively poor, and ZKSwap will bring a truly safe, efficient, and layer 2 application with a good user experience. .
Although only nearly 5 months have passed, the ZKSwap team has a deep foundation and a spirit of continuous innovation, which has laid a solid foundation for the future development of ZKSwap.
- Deep roots: The early development of ZKSwap is in Stealth Mode (Stealth Mode), but the ZKSwap team has accumulated many years in the blockchain industry. Many team members have joined the blockchain industry as early as 2013 and began to vigorously research in 2018 Zero knowledge proof. Therefore, the ZKSwap team has deep accumulation in the field of zero-knowledge proof and smart contract. There are currently about 20 team members. At the same time, the ZKSwap project is currently subject to the regulatory environment at home and abroad.
- Continuous innovation: The upcoming version of ZKSwap fully implements Uniswap on Layer 2, and the transaction capacity of ZKSwap is about 100 times that of Uniswap, while the gas cost is only 1/100 of that of Ethereum layer 1, which is an improvement in the application of Layer 2 in the entire industry Made a contribution.
ZKSwap difficult development process
At present, the circuit of Layer 2 is still in a very early stage. Although Vitalik himself has written a lot of Layer 2 articles, what he writes is only theoretical analysis and lacks practical experience. Even a lot of data in his articles are actually there. questionable. Therefore, in order to provide a useful Layer 2 system, ZKSwap needs to solve the problems of TPS, GAS fees and system scalability on Layer 2.
Alex stated that the following challenges were faced during the development of the testnet:
Low TPS performance:
- In the zk-Rollup-based solution, as the complexity of the implementation of the business increases, the circuit also becomes larger, resulting in fewer transactions in a block;
- Zero-knowledge proofs take a long time to generate.
In the face of the above two problems, ZKSwap has deeply optimized the relevant circuits for the AMM transaction scenario, so that a block contains more than 200 transactions. At the same time, the ZKSwap team customized the GPU accelerated version generated by the zero-knowledge proof for the PLONK algorithm. Therefore, when ZKsync’s TPS is lower than 10, ZKSwap’s transaction TPS can reach more than 100, achieving a 10-fold increase in TPS.
High GAS cost:
- High cost of transaction data on-chain GAS;
- The cost of verifying GAS on the blockchain state chain is high.
There are mainly two types of transactions on the transaction data chain: transactions initiated by L1 and transactions initiated by L2. ZKSwap uses off-chain storage for L2 transactions while ensuring the security of L1 transaction data. Therefore, all users can compare whether the transaction data in each block is consistent with the data on the chain at any time.
At the same time, ZKSwap optimizes the logic of block data on the chain, adopting multi-block aggregation verification technology for the first time, allowing multiple blocks to be verified only once on the chain. Through the above optimization, the GAS cost is greatly reduced, and the system has very large scalability, which can realize an infinitely scalable Layer 2 system.
The design and update of the state tree under the chain:
- The number of accounts supported and the number of tokens;
- AMM status update;
- Circuit scale.
Based on a deep understanding of AMM’s state update logic, the ZkSwap team adopts a unique token design, which can support larger accounts and the number of tokens, while maintaining a certain circuit scale.
Of course, these development results of ZKSwap are not achieved overnight, but are slowly explored through the process of opening iteratively updated testnets to users, collecting and solving the problems encountered by users in the experience. If you don’t accumulate steps, you can’t reach a thousand miles. The original intention of ZKSwap is to create an infinitely scalable Layer 2 DEX for users that is truly suitable for user transactions.
Summary of the development of DEX
The development of DEX has also gone through several stages. As a very early practitioner in the industry, Alex, on behalf of the ZKSwap team, made the following summary:
In the first stage (2013-2015), there were only a few DEX products in the industry, including BTC-based decentralized exchanges of colored coins, BitShare-based DEX and NXT-based decentralized exchanges. This period More are based on the early exploration of the industry, and they are all DEXs in the order model. The reason for not developing should be the industry too early, no assets and no users.
In the second phase (2015 to 2019), there are some Ethereum-based DEXs in the industry, including IDEX and EtherDelta. With the development of Ethereum smart contracts, there are many smart contract-based DEX orders appearing, and a few Users’ needs for fund security and secret transactions have not brought fundamental changes to the industry.
In the third stage (2019 to present), the rise of the AMM model represented by Uniswap has had a huge impact and promotion on the blockchain industry. Unlike the order model, the essence of the AMM model is: liquidity is deposited to Inside the pool, and fluidity is not easy to lose. The AMM model is indeed an innovation of the trading model, which has brought some subversion to the trading market, which should have just begun. But Layer 1 Uniswap has a huge ceiling: transaction capacity and transaction cost issues, these two problems are unsolvable on Ethereum Layer 1.
The ZKSwap team believes that the fourth stage of DEX is Layer 2’s AMM DEX. Based on ZK-Rollup technology, DEX’s financial level can achieve the same security as Layer 1, but the transaction capacity and transaction efficiency are more than 100 times that of Layer 1. Instead, the cost is only 1/100 of Layer1.
Therefore, ZKSwap as the next generation of DEX products is relatively advanced. The team further pointed out that whether it is asset type or final trading volume, DEX based on the AMM model will inevitably surpass the centralized exchange (CEX), which is the trend of the times.
However, the current DEX is also facing the challenge of regulatory impact. Compared with the strict KYC mechanism of CEX, there is no clear regulatory measure on the DEX at present, and if the user directly interacts with the contract, it is very difficult to prevent it technically.
ZKSwap “Market Competition” on Layer 2
Alex said that when the team realized that Layer 2 is a huge opportunity, and with the help of deep accumulation and comprehensive evaluation in the field of zero-knowledge proof in the past few years, it finally chose the ZK-Rollup-based solution as the foundation of Layer 2.
Refer to the figure above, even if it is the same technical route, different solutions have huge differences. In the short term, the ZKSwap team is still optimistic about the solutions to ensure fund security through zero-knowledge proofs, such as zkSync, Loopring and starkware, etc., which provide financial security. However, other solutions, such as the technical route of Optimistic Rollup, still have problems in capital efficiency and safety in the short term, which is why the team did not choose other Layer 2 solutions.
Started with zkSync
The original ZKSwap solution was based on the zkSync framework, but during the development process, the ZKSwap team found that zkSync had many problems: currently only supports transfer services, does not support swap transactions, and low TPS (the code is currently public, and the TPS of Layer 2 should be 10 or less) and there are still more expensive Gas fees on Layer 2.
Therefore, in the subsequent development process, the ZKSwap team only reused the open source code of zksync in the Layer 1 contract. In the Layer 2 solution, the team did independent technical development to achieve high TPS and low gas costs.
Optimized in ZK-Rollup
Currently, ZKSwap has implemented transfer and exchange functions (Swap), while some other Layer 2 applications such as zksync and Hermez only support transfers. On the basis of ensuring the safety of funds, the difference between ZKSwap and other Layer 2 DEXs lies in the scalability of the Layer 2 system.
The scalability of the Layer 2 system depends on two factors, TPS and on-chain cost, which are mutually restrictive. At present, ZKSwap is a solution based on ZK-Rollup, but has made a little optimization in terms of data availability: all data interacting with Layer 1 is uploaded to the chain, and only the data that occurs in Layer 2 adopts the off-chain solution, and the data is summarized chain. Through this optimization, the gas cost of ZKSwap is 1/10 of the pure ZK-Rollup solution, and the scalability of the system can be greatly enhanced, and the funds are still safe.
The advantages of ZKSwap
In addition, the team believes that the current zero-knowledge proof verification system developed by ZKSwap should be the largest-scale zero-knowledge proof system with the fastest TPS. Based on the team’s in-depth optimization of the Plonk algorithm, the current zero-knowledge proof system’s TPS can reach more than 100, which also means that the entire ZKSwap system can handle nearly 10 million transfers and swap transactions every day. According to the team’s evaluation of other market solutions, most of the current Layer 2 solutions are subject to the calculation speed of zero-knowledge proof, chain restrictions, and system TPS less than 10.
On the whole, ZKSwap not only did in-depth exploration of the industry in the direction of Layer 2, but also made a lot of innovations in engineering implementation, including the GPU optimization of the Plnk algorithm, the aggregate transaction of zero-knowledge proof, and the scalability of the system. The results have a positive effect on the entire blockchain industry. With the launch of ZKSwap on the Ethereum mainnet, I believe it will surely lead a wave of Layer 2 DeFi.
The number of users is an important indicator of DEX
Transaction volume is very important to ZKSwap, but the size of transaction volume will eventually return to the issue of the number of users. ZKSwap hopes to see through the improvement of user experience, attract more users to ZKSwap for transactions. To this end, Alex stated that ZKSwap will conduct a large-scale airdrop to Uniswap, Sushi and possibly more Dex users after it goes live, encouraging and attracting everyone to experience the DEX ZKSwap on Layer 2. At the same time, after the ZKSwap mainnet is launched, various community mining activities will be opened, attracting a large number of users to participate.
Towards the ZKSwap mainnet
According to the previous announcement, ZKSwap will launch the mainnet on February 8. Alex further stated that the team is still doing the final test according to the goal of launching the mainnet on February 8. According to the test results, the mainnet may be launched a few days earlier or later.
The security of the ZKSwap system mainly includes the security of Layer 1 smart contracts and the circuit security of Layer 2. At present, the team works closely with three audit teams to independently audit and test all the codes of ZKSwap, including focusing on the zero-knowledge proof field The audited ABDK team, Certik audit team, and SlowMist audit team, according to the audit team’s feedback, currently have all the requirements for the code to go online on the mainnet.
After the ZKSwap mainnet goes live, it will support the real-time free transfer and swap functions of ETH and ERC20 tokens on Layer 2, and the system TPS can reach 100 or more. Users can transfer and exchange Swap in Layer 2. 0 gas fee.
Alex said that the team plans to launch the first batch of ZKSwap transfers and Swap in 30 currencies, and will soon support more than 100 currencies, and finally open users to independent currency and add liquidity.
Economic model
When talking about the ZKSwap token economic model, Alex pointed out that tokens have two main functions. The first is an incentive plan, which includes incentive mechanisms for communities, users, and developers and ecology. On the other hand, it is to carry the value of the product and to amplify the value of the product with tokens. ZKSwap is also very happy to give all the value to the tokens.
ZKSwap issued a total of 1 billion ZKS tokens, of which 60% will be distributed to the community in the form of mining; 32% will be distributed to teams, consultants and investors; 8% will be used to incentivize developers and the ecosystem.
Recently, ZKSwap has fine-tuned the economic model, and will give users holding ZKS a 1:1 airdrop before the mainnet launch. The purpose of airdrops is to increase early circulation and reduce the proportion of early investors in circulation. The reason is that if airdrops are not carried out, after the mainstream exchanges are launched, the proportion of unlocked by early investors in the circulation is relatively high, which will have a relatively large impact on the price. Therefore, as the airdrop progresses, this ratio will be reduced. After the mainstream exchange is officially launched, the influence of early investors on the market will be weakened or eliminated. The team stated that the extra 40 million airdrops will be deducted from the proportion of community mining in the first year.
Looking ahead to 2021
Finally, we asked Alex to share his forecast for 2021. He expressed his confidence in ZKSwap, and this year is the most promising year for Layer 2.
ZKSwap planning
Alex said that after the ZKSwap mainnet is launched, he will cooperate with exchanges and wallet service providers: support ZKSwap’s Layer 2 standard, support all ERC20 free transfers (including stable coins, etc.), and support private transactions and private exchanges.
In the future, the team plans to abstract the technology behind ZKSwap, build a standard Layer 2 protocol, support more DeFi projects, and use ZKSwap technology to build future DeFi on Layer 2.
The future of Layer 2
The team believes that there will be multiple Layer 2 solutions coexisting in the future. Due to the high gas fee on Ethereum, all users will eventually use Layer 2 solutions. Therefore, the market size of Layer 2 will be at least 20%-30 of the Ethereum market value. %. The process of user migration from Layer 1 to Layer 2 is the process of Layer 2 value discovery.
There are two schemes for interaction between multiple Layer 2s. One scheme is that everyone returns to Layer 1 first, and then interacts. For example, ZKSwap supports Layer 2 LP token withdrawal to Layer 1, so its composability is the same as Layer 1. It’s the same. Another solution is that projects based on the same Layer 2 standard will slowly build a lot of composability. At present, there are already several project parties willing to use ZKSwap’s solution, then these projects can interact with each other. With the programmability of Layer 2 (supporting virtual machines or common modules), the composability and interactivity of Layer 2 solutions will also be greatly improved.