# DeGate V1 Markdown version of https://l2beat.com/layer2s/projects/degate3 ## Summary **Warning:** This project is archived and no longer maintained. **Warning:** A system **shutdown** [was triggered](https://etherscan.io/tx/0xa3a340cfebbdbf9999e61cc3838f67d21610944704f9b2546e2fe95435134d5c#eventlog) on 2025-06-27. This irreversible action freezes the L2 state and allows users to withdraw their funds with the help of the operator. Degate announced that they [will withdraw all funds automatically](https://medium.com/degate/announcement-sunsetting-of-orderbook-f9c0d3389e51). If the operator does not cooperate, a withdrawal mode can still be activated, allowing users to withdraw their funds on their own by providing merkle proofs. - Total Value Secured: $159.32 (-0.01% compared to seven days ago; canonically bridged $159.32, 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 2 - Type: ZK Rollup - Purposes: Exchange, NFT - 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: 1mo (sentiment: good) - Proposer failure: Use escape hatch (sentiment: good) ### About DeGate is a ZK Rollup enabling a decentralized order book exchange. DeGate smart contracts are forked from Loopring V3. ## Value Secured Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/degate3#tvs). - [TVS chart (JSON)](https://l2beat.com/api/scaling/tvs/degate3) - [TVS breakdown by token (JSON)](https://l2beat.com/api/scaling/tvs/degate3/breakdown) ## Activity Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/degate3#activity). - [Activity chart (JSON)](https://l2beat.com/api/scaling/activity/degate3) ## Onchain costs Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/degate3#onchain-costs). ## Liveness Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/degate3#liveness). ## Milestones & Incidents - 2025-06-26 (incident): [Shutdown mode activated](https://medium.com/degate/announcement-sunsetting-of-orderbook-f9c0d3389e51). Shutdown mode prevents further state updates and allows users to withdraw their funds. - 2023-11-13 (incident): [DeGate Mainnet Beta Redeploy](https://medium.com/degate/degate-mainnet-beta-redeployment-oct-2023-e07c8eeaec4c). DeGate redeploys Mainnet Beta due to a bug, with the ability to upgrade the smart contracts. ## Risk summary ### Funds can be lost if 1. the proof system is implemented incorrectly. ### Users can be censored if 2. the operator refuses to include their transactions. However, there exists a mechanism to independently exit the system. ### MEV can be extracted if 3. 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 withdrawal transaction by submitting a request through L1 with a 0.01 ETH fee. If the sequencer is down for more than 15d, users can use the exit hatch to withdraw their funds. The sequencer can censor individual deposits, but in such case after 15d users can get their funds back. ### 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 1mo (sentiment: good) Users have 1mo to exit funds in case of an unwanted upgrade. There is a 1mo 15d delay before a upgrade is applied, and withdrawals can take up to 15d to be processed. ### Proposer failure Use escape hatch (sentiment: good) Users are able to trustlessly exit by submitting a Merkle proof of funds. ## Stage DeGate V1 is a Stage 2 ZK Rollup. ### Scope of assessment #### In scope - L1 core contracts - Gas token - Derivation logic spec #### Not in scope - Source code implementation of the spec - Source code to verification keys mapping - Trusted setup - Sequencer policy - Non-gas tokens Degate provides an orderbook decentralized exchange for spot trading. Arbitrary contracts are not supported. ### 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. - [x] A source-available node exists that can recreate the state from Ethereum L1 data. Please note that the L2BEAT team has not verified the validity of the node source code. [View code](https://github.com/degatedev/degate-state-recover) ### Stage 1 - [x] Principle: Compromising ≥75% of the Security Council is 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. ### Stage 2 - [x] Users have at least 30d to exit as the system upgrades have a 45d delay. ## 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** - [Introduction - DeGate design doc](https://github.com/degatedev/protocols/blob/degate_mainnet/DeGate%20Protocol%20Specification%20Document.md#design-features) ## State derivation ### Node software Node software source code can be found [here](https://github.com/degatedev/degate-state-recover). ### Compression scheme No compression is used. ### Genesis state The system does not begin with a genesis state; instead, it initiates from a zero state, as referenced in [`CreateEmptyState`](https://github.com/degatedev/degate-state-recover/blob/main/statemanager/state.go#L28). ### Data format DeGate bundles off-chain transactions into [zkBlocks](https://github.com/degatedev/protocols/blob/degate_mainnet/Circuit%20Design.md#zkblock) and submits them to the blockchain. zkBlock data definition is documented [here](https://github.com/degatedev/protocols/blob/degate_mainnet/Smart%20Contract%20Design.md#zkblock-data-definition). ## State validation 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. ### ZK Circuits DeGate utilizes Groth16 for their proving system. The source code of the circuits can be found [here](https://github.com/degatedev/protocols/tree/degate_mainnet/packages/loopring_v3/circuit). **Risks** - Funds can be lost if the proof system is implemented incorrectly. ### Verification Keys Generation Groth16 requires a circuit specific trusted setup, so they run their own ceremony. The first phase is run using Powers of Tau ceremony. Some of the instructions on how to regenerate the verification keys can be found [here](https://github.com/degatedev/trusted_setup/tree/master). ### 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** - [Operator - DeGate design doc](https://github.com/degatedev/protocols/blob/degate_mainnet/DeGate%20Protocol%20Specification%20Document.md#operator) ## Upgrades & Governance ## Updates Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/degate3#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** - [ExchangeV3.sol#L341-L348 - DeGate source code](https://etherscan.io/address/0xc56C1dfE64D21A345E3A3C715FFcA1c6450b964b#code#F1#L341) - [LoopringIOExchangeOwner.sol#L98-L101 - DeGate source code](https://etherscan.io/address/0x9b93e47b7F61ad1358Bd47Cd01206708E85AE5eD#code#F1#L98) ### 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** - [Forced Withdrawals - DeGate design doc](https://github.com/degatedev/protocols/blob/degate_mainnet/Smart%20Contract%20Design.md#force-withdrawal) ## 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** - [Withdraw - DeGate design doc](https://github.com/degatedev/protocols/blob/degate_mainnet/Smart%20Contract%20Design.md#normal-withdrawal) ### 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** - [Forced Request Handling - DeGate design doc](https://github.com/degatedev/protocols/blob/degate_mainnet/Smart%20Contract%20Design.md#force-withdrawal) - [ExchangeV3.sol#L392 - DeGate source code, forceWithdraw function](https://etherscan.io/address/0xc56C1dfE64D21A345E3A3C715FFcA1c6450b964b#code#F1#L392) ### Emergency exit If the 15d deadline passes and the forced exit is still ignored the user can put the system into Withdrawal Mode, disallowing further state updates. In that case everybody can withdraw by submitting a merkle proof of their funds with their L1 transaction. **References** - [Forced Request Handling - DeGate design doc](https://github.com/degatedev/protocols/blob/degate_mainnet/Smart%20Contract%20Design.md#exodus-mode) - [ExchangeV3.sol#L420 - DeGate source code, withdrawFromMerkleTree function](https://etherscan.io/address/0xc56C1dfE64D21A345E3A3C715FFcA1c6450b964b#code#F1#L420) ## Permissions ### Ethereum #### Actors ##### BlockVerifier Owner Addresses: [0xacD3A62F3eED1BfE4fF0eC8240d645c1F5477F82](https://etherscan.io/address/0xacD3A62F3eED1BfE4fF0eC8240d645c1F5477F82) This address is the owner of the BlockVerifier contract. ##### Block Submitters Addresses: [0x4e3FE240B50A445fc6137a6363aC3593Af173b8a](https://etherscan.io/address/0x4e3FE240B50A445fc6137a6363aC3593Af173b8a) Actors who can submit new blocks, updating the L2 state on L1. ##### Degate HomeDAO2 Multisig Addresses: [0x2028834B2c0A36A918c10937EeA71BE4f932da52](https://etherscan.io/address/0x2028834B2c0A36A918c10937EeA71BE4f932da52) Actor allowed to upgrade the ExchangeV3 and DefaultDepositContract contracts. This address is the owner of the following contracts: LoopringIOExchangeOwner, LoopringV3, DefaultDepositContract. Can add or remove block submitters. Can change the forced withdrawal fee up to 0.25 ETH. Can change a way that balance is calculated per contract during the deposit, allowing the support of non-standard tokens. ## Smart contracts ### Ethereum #### ExchangeV3 Addresses: [0x9C07A72177c5A05410cA338823e790876E79D73B](https://etherscan.io/address/0x9C07A72177c5A05410cA338823e790876E79D73B#code), [0xc56C1dfE64D21A345E3A3C715FFcA1c6450b964b](https://etherscan.io/address/0xc56C1dfE64D21A345E3A3C715FFcA1c6450b964b#code) (Implementation (Upgradable)), [0x0D2eC0a5858730E7D49f5B4aE6f2C665e46c1d9d](https://etherscan.io/address/0x0D2eC0a5858730E7D49f5B4aE6f2C665e46c1d9d#code) (Admin) Main ExchangeV3 contract. Can be upgraded by: Degate HomeDAO2 Multisig with 1mo 15d delay #### LoopringIOExchangeOwner Addresses: [0x9b93e47b7F61ad1358Bd47Cd01206708E85AE5eD](https://etherscan.io/address/0x9b93e47b7F61ad1358Bd47Cd01206708E85AE5eD#code) Contract used by the Prover to submit exchange blocks with zkSNARK proofs that are later processed and verified by the BlockVerifier contract. #### DefaultDepositContract Addresses: [0x54D7aE423Edb07282645e740C046B9373970a168](https://etherscan.io/address/0x54D7aE423Edb07282645e740C046B9373970a168#code), [0x8CCc06C4C3B2b06616EeE1B62F558f5b9C08f973](https://etherscan.io/address/0x8CCc06C4C3B2b06616EeE1B62F558f5b9C08f973#code) (Implementation (Upgradable)), [0xf2991507952d9594E71A44A54fb19f3109D213A5](https://etherscan.io/address/0xf2991507952d9594E71A44A54fb19f3109D213A5#code) (Admin) ERC 20 token basic deposit contract. Handles user deposits and withdrawals. Can be upgraded by: Degate HomeDAO2 Multisig with 1mo 15d delay #### LoopringV3 Addresses: [0x9385aCd9d78dFE854c543294770d0C94c2B07EDC](https://etherscan.io/address/0x9385aCd9d78dFE854c543294770d0C94c2B07EDC#code) Contract for setting exchange fee parameters. #### BlockVerifier Addresses: [0xE3B7fE3ce0fa54C5AC7F48E7ED9E52dA045bE4d6](https://etherscan.io/address/0xE3B7fE3ce0fa54C5AC7F48E7ED9E52dA045bE4d6#code) zkSNARK Verifier based on ethsnarks library. #### TimeLock1 Addresses: [0x0D2eC0a5858730E7D49f5B4aE6f2C665e46c1d9d](https://etherscan.io/address/0x0D2eC0a5858730E7D49f5B4aE6f2C665e46c1d9d#code) This timelock contract is set as the proxyOwner of the ExchangeV3 contract. There is a 1mo 15d time delay for upgrading the contract. #### TimeLock2 Addresses: [0xf2991507952d9594E71A44A54fb19f3109D213A5](https://etherscan.io/address/0xf2991507952d9594E71A44A54fb19f3109D213A5#code) This timelock contract is set as the proxyOwner of the DefaultDepositContract contract. There is a 1mo 15d time delay for upgrading the contract.