As DeFi protocols evolve, more people are flocking to decentralized exchanges, particularly those striving for efficiency. This guide explores one such exchange, ZKSwap, which uses ZK rollups to boost user experience. Read on to find out how ZKSwap works and what benefits it offers.
KEY TAKEAWAYS
• ZKSwap is a decentralized exchange using ZK rollups to enhance scalability and user experience.
• ZK rollups enable ZKSwap to process transactions off-chain quickly. By doing so, it reduces gas fees and delays.
• ZKBase (ZKB), previously ZKS, is the native token of ZKSwap. It is used for staking, governance, and rewarding community mining.
• While ZKSwap offers fast transaction speeds and low gas fees, its complexity and unproven long-term viability remain concerns.
What is ZKSwap?
ZKSwap is an automated market maker (AMM) Ethereum-compatible decentralized exchange that uses zero-knowledge (ZK) rollups. It is part of the ZKSpace layer-2 protocol, which also includes the NFT marketplace, ZKSea, and ZKSquare, the payment service provider.
L2 Labs Foundation launched the mainnet of ZKSwap in February 2021 to solve Ethereum’s scalability issues. Five months later, it rolled out version two of its mainnet, offering users more features through the update.
ZKSwap grew rapidly after its mainnet launch in February. By July 2021, it had reached $11.5 billion in total trading volume and 87,000 registered users.
The lead developer at L2 Labs, Alex Lee, has experience in smart contract development and zero-knowledge-proof research. Lee leads a team of experts dedicated to the development and success of the protocol.
During the mainnet launch, L2 Labs secured $1.7 million in an angel round led by Bixin Capital, FBG Capital, SNZ Holding, and Longling Capital, the company announced on Nov. 24, 2020.
How does ZKSwap work?
ZKSwap is based on ZK rollups, a layer-2 solution that helps scale layer-1 blockchains. This solution enables the DEX to move transactions off-chain to achieve fast processing. Afterward, the roll-up creates zero-knowledge proofs called ZK-Snarks and submits them to layer-1 for ultimate verification.
DEX components
ZKSwap consists of several components, namely, on-chain smart contracts, an off-chain server, and the zero-knowledge proof system. The protocol has deployed smart contracts on Ethereum, linking layer-1 to the off-chain ZKSwap server. These smart contracts store tokens and record and verify layer-2 updates and proofs.
On the other hand, the ZKSwap server processes all transactions off-chain. It includes a mempool, swap engine, block proposer, stakekeeper, committer, and prover server.
Here’s how it works:
- The protocol first sends valid transaction requests to the mempool.
- The swap engine processes these requests.
- Next, the block proposer rolls up the transactions and produces a new block.
- The state keeper updates the status of the layer-2 network and sends this updated state to the committer.
- The committer then communicates with the prover server to obtain proof of the corresponding transactions.
- The committer sends the proofs and the network state to the ZKSwap smart contracts on Ethereum.
- Finally, ZKSwap generates proofs using the zero-knowledge proof algorithm known as PLONK.
Adding & removing liquidity
Users can become liquidity providers (LPs) on ZKSwap by depositing tokens to an existing pool on layer-2. Alternatively, they can create a new liquidity pool for a pair of digital assets.
Liquidity providers receive LP tokens in return for providing liquidity to a pool. Moreover, they also earn 0.25% of the transaction fees that traders pay to the protocol.
When LPs decide to remove their liquidity, the protocol burns their LP tokens, allowing them to withdraw their original deposits.
Token swapping
The liquidity provided by LPs enables traders to swap tokens within the layer-2 liquidity pools. During these transactions, a trader sends one token and receives another in return.
Community mining
Users can participate in the ZKSwap system through community mining. There are four types of mining that the community can take part in. They include:
Proof-of-liquidity (PoL) mining
In PoL mining, liquidity providers earn rewards in ZKS tokens for their contributions on ZKSwap. Note that $ZKS was rebranded as $ZKB in December 2023, which we’ll explore further in the next section.
Proof-of-sas (PoG)
The PoG mechanism allows gas fee providers to pay users’ gas costs. In exchange, they earn ZKB tokens as a reward. This mechanism permits users to enjoy low-cost transactions.
To become a gas fee provider, you must deposit ETH in a ZKSwap smart contract.
Proof-of-ZK-snarks (PoZK)
The PoZK mechanism enables users to contribute the computing power needed to generate ZK-Snarks. In exchange for their contribution, participants earn rewards in ZKB tokens.
Proof-of-transaction (PoT)
PoT encourages people to use ZKSwap by rewarding them based on the transaction fees they pay each day.
Staking
ZKSwap leverages the proof-of-stake (PoS) mechanism, which incentivizes long-term ZKS holders to stake their tokens by locking them in a smart contract. That way, they contribute to security.
In exchange, users earn rewards based on the number of tokens they have staked.
ZKS token
ZKSpace officially rebranded as ZKBase in December 2023 to enhance scalability for Ethereum and Bitcoin through ZK-proof technology.
As part of this upgrade, the ZKS token was swapped for the new ZKB token at a 1:1 ratio. ZKB now serves as the governance token for the ZKBase protocol. It enables holders to participate in decision-making processes within the network.
On Dec. 30, 2023, ZKBase conducted the final burn of ZKS tokens and issued 600 million ZKB tokens. Users could exchange their ZKS tokens for ZKB via a smart contract starting Jan. 12, 2024.
Note that the swap was essential for aligning the token structure with the rebranded ecosystem’s goals. The entire process was designed to ensure a smooth transition and continuity of benefits for token holders.
Tokenomics
ZKB is an ERC-20 token with a fixed maximum supply of 600 million tokens. The project has allocated 60% of the tokens to community mining, 15% to the ZKSwap team, and 8% to ecosystem developers and growth, ensuring continued support for the network’s development and sustainability.
Subsequently, 6.7% of the tokens will go to angel investors and 5.3% to potential round A investors. The project will also distribute 4% to initial liquidity and 1% to advisors. As part of its token distribution strategy, the project will unlock the tokens within four years after launch, according to its economic whitepaper.
Token price
As of Sept. 2, 2024, ZKB’s price is hovering around $0.03, which is about 91% down compared to its all-time high and 21% down year-on-year.
Airdrop
L2 Labs held its first airdrop in January 2021 before the mainnet launch. It gave away 40 million ZKS tokens worth around $70 million. In February 2021, the project airdropped another 80 million tokens to ZKS holders. Later that year, L2 Labs did another airdrop on CoinMarketCap. This time, 150,000 ZKS tokens were given away.
Token uses
ZKS Token uses include:
Payment of community mining rewards
Community mining participants receive rewards in ZKS tokens.
Staking
Stakers lock ZKS tokens to get staking rewards. Network participants that stake ZKS for 360 days acquire gZKS, the community governance token. It helps users initiate and vote for or against proposals. Token holders need 50,000 gZKS tokens or more to initiate governance proposals.
Compatible wallets
ZKSwap supports MetaMask, Coinbase Wallet, BitKeep, OKX Wallet, and WalletConnect-enabled wallets. These wallets allow users to add or create liquidity, swap tokens, transfer tokens from layer-1 to layer-2, and vice versa. Additionally, they give users full control over their digital assets. Therefore, users are responsible for the security of their wallets.
ZKSwap’s key features
Zero-knowledge rollups
The protocol executes transactions on layer-2 in real time thanks to ZK rollups. Next, it “rolls up” transactions in a bundle and generates zero-knowledge proofs. This enables immediate confirmation of transactions. As a result, users can enjoy faster transaction times, as they no longer need to wait for the one-block confirmation period to pass.
Self-custody
ZKSwap is a decentralized exchange that doesn’t custody digital assets on behalf of users like centralized crypto exchanges. Instead, users connect a self-custodial wallet to the DEX they fully control. Furthermore, they don’t have to register an account and provide personal information, as they do with traditional exchanges when needing to provide KYC data.
Smart contracts
ZKSwap uses an AMM model. It facilitates token swapping using smart contracts instead of intermediaries such as centralized market makers. Additionally, on-chain smart contracts connect Ethereum and the off-chain ZKSwap server. These contracts record and verify state changes and proofs.
The pros and cons of ZKSwap
Criteria | Pros | Cons |
---|---|---|
Transaction Speed | ZK rollups move transactions off-chain for faster processing. | The overall process can be complex for some users due to multiple proof mechanisms. |
Real-Time Execution | Executes transactions on layer-2 in real time, avoiding one-block confirmation delays. | |
Custody | Non-custodial, giving users full control over their digital assets. | |
Gas Fees | PoG mechanism reduces gas fees for users. | |
Income Opportunities | Community mining provides a source of passive income. | |
Regulatory Environment | Regulatory uncertainty, with the US SEC indicating DEXs may fall under regulations. | |
Technology Maturity | ZKSwap is relatively new, with unproven long-term sustainability and adoption. |
JKSwap is furthering DeFi accessibility
Although ZK rollups are complicated for non-technical people, ZKSwap is using them to improve user experience in multiple ways. As it stands, the exchange can manage about 100 transactions per second. This throughput could rise as the network grows and the development team upgrades its capabilities. Overall, ZKSwap is worth watching in the coming months and years.
Frequently asked questions
What does ZK mean in blockchain?
What is a ZK coin?
What are the benefits of ZK?
How does ZKSwap integrate with Ethereum?
What is the role of the ZKS token in the ZKSwap ecosystem?
Disclaimer
In line with the Trust Project guidelines, the educational content on this website is offered in good faith and for general information purposes only. BeInCrypto prioritizes providing high-quality information, taking the time to research and create informative content for readers. While partners may reward the company with commissions for placements in articles, these commissions do not influence the unbiased, honest, and helpful content creation process. Any action taken by the reader based on this information is strictly at their own risk. Please note that our Terms and Conditions, Privacy Policy, and Disclaimers have been updated.