diff --git a/specs/SUMMARY.md b/specs/SUMMARY.md index 6e96eeea4..17c9ef86c 100644 --- a/specs/SUMMARY.md +++ b/specs/SUMMARY.md @@ -20,6 +20,7 @@ - [Batch Submitter](./protocol/batcher.md) - [Predeploys](./protocol/predeploys.md) - [Preinstalls](./protocol/preinstalls.md) + - [Revenue Sharing](./protocol/revenue-sharing.md) - [Superchain]() - [Superchain Configuration](./protocol/superchain-configuration.md) - [Superchain Upgrades](./protocol/superchain-upgrades.md) diff --git a/specs/protocol/exec-engine.md b/specs/protocol/exec-engine.md index e9d92f14e..da2c021ab 100644 --- a/specs/protocol/exec-engine.md +++ b/specs/protocol/exec-engine.md @@ -81,7 +81,7 @@ The three types of fees are collected in 3 distinct L2 fee-vault deployments for fee payments are not registered as internal EVM calls, and thus distinguished better this way. These are hardcoded addresses, pointing at pre-deployed proxy contracts. -The proxies are backed by vault contract deployments, based on `FeeVault`, to route vault funds to L1 securely. +The proxies are backed by vault contract deployments, based on `FeeVault`. Funds are moved on from these vaults according to [Revenue Sharing](./revenue-sharing.md). | Vault Name | Predeploy | | ------------------- | ------------------------------------------------------ | diff --git a/specs/protocol/predeploys.md b/specs/protocol/predeploys.md index da83b5349..9c76162e5 100644 --- a/specs/protocol/predeploys.md +++ b/specs/protocol/predeploys.md @@ -23,6 +23,7 @@ - [L1FeeVault](#l1feevault) - [SchemaRegistry](#schemaregistry) - [EAS](#eas) +- [RevenueSharer](#revenuesharer) @@ -69,6 +70,7 @@ or `Bedrock` or `Canyon`. Deprecated contracts should not be used. | L1FeeVault | 0x420000000000000000000000000000000000001a | Bedrock | No | Yes | | SchemaRegistry | 0x4200000000000000000000000000000000000020 | Bedrock | No | Yes | | EAS | 0x4200000000000000000000000000000000000021 | Bedrock | No | Yes | +| RevenueSharer | 0x4200000000000000000000000000000000000024 | TBC | No | Yes | ## LegacyMessagePasser @@ -344,3 +346,13 @@ protocol. Address: `0x4200000000000000000000000000000000000021` The `EAS` predeploy implements the `Ethereum Attestation Service` protocol. + +## RevenueSharer +[Implementation](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/RevenueSharer.sol) + + +Address: `0x4200000000000000000000000000000000000024` + +The `RevenueSharer` predepoly implements Revenue Sharing, disbursing funds from FeeVault contracts to the Optimism Collective. \ No newline at end of file diff --git a/specs/protocol/revenue-sharing.md b/specs/protocol/revenue-sharing.md new file mode 100644 index 000000000..cf1c8553a --- /dev/null +++ b/specs/protocol/revenue-sharing.md @@ -0,0 +1,80 @@ +# Revenue Sharing + + +**Table of Contents** + +- [Overview](#overview) + - [Definitions](#definitions) + - [`RevenueSharer` predeploy](#revenuesharer-predeploy) + - [Invariants](#invariants) + - [Deploying `RevenueSharer`](#deploying-revenuesharer) + - [Existing Chains](#existing-chains) + - [Execution](#execution) + - [Simplified L1 Data Fee Expenditure](#simplified-l1-data-fee-expenditure) + + + +# Overview + +Revenue sharing is the process by which chains in the superchain contribute a portion of their revenue or profit to a beneficiary such as the Optimism collective. They may do this in return for support with the OP Stack and/or other benefits. + + +## Definitions +| Term | Name | Definition | +| -------|--------------| ----------- | +| $d$ | L1 Data Fee Revenue | ETH transferred to the sequencer with L2 transactions to cover estimated L1 Data Fees(see below). Accumulates to `L1FeeVault`. +| $e$ | L1 Data Fee Expenditure| ETH spent by the batcher on L1 to make transaction data available +| $b$ | L2 Base Gas Revenue | Base fee portion of L2 Gas Fee (ETH transferred to the sequencer to cover execution of L2 transactions). Accumulates to `BaseFeeVault`. +| $q$ | L2 Priority Gas Revenue | Priority fee portion of L2 Gas Fee (ETH transferred to the sequencer to cover execution of L2 transactions). Accumulates to `SequencerFeeVault`. +| $g$ | L2 Gas Revenue | $b + q$ +| $r$ | Sequencer Revenue | $d + b + q$ +| $p$ | Sequencer Profit | $r - e$ +| $s$ | Revenue share due to `BENEFICIARY`| $\max(0.15r,0.025p)$ +| `BENEFICIARY` | e.g. Optimism Collective | +| `REMAINDER_BENEFICIARY` | e.g. Chain Operator | + +## `RevenueSharer` predeploy +Revenue sharing is achieved through an L2 [predeploy](./predeploys.md) contract `RevenueSharer` with address `0x4200000000000000000000000000000000000024`. + +### Invariants +* The `RevenueSharer` contract should not accumulate any ETH or Tokens itself. +* It should share revenue in the propotions `s, r-s` when the `execute()` function is called, to `BENEFICIARY` and `REMAINDER_BENEFICIARY` respectively. +* It should emit an event when `execute()` is called. + +### Deploying `RevenueSharer` + +The `RevenueSharer` contract is now included in the L2 genesis and is not scheduled to be part of a hardfork. + +#### Existing Chains +For chains without the `RevenueSharer` in their genesis, the following transactions may be executed to deploy it +: +1. The `RevenueSharer` should be deployed manually to an arbitrary address `REVENUE_SHARER_IMPLEMENTATION_ADDRESS` +2. For EACH of the three FeeVault contracts ({name} = BASE, L1, SEQUENCER): + + a. A new version should be deployed with the `RECIPIENT` variable set to `0x4200000000000000000000000000000000000024` in the constructor, and other constructor parameters set to existing values. This contract has an arbitrary address `NEW_{name}_FEE_VAULT_ADDRESS`. + b. The ProxyAdminOwner should call `ProxyAdmin.upgrade({name}_FEE_VAULT, NEW_{name}_FEE_VAULT_ADDRESS)` + +### Execution +Revenue sharing is executed periodically, and can be configured to send funds to L1 or to L2. +The `RevenueSharer` is responsible for computing $s$ and sending it to a predetermined address controlled by the Optimism Collective. At the end of execution, `SequencerFeeVault`, `L1FeeVault` and `BaseFeeVault` and `RevenueSharer` should be completely depleted of ETH. This allows the contract to be stateless. + +```mermaid + flowchart TD + SequencerFeeVault + BaseFeeVault + L1FeeVault + BeneficiaryWallet + RemainderWallet + RevenueSharer + SequencerFeeVault-->|q|RevenueSharer + L1FeeVault-->|d|RevenueSharer + BaseFeeVault-->|b|RevenueSharer + RevenueSharer-->|s|BeneficiaryWallet + RevenueSharer-->|r-s|RemainderWallet +``` + +The execution of Revenue Sharing is achieved by calling `RevenueSharer.execute()`. + +## Simplified L1 Data Fee Expenditure +As a part of a gradual rollout of protocol enshrined revenue sharing, the `RevenueSharer` uses a fixed value of $e=0$. The sequencer makes a profit on data availability of $d-e$. Note that a negative profit, i.e. a loss, is possible. By assuming $e=0$, the simplification implies that data availability revenue is all profit. This will be addressed in a future protocol upgrade. + diff --git a/specs/protocol/superchain-upgrades.md b/specs/protocol/superchain-upgrades.md index 9b05845c8..c28f55f72 100644 --- a/specs/protocol/superchain-upgrades.md +++ b/specs/protocol/superchain-upgrades.md @@ -257,7 +257,8 @@ but the matching L1-origin information may not be present at the time of activat [Governance Proposal](https://gov.optimism.io/t/final-upgrade-proposal-2-canyon-network-upgrade/7088). - `v5.0.0`: 2024 Feb 22nd - Delta network upgrade (Span Batches). [Governance Proposal](https://gov.optimism.io/t/final-upgrade-proposal-3-delta-network-upgrade/7310). -- `v6.0.0`: 2024 Mar 14th - Ecotone network upgrade (4844 Blob Batches + Cancun). +- `v6.0.0`: 2024 Mar 14th - _Proposed_ Ecotone network upgrade (4844 Blob Batches + Cancun). + Still under review by governance. [Governance Proposal](https://gov.optimism.io/t/upgrade-proposal-5-ecotone-network-upgrade/7669). ## Post-Bedrock Network upgrades diff --git a/specs/root.md b/specs/root.md index feaa475cf..286f6818c 100644 --- a/specs/root.md +++ b/specs/root.md @@ -32,6 +32,7 @@ that maintains 1:1 compatibility with Ethereum. - [Bridges](protocol/bridges.md) - [Predeploys](protocol/predeploys.md) - [Preinstalls](protocol/preinstalls.md) +- [Revenue Sharing](protocol/revenue-sharing.md) - [Glossary](glossary.md) ### Experimental