# DeGate Legacy Markdown version of https://ethbeat.org/layer2s/projects/degate ## Summary **Warning:** This project is archived and no longer maintained. **Warning:** This project is in shutdown mode and no longer active. - Total Value Secured: No data - Past day UOPS: No data - Stage: Stage 2 (Appchain) - Type: ZK Rollup - Purpose: Exchange - 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: ∞ (sentiment: good) - Proposer failure: Use escape hatch (sentiment: good) ### About DeGate Legacy is a shut down deployment of DeGate, an app-specific ZK Rollup that enables a trustless, fast and low-fee decentralized order book exchange, helping users to trade easy and sleep easy. 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/degate ### 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 ## 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/degate#onchain-costs). ### Tracked transactions #### State updates - functionCall: 2023-04-20 12:27 UTC - 2023-09-28 12:01 UTC; historical; address: [0x6B937A5920726e70c5bF1d4d4E18EEeEd46FaE83](https://etherscan.io/address/0x6B937A5920726e70c5bF1d4d4E18EEeEd46FaE83); selector: 0x377bb770; signature: `function submitBlocks(bool isDataCompressed,bytes data)` ## Milestones & Incidents - 2023-05-03: [DeGate DEX Launches Mainnet Beta](https://medium.com/degate/degate-dex-launches-mainnet-beta-trade-easy-sleep-easy-603574bd3a46). DeGate launches mainnet beta with a deposit cap and a program to recover eventual user losses. ## Risk summary ### Users can be censored if 1. the operator refuses to include their transactions. However, there exists a mechanism to independently exit the system. ### MEV can be extracted if 2. 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 ∞ (sentiment: good) Users can exit funds at any time because contracts are not upgradeable. ### Proposer failure Use escape hatch (sentiment: good) Users are able to trustlessly exit by submitting a Merkle proof of funds. ## Stage DeGate Legacy 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. ### 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 cannot be upgraded. [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 ### 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) ## Updates Each date links the update on the HTML page, which also shows its contract diffs. ### [2024-01-05 07:55 UTC](https://ethbeat.org/layer2s/projects/degate?update=57cb5aed) (6 changes) Discovery rerun on the same block number with only config-related changes. ### [2025-07-14 12:44 UTC](https://ethbeat.org/layer2s/projects/degate?update=347654a3) (7 changes) Discovery rerun on the same block number with only config-related changes. ### [2024-01-03 12:15 UTC](https://ethbeat.org/layer2s/projects/degate?update=c33252b2) (1 change) Ignored following method. ### [2023-10-02 13:27 UTC](https://ethbeat.org/layer2s/projects/degate?update=f376611b) (3 changes) ### [2023-09-26 12:45 UTC](https://ethbeat.org/layer2s/projects/degate?update=255641a1) (1 change) ## 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/0xe63602a9B3DFE983187525AC985Fec4F57B24eD5#code#F1#L341) - [LoopringIOExchangeOwner.sol#L98-L101 - DeGate source code](https://etherscan.io/address/0x6B937A5920726e70c5bF1d4d4E18EEeEd46FaE83#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/0xe63602a9B3DFE983187525AC985Fec4F57B24eD5#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/0xe63602a9B3DFE983187525AC985Fec4F57B24eD5#code#F1#L420) ## Permissions Explore these contracts and permissions in Disco, ETHBEAT's contract explorer: https://disco.ethbeat.org/ui/p/degate ### Ethereum #### Actors ##### DefaultDepositContract Owner Addresses: [0x2028834B2c0A36A918c10937EeA71BE4f932da52](https://etherscan.io/address/0x2028834B2c0A36A918c10937EeA71BE4f932da52) 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. ##### BlockVerifier Owner Addresses: [0xd8C695DfAab475f55327Ce269096923EFECa2e0F](https://etherscan.io/address/0xd8C695DfAab475f55327Ce269096923EFECa2e0F) This address is the owner of the BlockVerifier contract. ##### 2 EOAs Addresses: [0x84A00D39C3c95e839202E19F892F17743d6370a0](https://etherscan.io/address/0x84A00D39C3c95e839202E19F892F17743d6370a0), [0xE9A37E8DDDbf4Bb3f5d6aCE6D01a137e484Db77C](https://etherscan.io/address/0xE9A37E8DDDbf4Bb3f5d6aCE6D01a137e484Db77C) Actors who can submit new blocks, updating the L2 state on L1. ## Smart contracts Explore these contracts and permissions in Disco, ETHBEAT's contract explorer: https://disco.ethbeat.org/ui/p/degate ### Ethereum #### ExchangeV3 Addresses: [0xe63602a9B3DFE983187525AC985Fec4F57B24eD5](https://etherscan.io/address/0xe63602a9B3DFE983187525AC985Fec4F57B24eD5#code) Main ExchangeV3 contract. #### LoopringIOExchangeOwner Addresses: [0x6B937A5920726e70c5bF1d4d4E18EEeEd46FaE83](https://etherscan.io/address/0x6B937A5920726e70c5bF1d4d4E18EEeEd46FaE83#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: [0x814d0c1903D69EB1c7ceB8F5190B20A06892d1dA](https://etherscan.io/address/0x814d0c1903D69EB1c7ceB8F5190B20A06892d1dA#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. #### LoopringV3 Addresses: [0x4d707cae77c5E82a00BF9572A55d3ef3a4e0c458](https://etherscan.io/address/0x4d707cae77c5E82a00BF9572A55d3ef3a4e0c458#code) Contract for setting exchange fee parameters. #### BlockVerifier Addresses: [0x1c602313cDDC68C5789aCb7df0C92a93B0E04C9e](https://etherscan.io/address/0x1c602313cDDC68C5789aCb7df0C92a93B0E04C9e#code) zkSNARK Verifier based on ethsnarks library.