# DeGate V1 Markdown version of https://ethbeat.org/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.27 (0.00% compared to seven days ago; canonically bridged $159.27, 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) - TVS by asset: Stablecoins $158.84 (99.7%), BTC & derivatives $0.43 (0.26%) - Past day UOPS: No data - Stage: Stage 2 (Appchain: Degate provides an orderbook decentralized exchange for spot trading. Arbitrary contracts are not supported.) - Type: ZK Rollup - Purposes: Exchange, NFT - Host chain: Ethereum ### Risks - Sequencer failure: Force via L1 (sentiment: good) - State validation: Validity proofs (SN) (No execution delay; 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. ### Links - Website: https://degate.com/ - Bridge: https://app.degate.com/ - Docs: https://docs.degate.com/ - Repository: https://github.com/degatedev/protocols - Social: https://twitter.com/DeGateDex, https://discord.gg/degate, https://youtube.com/@degatedex1718, https://medium.com/degate, https://mirror.xyz/0x078a601f492043C8e7D0E15B0F8815f58b4c342f - Contracts explorer (Disco): https://disco.ethbeat.org/ui/p/degate3 ### Badges - Application-specific chain: This project is built to operate a specific application - Ethereum with calldata: This project is posting its data to Ethereum as calldata - Fork of Loopring: The project is a fork of Loopring ## Value Secured The interactive TVS charts are shown on [the HTML page](https://ethbeat.org/layer2s/projects/degate3#tvs). Token by token: [TVS breakdown](https://ethbeat.org/layer2s/projects/degate3/tvs-breakdown). - [TVS chart (JSON)](https://ethbeat.org/api/scaling/tvs/degate3?range=max) - [TVS breakdown by token (JSON)](https://ethbeat.org/api/scaling/tvs/degate3/breakdown) ## Activity The interactive activity chart is shown on [the HTML page](https://ethbeat.org/layer2s/projects/degate3#activity). - [Activity chart (JSON)](https://ethbeat.org/api/scaling/activity/degate3?range=max) ## Onchain costs The section shows the operating costs that L2s pay to Ethereum. The interactive costs chart is shown on [the HTML page](https://ethbeat.org/layer2s/projects/degate3#onchain-costs). ### Tracked transactions #### State updates - functionCall: 2023-11-11 23:56 UTC - now; currently used; address: [0x9b93e47b7F61ad1358Bd47Cd01206708E85AE5eD](https://etherscan.io/address/0x9b93e47b7F61ad1358Bd47Cd01206708E85AE5eD); selector: 0x377bb770; signature: `function submitBlocks(bool isDataCompressed,bytes data)` ## Liveness This section shows how "live" the project's operators are by displaying how frequently they submit transactions of the selected type. It also highlights anomalies - significant deviations from their typical schedule. The interactive liveness chart is shown on [the HTML page](https://ethbeat.org/layer2s/projects/degate3#liveness). ### Tracked transactions #### State updates - functionCall: 2023-11-11 23:56 UTC - now; currently used; address: [0x9b93e47b7F61ad1358Bd47Cd01206708E85AE5eD](https://etherscan.io/address/0x9b93e47b7F61ad1358Bd47Cd01206708E85AE5eD); selector: 0x377bb770; signature: `function submitBlocks(bool isDataCompressed,bytes data)` ## 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) (No execution delay; 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 Appchain ZK Rollup. **The project does not pass the walkaway test**: users are not able to exit in the presence of malicious operators if the Security Council disappears. ### 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 Rollup operators cannot compromise the system, but being **application-specific** might bring additional risk. Degate provides an orderbook decentralized exchange for spot trading. Arbitrary contracts are not supported. **Note:** We're still in the process of formalizing how to properly integrate appchains in the Stages framework. ### Stage 0 5 requirements met. - Met: A complete and functional proof system is deployed. - Met: The project calls itself a rollup. - Met: State roots are posted to Ethereum L1. - Met: Inputs for the state transition function are posted to Ethereum L1. - Met: A source-available node exists that can recreate the state from Ethereum L1 data. Please note that the ETHBEAT team has not verified the validity of the node source code. [View code](https://github.com/degatedev/degate-state-recover) ### Stage 1 2 requirements met. **Principle** - Met: 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. **Guidelines** - Met: Users are able to exit without the help of the permissioned operators. ### Stage 2 1 requirement met. - Met: Users have at least 30d to exit as the system upgrades have a 45d delay. [Learn more about Stages](https://ethbeat.org/stages). Please keep in mind that these stages do not reflect project security, this is an opinionated assessment of project maturity based on subjective criteria, created with a goal of incentivizing projects to push toward better decentralization. Each team may have taken different paths to achieve this goal. ## 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) Learn more about the DA layer here: [Ethereum](https://ethbeat.org/projects/ethereum) ## 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 ### Past upgrades The metrics include upgrades on the currently used proxy contracts. Historical proxy contracts and changes of such are not included. - Count of upgrades: No upgrades - Last upgrade: N/A - Avg upgrade interval: N/A - 2023-11-11 23:57 UTC, deployment of [DefaultDepositContract](https://etherscan.io/address/0x54D7aE423Edb07282645e740C046B9373970a168#code): transaction [0xb1e5bc43a9a516618be17e0075ca12b7420b5daa42e377af2906a2c8d9619bdc](https://etherscan.io/tx/0xb1e5bc43a9a516618be17e0075ca12b7420b5daa42e377af2906a2c8d9619bdc), implementations: [0x8CCc06C4C3B2b06616EeE1B62F558f5b9C08f973](https://etherscan.io/address/0x8CCc06C4C3B2b06616EeE1B62F558f5b9C08f973#code) - 2023-11-11 23:56 UTC, deployment of [ExchangeV3](https://etherscan.io/address/0x9C07A72177c5A05410cA338823e790876E79D73B#code): transaction [0x618d6d6bdaa4be3257aa4c695f9c10806e261f0e9759fc3133a5798fed43c062](https://etherscan.io/tx/0x618d6d6bdaa4be3257aa4c695f9c10806e261f0e9759fc3133a5798fed43c062), implementations: [0xc56C1dfE64D21A345E3A3C715FFcA1c6450b964b](https://etherscan.io/address/0xc56C1dfE64D21A345E3A3C715FFcA1c6450b964b#code) ## Updates Each date links the update on the HTML page, which also shows its contract diffs. ### [2025-06-27 14:32 UTC](https://ethbeat.org/layer2s/projects/degate3?update=44f443e1) (12 changes) Discovery rerun on the same block number with only config-related changes. ### [2025-07-14 12:44 UTC](https://ethbeat.org/layer2s/projects/degate3?update=af145152) (9 changes) Discovery rerun on the same block number with only config-related changes. ### [2025-06-27 14:33 UTC](https://ethbeat.org/layer2s/projects/degate3?update=2990754d) (2 changes) exchange shutdown, added headerwarn and milestone: 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. ### [2024-01-05 07:55 UTC](https://ethbeat.org/layer2s/projects/degate3?update=33c4140d) (6 changes) The owner has accepted the ownership of the contract, which is now the same multisig used for upgrades. The EOA that was there before is now only the owner of the BlockVerifier, but it has no power since all the methods with the `onlyOwner` modifier have been deleted from Loopring's original codebase. ### [2023-12-21 13:24 UTC](https://ethbeat.org/layer2s/projects/degate3?update=6f024a06) (3 changes) Owner is being changed. They are using Claimable instead of Ownable, which is the same thing but the new pending owner has to accept the ownership. ### [2023-11-21 13:17 UTC](https://ethbeat.org/layer2s/projects/degate3?update=9ac99922) (9 changes) Provide description of changes. This section will be preserved. ## 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 Explore these contracts and permissions in Disco, ETHBEAT's contract explorer: https://disco.ethbeat.org/ui/p/degate3 ### 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 ![A diagram of the smart contract architecture](https://ethbeat.org/static/images/architecture/degate3.ba7db822.png) Explore these contracts and permissions in Disco, ETHBEAT's contract explorer: https://disco.ethbeat.org/ui/p/degate3 ### 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) **Past upgrades** (Count of upgrades: No upgrades, Last upgrade: N/A, Avg upgrade interval: N/A) - 2023-11-11 23:56 UTC, deployment of [ExchangeV3](https://etherscan.io/address/0x9C07A72177c5A05410cA338823e790876E79D73B#code): transaction [0x618d6d6bdaa4be3257aa4c695f9c10806e261f0e9759fc3133a5798fed43c062](https://etherscan.io/tx/0x618d6d6bdaa4be3257aa4c695f9c10806e261f0e9759fc3133a5798fed43c062), implementations: [0xc56C1dfE64D21A345E3A3C715FFcA1c6450b964b](https://etherscan.io/address/0xc56C1dfE64D21A345E3A3C715FFcA1c6450b964b#code) 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 (escrow) 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) **Past upgrades** (Count of upgrades: No upgrades, Last upgrade: N/A, Avg upgrade interval: N/A) - 2023-11-11 23:57 UTC, deployment of [DefaultDepositContract](https://etherscan.io/address/0x54D7aE423Edb07282645e740C046B9373970a168#code): transaction [0xb1e5bc43a9a516618be17e0075ca12b7420b5daa42e377af2906a2c8d9619bdc](https://etherscan.io/tx/0xb1e5bc43a9a516618be17e0075ca12b7420b5daa42e377af2906a2c8d9619bdc), implementations: [0x8CCc06C4C3B2b06616EeE1B62F558f5b9C08f973](https://etherscan.io/address/0x8CCc06C4C3B2b06616EeE1B62F558f5b9C08f973#code) ERC 20 token basic deposit contract. Handles user deposits and withdrawals. All supported tokens in this escrow are included in the value secured calculation. 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.