# RedSonic Markdown version of https://l2beat.com/layer2s/projects/redsonic ## Summary **Warning:** This project is archived and no longer maintained. **Warning:** This project was sunset on 2024-09-20 and deposits after that time may not be recoverable. **Warning:** Critical contracts can be upgraded by an EOA which could result in the loss of all funds. - Total Value Secured: $100.91 (-79.8% compared to seven days ago; canonically bridged $100.91, 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) - Type: Validium - Purposes: Exchange, NFT, Gaming - Host chain: Ethereum ### Risks - Sequencer failure: Force via L1 (sentiment: good) - State validation: Validity proofs (ST) (sentiment: good) - Data availability: External (DAC) (sentiment: bad) - Exit window: None (sentiment: bad) - Proposer failure: Use escape hatch (sentiment: good) ### About RedSonic is a Validium based on the StarkEx technology. Its goal is to power the next generation Web3 apps and games by providing developers with the APIs and SDKs to create digital assets and easily integrate them in-app and in-game. ## Value Secured Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/redsonic#tvs). - [TVS chart (JSON)](https://l2beat.com/api/scaling/tvs/redsonic) - [TVS breakdown by token (JSON)](https://l2beat.com/api/scaling/tvs/redsonic/breakdown) ## Milestones & Incidents - 2022-09-29: [Reddio Announces Mainnet Launch](https://blog.reddio.com/announces-layer2-zkrollup-mainnet-launch/). Reddio announces its Validium Mainnet launch. ## Risk summary ### Funds can be stolen if 1. a contract receives a malicious code upgrade. There is no delay on code upgrades (CRITICAL). ### Funds can be lost if 2. the external data becomes unavailable (CRITICAL). ### Users can be censored if 3. the committee restricts their access to the external data, 4. the operator refuses to include their transactions. However, there exists a mechanism to independently exit the system. ### MEV can be extracted if 5. the operator exploits their centralized position and frontruns user transactions. ## Risk analysis **Warning:** Critical contracts can be upgraded by an EOA which could result in the loss of all funds. ### 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 7d, users can use the exit hatch to withdraw their funds. ### State validation Validity proofs (ST) (sentiment: good) STARKs are zero knowledge proofs that ensure state correctness. ### Data availability External (DAC) (sentiment: bad) Proof construction relies fully on data that is NOT published onchain. There exists a Data Availability Committee (DAC) with a threshold of 2/2 that is tasked with protecting and supplying the data. ### Exit window None (sentiment: bad) There is no window for users to exit in case of an unwanted upgrade since contracts are instantly upgradable. ### Proposer failure Use escape hatch (sentiment: good) Users are able to trustlessly exit by submitting a Merkle proof of funds. NFTs will be minted on L1 to exit. ## Data availability ### Data is not stored on chain The balances of the users are not published onchain, but rather sent to external trusted parties, also known as committee members. A state update is valid and accepted onchain only if at least a quorum of the committee members sign a state update. **Risks** - Funds can be lost if the external data becomes unavailable (CRITICAL). - Users can be censored if the committee restricts their access to the external data. **References** - [Data Availability Modes - StarkEx documentation](https://docs.starkware.co/starkex/con_data_availability.html#data_availability_modes) - [Validium - StarkEx documentation](https://docs.starkware.co/starkex/con_data_availability.html#validium_starkex) - [Availability Verifiers - StarkEx documentation](https://docs.starkware.co/starkex/spot/shared/contract-management.html#availability_verifiers_spot) ## 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. The system state is represented using Merkle roots. **References** - [Enforcing Consistency on the On-Chain State - StarkEx documentation](https://docs.starkware.co/starkex/spot/shared/README-off-chain-state.html#enforcing_consistency_in_the_on_chain_state_spot) ## Upgrades & Governance ## Updates Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/redsonic#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. Typically, the Operator is the hot wallet of the StarkEx service submitting state updates for which proofs have been already submitted and verified. **Risks** - MEV can be extracted if the operator exploits their centralized position and frontruns user transactions. **References** - [Operator - StarkEx documentation](https://docs.starkware.co/starkex/perpetual/shared/contract-management.html#operator_perpetual) ### 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** - [Censorship Prevention - StarkEx documentation](https://docs.starkware.co/starkex/architecture/solution-architecture.html#8-censorship-prevention) ## 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. When withdrawing NFTs they are minted on L1. **References** - [Withdrawal - StarkEx documentation](https://docs.starkware.co/starkex/spot/withdrawal.html) ### 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 Operations - StarkEx documentation](https://docs.starkware.co/starkex/spot/shared/README-forced-operations.html) - [Full Withdrawal - StarkEx documentation](https://docs.starkware.co/starkex/spot/spot-trading-full-withdrawals.html) ### Emergency exit If the enough time deadline passes and the forced exit is still ignored the user can put the system into a frozen state, disallowing further state updates. In that case everybody can withdraw by submitting a merkle proof of their funds with their L1 transaction. **References** - [Forced Operations - StarkEx documentation](https://docs.starkware.co/starkex/spot/shared/README-forced-operations.html) - [Full Withdrawal - StarkEx documentation](https://docs.starkware.co/starkex/spot/spot-trading-full-withdrawals.html) ## Permissions ### Ethereum #### Actors ##### Governor Addresses: [0x6b7763b749073e892c83E674c1EC4799D6f339Ef](https://etherscan.io/address/0x6b7763b749073e892c83E674c1EC4799D6f339Ef) Can upgrade implementation of the system, potentially gaining access to all funds stored in the bridge. Currently there is 0s delay before the upgrade. ##### 2 EOAs Addresses: [0x81165b6504520416487E5b4935865b4D3eeaa6e5](https://etherscan.io/address/0x81165b6504520416487E5b4935865b4D3eeaa6e5), [0x9eA52Cf33f7e52D24E205EF5fc5Fc425e9BeB8a0](https://etherscan.io/address/0x9eA52Cf33f7e52D24E205EF5fc5Fc425e9BeB8a0) Validity proof must be signed by at least 2 of these addresses to approve state update. ##### SHARP Verifier Governors Addresses: [0x21F9eC47b19d95b5C2DDFB6Ae5D4F92fAdacAEc4](https://etherscan.io/address/0x21F9eC47b19d95b5C2DDFB6Ae5D4F92fAdacAEc4) Can upgrade implementation of SHARP Verifier, potentially with code approving fraudulent state. Currently there is 8d delay before the upgrade. ##### SHARP Multisig Addresses: [0x21F9eC47b19d95b5C2DDFB6Ae5D4F92fAdacAEc4](https://etherscan.io/address/0x21F9eC47b19d95b5C2DDFB6Ae5D4F92fAdacAEc4) A Multisig with 2/4 threshold. SHARP Verifier Governor. ##### 2 EOAs Addresses: [0x5751a83170BeA11fE7CdA5D599B04153C021f21A](https://etherscan.io/address/0x5751a83170BeA11fE7CdA5D599B04153C021f21A), [0x2e1c08E457F0E0F462Ef99eC9271dc5BfAd88b2a](https://etherscan.io/address/0x2e1c08E457F0E0F462Ef99eC9271dc5BfAd88b2a) Allowed to update the state. When the Operator is down the state cannot be updated. ## Smart contracts ### Ethereum #### StarkExchange Addresses: [0xB62BcD40A24985f560b5a9745d478791d8F1945C](https://etherscan.io/address/0xB62BcD40A24985f560b5a9745d478791d8F1945C#code), [0xdF2f24751F7e84ccDCD39e7b49904FAB0Fb0f583](https://etherscan.io/address/0xdF2f24751F7e84ccDCD39e7b49904FAB0Fb0f583#code) (Implementation #1 (Upgradable)), [0xfbea22FeB369DB10C0d3a2aAa8F4939E76815f12](https://etherscan.io/address/0xfbea22FeB369DB10C0d3a2aAa8F4939E76815f12#code) (Implementation #2 (Upgradable)), [0x2Dbc18A3ac126abE1fF90A83Bbc3947ff7912Afb](https://etherscan.io/address/0x2Dbc18A3ac126abE1fF90A83Bbc3947ff7912Afb#code) (Implementation #3 (Upgradable)), [0x67e198743BC19fa4757720eDd0e769f8291e1F1D](https://etherscan.io/address/0x67e198743BC19fa4757720eDd0e769f8291e1F1D#code) (Implementation #4 (Upgradable)), [0x613ee54C54D5548627064B4D648942bF3648f376](https://etherscan.io/address/0x613ee54C54D5548627064B4D648942bF3648f376#code) (Implementation #5 (Upgradable)), [0xb2ED005D0278179001a49a9969BB22BA8e98f31F](https://etherscan.io/address/0xb2ED005D0278179001a49a9969BB22BA8e98f31F#code) (Implementation #6 (Upgradable)), [0xB5353268d8d4D711a92cb838F8fEDFC2A66E50Db](https://etherscan.io/address/0xB5353268d8d4D711a92cb838F8fEDFC2A66E50Db#code) (Implementation #7 (Upgradable)), [0x6b7763b749073e892c83E674c1EC4799D6f339Ef](https://etherscan.io/address/0x6b7763b749073e892c83E674c1EC4799D6f339Ef#code) (Admin) #### DACommittee Addresses: [0x4b2Bf1Cb06CB636e8A14540F76c477E61d8B6669](https://etherscan.io/address/0x4b2Bf1Cb06CB636e8A14540F76c477E61d8B6669#code) Data Availability Committee (DAC) contract verifying data availability claim from DAC Members (via multisig check). #### SHARPVerifierCallProxy Addresses: [0x47312450B3Ac8b5b8e247a6bB6d523e7605bDb60](https://etherscan.io/address/0x47312450B3Ac8b5b8e247a6bB6d523e7605bDb60#code), [0x3597c5CBCbCB30079a0bD2A68cDE5f98272f9feb](https://etherscan.io/address/0x3597c5CBCbCB30079a0bD2A68cDE5f98272f9feb#code) (Implementation (Upgradable)), [0x21F9eC47b19d95b5C2DDFB6Ae5D4F92fAdacAEc4](https://etherscan.io/address/0x21F9eC47b19d95b5C2DDFB6Ae5D4F92fAdacAEc4#code) (Admin) CallProxy for GpsStatementVerifier. #### SHARPVerifier Addresses: [0x4956bda1d23F75B988644329c5B06BD1494a72b6](https://etherscan.io/address/0x4956bda1d23F75B988644329c5B06BD1494a72b6#code) Starkware SHARP verifier used collectively by Starknet, Sorare, ImmutableX, Apex, Myria, rhino.fi and Canvas Connect. It receives STARK proofs from the Prover attesting to the integrity of the Execution Trace of these Programs including correctly computed state root which is part of the Program Output. #### FriStatementContract Addresses: [0x30EfaAA99f8eFe310D9FdC83072e2a04c093d400](https://etherscan.io/address/0x30EfaAA99f8eFe310D9FdC83072e2a04c093d400#code) Part of STARK Verifier. #### MerkleStatementContract Addresses: [0x32a91Ff604AB2aDCd832e91D68b2f3f25358FdAd](https://etherscan.io/address/0x32a91Ff604AB2aDCd832e91D68b2f3f25358FdAd#code) Part of STARK Verifier. #### CairoBootloaderProgram Addresses: [0x24105e6697AdD9B4B1BDE04079a91BDFCCa24A47](https://etherscan.io/address/0x24105e6697AdD9B4B1BDE04079a91BDFCCa24A47#code) Part of STARK Verifier. #### MemoryPageFactRegistry Addresses: [0xe583BcDE0160b637330b27a3ea1F3c02ba2eC460](https://etherscan.io/address/0xe583BcDE0160b637330b27a3ea1F3c02ba2eC460#code) MemoryPageFactRegistry is one of the many contracts used by SHARP verifier. This one is important as it registers all necessary onchain data. The current deployment carries some associated risks: - Funds can be stolen if a contract receives a malicious code upgrade. There is no delay on code upgrades (CRITICAL).