# ZKBase Markdown version of https://l2beat.com/layer2s/projects/zkspace ## Summary **Warning:** This project is archived and no longer maintained. - Total Value Secured: $230.72 K (-0.24% compared to seven days ago; canonically bridged $230.72 K, natively minted $0.00, externally bridged $0.00; 0.00% with additional trust assumptions compared to the tokens involved and the Stage assigned to the project's canonical messaging bridge) - Stage: Stage 0 - Type: ZK Rollup - Purposes: NFT, Exchange, Payments - Host chain: Ethereum ### Risks - Sequencer failure: Force via L1 (sentiment: good) - State validation: Validity proofs (SN) (sentiment: good) - Data availability: Onchain (sentiment: good) - Exit window: 5d (sentiment: bad) - Proposer failure: Use escape hatch (sentiment: good) ### About ZKBase is an infrastructure protocol based on Zero-Knowledge (ZK) proof technology. It aims to support various projects across the Bitcoin and Ethereum networks. ## Value Secured Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/zkspace#tvs). - [TVS chart (JSON)](https://l2beat.com/api/scaling/tvs/zkspace) - [TVS breakdown by token (JSON)](https://l2beat.com/api/scaling/tvs/zkspace/breakdown) ## Onchain costs Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/zkspace#onchain-costs). ## Liveness Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/zkspace#liveness). ## Milestones & Incidents - 2023-12-29: [ZKSpace Officially Upgrades to ZKBase](https://zkbaseofficial.medium.com/zkbase-is-undergoing-a-brand-new-upgrade-and-setting-sail-again-in-2024-3d71418a10e1). The ZKSpace team has rebranded to ZKBase. - 2022-02-21: [Token Deposit Campaign started](https://medium.com/@zkspaceofficial/zkspace-releases-token-deposit-campaign-with-fascinating-zks-rewards-151e2492549e). Incentives program to onboard new users has started. - 2021-12-20: [ZKSpace launched](https://x.com/ZKBaseOfficial/status/1465943738157465605). All-in-One ScalingProject Platform ZKSpace, Featuring ZKSwap v3.0, NFTs, & Payments is launched. ## Risk summary ### Funds can be stolen if 1. a contract receives a malicious code upgrade. There is a 8d delay on code upgrades. ### Funds can be lost if 2. the user is unable to generate the non-trivial ZK proof for exodus withdraw. ### Users can be censored if 3. the operator refuses to include their transactions. However, there exists a mechanism to independently exit the system. ### MEV can be extracted if 4. the operator exploits their centralized position and frontruns user transactions. ## Risk analysis ### Sequencer failure Force via L1 (sentiment: good) Users can force the sequencer to include a transaction by submitting a request through L1. If the sequencer censors or is down for for more than 3d, users can use the exit hatch to withdraw their funds. ### State validation Validity proofs (SN) (sentiment: good) SNARKs are succinct zero knowledge proofs that ensure state correctness, but require trusted setup. ### Data availability Onchain (sentiment: good) All of the data needed for proof construction is published on Ethereum L1. ### Exit window 5d (sentiment: bad) Users have 5d to exit funds in case of an unwanted upgrade. There is a 8d delay before a upgrade is applied, and withdrawals can take up to 3d to be processed. ### Proposer failure Use escape hatch (sentiment: good) Users are able to trustlessly exit by submitting a zero knowledge proof of funds. ## Stage ZKBase is a Stage 0 ZK Rollup. ZKBase provides the infrastructure for token transfer, swaps and NFT minting. Arbitrary contracts are not supported. **Warning:** There is no available node software that can reconstruct the state from L1 data, hence there is no way to verify that this system is a rollup. ### Stage 0 - [x] A complete and functional proof system is deployed. - [x] The project calls itself a rollup. - [x] State roots are posted to Ethereum L1. - [x] Inputs for the state transition function are posted to Ethereum L1. - [ ] No source-available node exists that can recreate the state from L1 data. ### Stage 1 - [ ] Principle: Compromising ≥75% of the Security Council should be the only way (other than bugs) for a rollup to indefinitely block an L2→L1 message (e.g. a withdrawal) or push an invalid L2→L1 message (e.g. an invalid withdrawal) with a <7d exit window. - [x] Users are able to exit without the help of the permissioned operators. - [ ] Upgrades executed by actors with more centralized control than a Security Council provide less than 7d for users to exit if the permissioned operator is down or censoring. ### Stage 2 - [ ] Upgrades unrelated to onchain provable bugs provide less than 30d to exit. ## Data availability ### All data required for proofs is published onchain All the data that is used to construct the system state is published onchain in the form of cheap calldata. This ensures that it will always be available when needed. **References** - [ZKSwap Introduces Practical ZK Rollups - Medium blog](https://medium.com/zkswap/zkswap-introduces-practical-zk-rollups-zkspeed-achieving-high-tps-and-low-gas-fees-in-real-6effe4e789e0) ## State validation ### Validity proofs Each update to the system state must be accompanied by a ZK proof that ensures that the new state was derived by correctly applying a series of valid user transactions to the previous state. These proofs are then verified on Ethereum by a smart contract. **References** - [ZKSwap Introduces Practical ZK Rollups - Medium blog](https://medium.com/zkswap/zkswap-introduces-practical-zk-rollups-zkspeed-achieving-high-tps-and-low-gas-fees-in-real-6effe4e789e0) ## Updates Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/zkspace#updates). ## Operator ### The system has a centralized operator The operator is the only entity that can propose blocks. A live and trustworthy operator is vital to the health of the system. **Risks** - MEV can be extracted if the operator exploits their centralized position and frontruns user transactions. **References** - [ZKSwap Validator - ZKSwap wiki](https://en.wiki.zks.org/techonology#3-validator) ### Users can force exit the system Force exit allows the users to escape censorship by withdrawing their funds. The system allows users to force the withdrawal of funds by submitting a request directly to the contract onchain. The request must be served within a defined time period. If this does not happen, the system will halt regular operation and permit trustless withdrawal of funds. **Risks** - Users can be censored if the operator refuses to include their transactions. However, there exists a mechanism to independently exit the system. **References** - [ZkSync.sol#L404 - ZKSwap source code](https://github.com/l2labs/zkswap-contracts-v2/blob/master/contracts/ZkSync.sol#L404) ## Withdrawals ### Regular exit The user initiates the withdrawal by submitting a regular transaction on this chain. When the block containing that transaction is settled the funds become available for withdrawal on L1. ZK proofs are required to settle blocks. Finally the user submits an L1 transaction to claim the funds. **References** - [Make Transaction](https://en.wiki.zks.org/interact-with-zkswap/make-transaction#withdraw) ### Forced exit If the user experiences censorship from the operator with regular exit they can submit their withdrawal requests directly on L1. The system is then obliged to service this request. Once the force operation is submitted and if the request is serviced, the operation follows the flow of a regular exit. **References** - [ZkSync.sol#L404 - ZKSwap source code](https://github.com/l2labs/zkswap-contracts-v2/blob/master/contracts/ZkSync.sol#L404) ### Emergency exit If the enough time deadline passes and the forced exit is still ignored the user can put the system into Exodus Mode, disallowing further state updates. In that case everybody can withdraw by submitting a zero knowledge proof of their funds with their L1 transaction. **Risks** - Funds can be lost if the user is unable to generate the non-trivial ZK proof for exodus withdraw. **References** - [ZkSyncCommitBlock.sol#L230-L246 - ZKSwap source code](https://github.com/l2labs/zkswap-contracts-v2/blob/3f650d28a266a56d49a3b3d2049cde34112efb14/contracts/ZkSyncCommitBlock.sol#L230-L246) ## Permissions ### Ethereum #### Actors ##### zkSpace Admin Addresses: [0xfCAE399eA757DDf0a4020198C59BF2270c2B05Be](https://etherscan.io/address/0xfCAE399eA757DDf0a4020198C59BF2270c2B05Be) This address is the master of Upgrade Gatekeeper contract, which is allowed to perform upgrades for Governance, Verifier, VerifierExit, PairManager, ZkSeaNFT and ZkSync contracts. ##### Active validator Addresses: [0x5bd9404260D2B0D55081E599e4e085BE080141E2](https://etherscan.io/address/0x5bd9404260D2B0D55081E599e4e085BE080141E2) This actor is allowed to propose, revert and execute L2 blocks on L1. A list of active validators is kept inside Governance contract and can be updated by zkSpace Admin. ## Smart contracts ### Ethereum #### ZkSync Addresses: [0x5CDAF83E077DBaC2692b5864CA18b61d67453Be8](https://etherscan.io/address/0x5CDAF83E077DBaC2692b5864CA18b61d67453Be8#code), [0x467a2B91f231D930F5eeB6B982C7666E81DA8626](https://etherscan.io/address/0x467a2B91f231D930F5eeB6B982C7666E81DA8626#code) (Implementation #1 (Upgradable)), [0x899A605a3B7A11eA5D928958b77014e763c53426](https://etherscan.io/address/0x899A605a3B7A11eA5D928958b77014e763c53426#code) (Implementation #2 (Upgradable)), [0x49dCe53faeAD4538F77c3b8Bae8347f1644101Db](https://etherscan.io/address/0x49dCe53faeAD4538F77c3b8Bae8347f1644101Db#code) (Implementation #3 (Upgradable)), [0x6A4E7dd4c546Ca2DD84b48803040732fC30206D7](https://etherscan.io/address/0x6A4E7dd4c546Ca2DD84b48803040732fC30206D7#code) (Implementation #4 (Upgradable)), [0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390](https://etherscan.io/address/0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390#code) (Admin) The main Rollup contract. Operator commits blocks, provides ZK proof which is validated by the Verifier contract and process withdrawals (executes blocks). Users deposit ETH and ERC20 tokens. This contract defines the upgrade delay in the UPGRADE_NOTICE_PERIOD constant that is currently set to 8 days. Can be upgraded by: zkSpace Admin with 8d delay #### Governance Addresses: [0x83Cb1531Ec8447366501aE440478da245EcffB89](https://etherscan.io/address/0x83Cb1531Ec8447366501aE440478da245EcffB89#code), [0x6659174CdB0c445B897aEd25181f293E468941a5](https://etherscan.io/address/0x6659174CdB0c445B897aEd25181f293E468941a5#code) (Implementation (Upgradable)), [0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390](https://etherscan.io/address/0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390#code) (Admin) Keeps a list of block producers and whitelisted tokens. Can be upgraded by: zkSpace Admin with 8d delay #### UniswapV2Factory Addresses: [0xc07f850b60E0EEd49a09E455b01a869C25963735](https://etherscan.io/address/0xc07f850b60E0EEd49a09E455b01a869C25963735#code), [0x5f3bE7846efC473552C5619b929F7d4aa640fb54](https://etherscan.io/address/0x5f3bE7846efC473552C5619b929F7d4aa640fb54#code) (Implementation (Upgradable)), [0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390](https://etherscan.io/address/0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390#code) (Admin) Manages trading pairs. Can be upgraded by: zkSpace Admin with 8d delay #### ZkSeaNFT Addresses: [0xc632347cc96A4400653E3514eA148630455295b5](https://etherscan.io/address/0xc632347cc96A4400653E3514eA148630455295b5#code), [0xD06986022EFE62A5BC8258299e4495Bb27567BE0](https://etherscan.io/address/0xD06986022EFE62A5BC8258299e4495Bb27567BE0#code) (Implementation (Upgradable)), [0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390](https://etherscan.io/address/0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390#code) (Admin) Contract managing deposits and withdrawals of NFTs to ScalingProject. Can be upgraded by: zkSpace Admin with 8d delay #### Verifier Addresses: [0xB7A4f3eFBe8e2B2FC973FfDb1b1D7F19F012A7af](https://etherscan.io/address/0xB7A4f3eFBe8e2B2FC973FfDb1b1D7F19F012A7af#code), [0x44DedA2C824458A5DfE1e363c679dea33f1ffA39](https://etherscan.io/address/0x44DedA2C824458A5DfE1e363c679dea33f1ffA39#code) (Implementation (Upgradable)), [0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390](https://etherscan.io/address/0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390#code) (Admin) zkSNARK Plonk Verifier. Can be upgraded by: zkSpace Admin with 8d delay #### VerifierExit Addresses: [0x1d8d584F1aef51ad5E2f436F057E43e0d788Be81](https://etherscan.io/address/0x1d8d584F1aef51ad5E2f436F057E43e0d788Be81#code), [0x41455808B3109AD0f79672C44D75933D3529FEaE](https://etherscan.io/address/0x41455808B3109AD0f79672C44D75933D3529FEaE#code) (Implementation (Upgradable)), [0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390](https://etherscan.io/address/0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390#code) (Admin) zkSNARK Verifier for the escape hatch. Can be upgraded by: zkSpace Admin with 8d delay #### UpgradeGatekeeper Addresses: [0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390](https://etherscan.io/address/0xB0C7E781f70C0B8E3e62F1766a4Be6e435431390#code) This is the contract that implements the upgrade mechanism for Governance, Verifier and ZkSync. It relies on the ZkSync contract to enforce upgrade delays. The current deployment carries some associated risks: - Funds can be stolen if a contract receives a malicious code upgrade. There is a 8d delay on code upgrades.