# Earnm Markdown version of https://l2beat.com/layer2s/projects/earnm ## Summary **Warning:** There are impactful changes and part of the information might be outdated. **Warning:** Critical contracts can be upgraded by an EOA which could result in the loss of all funds. - Total Value Secured: $0.00 (0.00% compared to seven days ago; canonically bridged $0.00, 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) - Past day UOPS: 0.05 (+23.1% compared to seven days ago) - Gas token: ETH - Type: Other - Purposes: Universal, Social - Host chain: Arbitrum One - Chain ID: 32766 ### Risks - Sequencer failure: Self sequence (sentiment: good) - State validation: Fraud proofs (INT) (sentiment: bad) - Data availability: External (DAC) (sentiment: bad) - Exit window: None (sentiment: bad) - Proposer failure: Self propose (sentiment: good) ### About Earnm is a mobile-first Orbit stack L3 on Arbitrum that converts everyday mobile activity into cryptocurrency rewards through its EarnOS technology. ## Value Secured Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/earnm#tvs). - [TVS chart (JSON)](https://l2beat.com/api/scaling/tvs/earnm) - [TVS breakdown by token (JSON)](https://l2beat.com/api/scaling/tvs/earnm/breakdown) ## Activity Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/earnm#activity). - [Activity chart (JSON)](https://l2beat.com/api/scaling/activity/earnm) ## Risk summary **Warning:** Fraud proof system is fully deployed but is not yet permissionless as it requires Validators to be whitelisted. ### Funds can be stolen if 1. a contract receives a malicious code upgrade. There is no delay on code upgrades, (CRITICAL) 2. none of the whitelisted verifiers checks the published state. Fraud proofs assume at least one honest and able validator (CRITICAL). ### Funds can be lost if 3. the external data becomes unavailable (CRITICAL). ### Users can be censored if 4. the committee restricts their access to the external data. ### MEV can be extracted if 5. the operator exploits their centralized position and frontruns user transactions. ## Risk analysis The L3 risks depend on the individual properties of L3 and those of the host chain combined. **Warning:** Critical contracts can be upgraded by an EOA which could result in the loss of all funds. **Warning:** Fraud proof system is fully deployed but is not yet permissionless as it requires Validators to be whitelisted. The risks below reflect combined L2 & L3 risks. ### Sequencer failure Self sequence (sentiment: good) In the event of a sequencer failure, users can force transactions to be included in the project's chain by sending them to L1. There can be up to a 5d delay on this operation. ### State validation Fraud proofs (INT) (sentiment: bad) No actor outside of the single Proposer can submit fraud proofs. Interactive proofs (INT) require multiple transactions over time to resolve. The challenge protocol can be subject to delay attacks. There is a 6d 8h challenge period. ### 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/3 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 Self propose (sentiment: good) Anyone can become a Proposer after 12d 17h of inactivity from the currently whitelisted Proposers. ## Stage Earnm is not even a Stage 0 project. **Warning:** The requirement for available node software is under review. ### Stage 0 - [x] The project self-identifies as a Validium or Optimium. - [x] State roots are posted to Ethereum L1. - [x] A complete and functional proof system (fraud or validity proofs) is deployed. - [ ] (under review) A source-available node exists that can reconstruct the L2 state when DA is accessible. Please note that the L2BEAT team has not verified the validity of the node source code. - [ ] Fraud proof submission is not sufficiently decentralized. ### Stage 1 - [ ] Principle: Compromising ≥75% of the Security Council to push a malicious upgrade, or sequencer+DA-committee collusion to withhold data and finalize invalid state roots, should be the only ways (other than bugs) to steal funds or block withdrawals indefinitely. - [x] Users are able to exit without the help of the permissioned operators, provided DA is accessible. - [ ] 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. - [ ] The Security Council is not properly set up. - [x] The sources of all programs used are public and program hashes can be independently regenerated. ### Stage 2 - [ ] Fraud proof submission is open only to whitelisted actors. - [ ] Upgrades unrelated to onchain provable bugs, including upgrades to the DA verifier, provide less than 30d to exit. - [ ] The Security Council's actions are not confined to onchain provable bugs. ## Data availability ### Data is not stored on chain Users transactions are not published onchain, but rather sent to external trusted parties, also known as committee members (DAC). Members of the DAC collectively produce a Data Availability Certificate (comprising BLS signatures from a quorum) guaranteeing that the data behind the new transaction batch will be available until the expiry period elapses (currently a minimum of two weeks). This signature is not verified by L1, however external Validators will skip the batch if BLS signature is not valid resulting. This will result in a fraud proof challenge if this batch is included in a consecutive state update. It is assumed that at least one honest DAC member that signed the batch will reveal tx data to the Validators if Sequencer decides to act maliciously and withhold the data. If the Sequencer cannot gather enough signatures from the DAC, it will "fall back to rollup" mode and by posting the full data directly to the L1 chain. The current DAC threshold is 2 out of 3. **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** - [Inside AnyTrust - Arbitrum documentation](https://developer.offchainlabs.com/inside-anytrust) ## State validation Updates to the system state can be proposed and challenged by a set of whitelisted validators. If a state root passes the challenge period, it is optimistically considered correct and made actionable for withdrawals. ### State root proposals Whitelisted validators propose state roots as children of a previous state root. A state root can have multiple conflicting children. This structure forms a graph, and therefore, in the contracts, state roots are referred to as nodes. Each proposal requires a stake, currently set to 0.1 ETH, that can be slashed if the proposal is proven incorrect via a fraud proof. Stakes can be moved from one node to one of its children, either by calling `stakeOnExistingNode` or `stakeOnNewNode`. New nodes cannot be created faster than the minimum assertion period by the same validator, currently set to 15m. The oldest unconfirmed node can be confirmed if the challenge period has passed and there are no siblings, and rejected if the parent is not a confirmed node or if the challenge period has passed and no one is staked on it. **Risks** - Funds can be stolen if none of the whitelisted verifiers checks the published state. Fraud proofs assume at least one honest and able validator (CRITICAL). **References** - [How is fraud proven - Arbitrum documentation FAQ](https://docs.arbitrum.io/get-started/arbitrum-introduction) ### Challenges A challenge can be started between two siblings, i.e. two different state roots that share the same parent, by calling the `startChallenge` function. Validators cannot be in more than one challenge at the same time, meaning that the protocol operates with [partial concurrency](https://medium.com/l2beat/fraud-proof-wars-b0cb4d0f452a). Since each challenge lasts 6d 8h, this implies that the protocol can be subject to [delay attacks](https://medium.com/offchainlabs/solutions-to-delay-attacks-on-rollups-434f9d05a07a), where a malicious actor can delay withdrawals as long as they are willing to pay the cost of losing their stakes. If the protocol is delayed attacked, the new stake requirement increases exponentially for each challenge period of delay. Challenges are played via a bisection game, where asserter and challenger play together to find the first instruction of disagreement. Such instruction is then executed onchain in the WASM OneStepProver contract to determine the winner, who then gets half of the stake of the loser. As said before, a state root is rejected only when no one left is staked on it. The protocol does not enforces valid bisections, meaning that actors can propose correct initial claim and then provide incorrect midpoints. **References** - [Fraud Proof Wars: Arbitrum Classic](https://medium.com/l2beat/fraud-proof-wars-b0cb4d0f452a) ## Upgrades & Governance ## Updates Shown as an interactive chart or widget on [the HTML page](https://l2beat.com/layer2s/projects/earnm#updates). ## Operator ### The system has a centralized sequencer While forcing transaction is open to anyone the system employs a privileged sequencer that has priority for submitting transaction batches and ordering transactions. **Risks** - MEV can be extracted if the operator exploits their centralized position and frontruns user transactions. **References** - [Sequencer - Arbitrum documentation](https://docs.arbitrum.io/how-arbitrum-works/inside-arbitrum-nitro#the-sequencer) ### Users can force any transaction Because the state of the system is based on transactions submitted on the underlying host chain and anyone can submit their transactions there it allows the users to circumvent censorship by interacting with the smart contract on the host chain directly. After a delay of 4d in which a Sequencer has failed to include a transaction that was directly posted to the smart contract, it can be forcefully included by anyone on the host chain, which finalizes its ordering. **References** - [SequencerInbox.sol - source code, forceInclusion function](https://arbiscan.io/address/0x7be08B013de2b23a6329De51C4994f841dcE1a10#code) - [Sequencer Isn't Doing Its Job - Arbitrum documentation](https://docs.arbitrum.io/how-arbitrum-works/sequencer#unhappyuncommon-case-sequencer-isnt-doing-its-job) ## Sequencing ### Delayed forced transactions To force transactions from the host chain, users must first enqueue "delayed" messages in the "delayed" inbox of the Bridge contract. Only authorized Inboxes are allowed to enqueue delayed messages, and the so-called Inbox contract is the one used as the entry point by calling the `sendMessage` or `sendMessageFromOrigin` functions. If the centralized sequencer doesn't process the request within some time bound, users can call the `forceInclusion` function on the SequencerInbox contract to include the message in the canonical chain. The time bound is hardcoded to be 4d. ## Withdrawals ### Regular messaging The user initiates L2->L1 messages by submitting a regular transaction on this chain. When the block containing that transaction is settled, the message becomes available for processing on L1. The process of block finalization usually takes several days to complete. **References** - [Transaction lifecycle - Arbitrum documentation](https://developer.offchainlabs.com/tx-lifecycle) - [L2 to L1 Messages - Arbitrum documentation](https://docs.arbitrum.io/how-arbitrum-works/deep-dives/l2-to-l1-messaging) - [Mainnet for everyone - Arbitrum Blog](https://offchain.medium.com/mainnet-for-everyone-27ce0f67c85e) ### Autonomous exit Users can (eventually) exit the system by pushing the transaction on L1 and providing the corresponding state root. The only way to prevent such withdrawal is via an upgrade. ## Other considerations ### EVM compatible smart contracts are supported Arbitrum One uses Nitro technology that allows running fraud proofs by executing EVM code on top of WASM. **References** - [Inside Arbitrum Nitro](https://developer.offchainlabs.com/inside-arbitrum-nitro/) ## Permissions ### Arbitrum One #### Actors ##### SafeL2 Addresses: [0x871e290d5447b958131F6d44f915F10032436ee6](https://arbiscan.io/address/0x871e290d5447b958131F6d44f915F10032436ee6) A Multisig with 5/8 threshold. * Can upgrade **with no delay** * ChallengeManager [via: UpgradeExecutor → ProxyAdmin] * SequencerInbox [via: UpgradeExecutor → ProxyAdmin] * Outbox [via: UpgradeExecutor → ProxyAdmin] * Inbox [via: UpgradeExecutor → ProxyAdmin] * Bridge [via: UpgradeExecutor → ProxyAdmin] * RollupEventInbox [via: UpgradeExecutor → ProxyAdmin] * RollupProxy [via: UpgradeExecutor] * UpgradeExecutor [via: UpgradeExecutor → ProxyAdmin] * Can interact with RollupProxy * Pause and unpause and set important roles and parameters in the system contracts: Can delegate Sequencer management to a BatchPosterManager address, manage data availability, DACs and the fastConfirmer role, set the Sequencer-only window, introduce an allowList to the bridge and whitelist Inboxes/Outboxes [via: UpgradeExecutor] ##### EOA 1 Addresses: [0xe5e3eEC4c5F443B04C5c883384674FD9e3eA93D9](https://arbiscan.io/address/0xe5e3eEC4c5F443B04C5c883384674FD9e3eA93D9) * Can upgrade **with no delay** * ChallengeManager [via: UpgradeExecutor → ProxyAdmin] * SequencerInbox [via: UpgradeExecutor → ProxyAdmin] * Outbox [via: UpgradeExecutor → ProxyAdmin] * Inbox [via: UpgradeExecutor → ProxyAdmin] * Bridge [via: UpgradeExecutor → ProxyAdmin] * RollupEventInbox [via: UpgradeExecutor → ProxyAdmin] * RollupProxy [via: UpgradeExecutor] * UpgradeExecutor [via: UpgradeExecutor → ProxyAdmin] * Can interact with RollupProxy * Pause and unpause and set important roles and parameters in the system contracts: Can delegate Sequencer management to a BatchPosterManager address, manage data availability, DACs and the fastConfirmer role, set the Sequencer-only window, introduce an allowList to the bridge and whitelist Inboxes/Outboxes [via: UpgradeExecutor] ##### EOA 2 Addresses: [0x702a73680122D6EA59c275c6c6978811fD581B2e](https://arbiscan.io/address/0x702a73680122D6EA59c275c6c6978811fD581B2e) * Can interact with RollupProxy * Can propose new state roots (called nodes) and challenge state roots on the host chain ##### EOA 3 Addresses: [0xe12128A5c958b299c7F033D1D52F90feb12De81D](https://arbiscan.io/address/0xe12128A5c958b299c7F033D1D52F90feb12De81D) * Can interact with SequencerInbox * Can submit transaction batches or commitments to the SequencerInbox contract on the host chain ## Smart contracts ### Arbitrum One #### ChallengeManager Addresses: [0x3131627362AD79b3D831559E0AfC986BF60A6870](https://arbiscan.io/address/0x3131627362AD79b3D831559E0AfC986BF60A6870#code), [0x079840Cc8959Ef60d414E5AFC6ED0493b8eAf514](https://arbiscan.io/address/0x079840Cc8959Ef60d414E5AFC6ED0493b8eAf514#code) (Implementation (Upgradable)), [0x8D9e5bB33Da252739780e3df5F9E686fd11E0536](https://arbiscan.io/address/0x8D9e5bB33Da252739780e3df5F9E686fd11E0536#code) (Admin) Contract that allows challenging state roots. Can be called through the RollupProxy by Validators or the UpgradeExecutor. * Roles: * **admin**: ProxyAdmin; ultimately EOA 1, SafeL2 Can be upgraded by: SafeL2 with no delay, EOA 1 with no delay #### SequencerInbox Addresses: [0x38d41Ac2fbc3f13FcA7838F6638D8FbDb189e807](https://arbiscan.io/address/0x38d41Ac2fbc3f13FcA7838F6638D8FbDb189e807#code), [0x7be08B013de2b23a6329De51C4994f841dcE1a10](https://arbiscan.io/address/0x7be08B013de2b23a6329De51C4994f841dcE1a10#code) (Implementation (Upgradable)), [0x8D9e5bB33Da252739780e3df5F9E686fd11E0536](https://arbiscan.io/address/0x8D9e5bB33Da252739780e3df5F9E686fd11E0536#code) (Admin) A sequencer (registered in this contract) can submit transaction batches or commitments here. * Roles: * **admin**: ProxyAdmin; ultimately EOA 1, SafeL2 * **batchPosters**: EOA 3 Can be upgraded by: SafeL2 with no delay, EOA 1 with no delay #### Bridge Addresses: [0xA9F4ee72439afC704db48dc049CbFb7E914aD300](https://arbiscan.io/address/0xA9F4ee72439afC704db48dc049CbFb7E914aD300#code), [0x234e937F1a2926737b0084Fb7498772579497735](https://arbiscan.io/address/0x234e937F1a2926737b0084Fb7498772579497735#code) (Implementation (Upgradable)), [0x8D9e5bB33Da252739780e3df5F9E686fd11E0536](https://arbiscan.io/address/0x8D9e5bB33Da252739780e3df5F9E686fd11E0536#code) (Admin) Escrow contract for the project's gas token (can be different from ETH). Keeps a list of allowed Inboxes and Outboxes for canonical bridge messaging. * Roles: * **admin**: ProxyAdmin; ultimately EOA 1, SafeL2 Can be upgraded by: SafeL2 with no delay, EOA 1 with no delay #### RollupProxy Addresses: [0xc930fd48846e956b308f28524dA2d5E14c832e33](https://arbiscan.io/address/0xc930fd48846e956b308f28524dA2d5E14c832e33#code), [0xF9725312bd91CcfA3aD797e78A8A10b6d692FCd6](https://arbiscan.io/address/0xF9725312bd91CcfA3aD797e78A8A10b6d692FCd6#code) (Implementation #1 (Upgradable)), [0xF916Bfe431B7A7AaE083273F5b862e00a15d60F4](https://arbiscan.io/address/0xF916Bfe431B7A7AaE083273F5b862e00a15d60F4#code) (Implementation #2 (Upgradable)), [0xcD3D1CFE5e0cDa77D0a2D1ac1c0268C77115f89D](https://arbiscan.io/address/0xcD3D1CFE5e0cDa77D0a2D1ac1c0268C77115f89D#code) (Admin) Central contract for the project's configuration like its execution logic hash (`wasmModuleRoot`) and addresses of the other system contracts. Entry point for Proposers creating new Rollup Nodes (state commitments) and Challengers submitting fraud proofs (In the Orbit stack, these two roles are both held by the Validators). * Roles: * **admin**: UpgradeExecutor; ultimately EOA 1, SafeL2 * **owner**: UpgradeExecutor; ultimately EOA 1, SafeL2 * **validators**: EOA 2 Can be upgraded by: SafeL2 with no delay, EOA 1 with no delay #### UpgradeExecutor Addresses: [0xcD3D1CFE5e0cDa77D0a2D1ac1c0268C77115f89D](https://arbiscan.io/address/0xcD3D1CFE5e0cDa77D0a2D1ac1c0268C77115f89D#code), [0x12B1389Fbf261E781bdc3094d28636Abfb03C5b3](https://arbiscan.io/address/0x12B1389Fbf261E781bdc3094d28636Abfb03C5b3#code) (Implementation (Upgradable)), [0x8D9e5bB33Da252739780e3df5F9E686fd11E0536](https://arbiscan.io/address/0x8D9e5bB33Da252739780e3df5F9E686fd11E0536#code) (Admin) Central contract defining the access control permissions for upgrading the system contract implementations. * Roles: * **admin**: ProxyAdmin; ultimately EOA 1, SafeL2 * **executors**: EOA 1, SafeL2 Can be upgraded by: SafeL2 with no delay, EOA 1 with no delay #### Outbox Addresses: [0x39919941b42DAb335d9924Ef56dF7b9813b2D6d9](https://arbiscan.io/address/0x39919941b42DAb335d9924Ef56dF7b9813b2D6d9#code), [0xCf66F830c4e5E1904B599ED61249601901E55D89](https://arbiscan.io/address/0xCf66F830c4e5E1904B599ED61249601901E55D89#code) (Implementation (Upgradable)), [0x8D9e5bB33Da252739780e3df5F9E686fd11E0536](https://arbiscan.io/address/0x8D9e5bB33Da252739780e3df5F9E686fd11E0536#code) (Admin) Facilitates L2 to L1 contract calls: Messages initiated from L2 (for example withdrawal messages) eventually resolve in execution on L1. * Roles: * **admin**: ProxyAdmin; ultimately EOA 1, SafeL2 Can be upgraded by: SafeL2 with no delay, EOA 1 with no delay #### Inbox Addresses: [0x446626827f14F89B38D5bA1ab152B484cd7912fD](https://arbiscan.io/address/0x446626827f14F89B38D5bA1ab152B484cd7912fD#code), [0xD87f160f8c414d834cBDd9477c3D8c3ad1802255](https://arbiscan.io/address/0xD87f160f8c414d834cBDd9477c3D8c3ad1802255#code) (Implementation (Upgradable)), [0x8D9e5bB33Da252739780e3df5F9E686fd11E0536](https://arbiscan.io/address/0x8D9e5bB33Da252739780e3df5F9E686fd11E0536#code) (Admin) Facilitates sending L1 to L2 messages like depositing ETH, but does not escrow funds. * Roles: * **admin**: ProxyAdmin; ultimately EOA 1, SafeL2 Can be upgraded by: SafeL2 with no delay, EOA 1 with no delay #### OneStepProverMemory Addresses: [0x09fDA6447fA7758EA9245ac78Ca3c9ba68CBfd3d](https://arbiscan.io/address/0x09fDA6447fA7758EA9245ac78Ca3c9ba68CBfd3d#code) One of the modular contracts used for the last step of a fraud proof, which is simulated inside a WASM virtual machine. #### OneStepProverHostIo Addresses: [0x3930AD9a21dA38E63d52B43b0c530CB0AACcB389](https://arbiscan.io/address/0x3930AD9a21dA38E63d52B43b0c530CB0AACcB389#code) One of the modular contracts used for the last step of a fraud proof, which is simulated inside a WASM virtual machine. #### ProxyAdmin Addresses: [0x8D9e5bB33Da252739780e3df5F9E686fd11E0536](https://arbiscan.io/address/0x8D9e5bB33Da252739780e3df5F9E686fd11E0536#code) * Roles: * **owner**: UpgradeExecutor #### ValidatorUtils Addresses: [0xa0d6E6b1B950aCC748B45F3419FeAd4b52f7389A](https://arbiscan.io/address/0xa0d6E6b1B950aCC748B45F3419FeAd4b52f7389A#code) This contract implements view only utilities for validators. #### OneStepProofEntry Addresses: [0xA6D1cE7210353E431CE79f41BcFA9Ea3Ae507b98](https://arbiscan.io/address/0xA6D1cE7210353E431CE79f41BcFA9Ea3Ae507b98#code) One of the modular contracts used for the last step of a fraud proof, which is simulated inside a WASM virtual machine. #### RollupEventInbox Addresses: [0xAc9348017885a132F1A0614B508F632A56B90ec4](https://arbiscan.io/address/0xAc9348017885a132F1A0614B508F632A56B90ec4#code), [0x3e9A459089758E760bEA267aBB9485EE5b47a909](https://arbiscan.io/address/0x3e9A459089758E760bEA267aBB9485EE5b47a909#code) (Implementation (Upgradable)), [0x8D9e5bB33Da252739780e3df5F9E686fd11E0536](https://arbiscan.io/address/0x8D9e5bB33Da252739780e3df5F9E686fd11E0536#code) (Admin) Helper contract sending configuration data over the bridge during the systems initialization. * Roles: * **admin**: ProxyAdmin; ultimately EOA 1, SafeL2 Can be upgraded by: SafeL2 with no delay, EOA 1 with no delay #### OneStepProverMath Addresses: [0xD3dE403eADdf791104918E9C9336B434AE7DDA01](https://arbiscan.io/address/0xD3dE403eADdf791104918E9C9336B434AE7DDA01#code) One of the modular contracts used for the last step of a fraud proof, which is simulated inside a WASM virtual machine. #### OneStepProver0 Addresses: [0xF5f5bc097ca8f4bE96D8CdE86c96Bd2d81fd2585](https://arbiscan.io/address/0xF5f5bc097ca8f4bE96D8CdE86c96Bd2d81fd2585#code) One of the modular contracts used for the last step of a fraud proof, which is simulated inside a WASM virtual machine. 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).