---
eip: 6968
label: EIP-6968
title: Contract Secured Revenue on an EVM based L2
status: Stagnant
type: Standards Track
category: Core
created: 2023-05-01
official: https://eips.ethereum.org/EIPS/eip-6968
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-6968.md
canonical: https://eips.huatuo.xyz/eip-6968/
lang: en
tldr: "Proposes that EVM-based L2s share part of each transaction's base fee with the contracts that consumed the gas, giving developers protocol-level revenue (Contract Secured Revenue)."
tags: [l2, fees, revenue, opcode, core]
---

# EIP-6968: Contract Secured Revenue on an EVM based L2

> Contract Secured Revenue on an EVM based L2

**TL;DR:** Proposes that EVM-based L2s share part of each transaction's base fee with the contracts that consumed the gas, giving developers protocol-level revenue (Contract Secured Revenue).

## What problem does it solve?

On Ethereum, transaction fees go to the protocol (the burned base fee) and to the block producer (the tip). The developers of the contracts that users actually interact with receive nothing at the protocol level, so they have to add their own fees or token schemes to fund development or public goods.

Contract Secured Revenue (CSR) gives a share of fees back to the contracts that did the work. EIP-6968 explicitly does **not** propose this for Ethereum L1. It describes how an EVM-based **L2** could adopt CSR to attract developers and fund public goods.

## How it works

1. **Gas tracking per address.** During a transaction the client keeps `gas_used_by_address`. Each instruction's gas is charged to the contract currently executing. For call and create instructions, only the caller's own cost is counted (total cost minus the gas forwarded to the child frame, per [EIP-150](/eip-150/)). On an out-of-gas error, the frame's remaining gas is counted too.
2. **Revenue recipient.** By default a contract's revenue goes to itself. A new opcode **`SETREVENUERECIPIENT` (`0x49`)**, costing 3 gas, lets a contract point its revenue at another address. The mapping is rebuilt every transaction, so a contract has to call the opcode during execution for the redirect to apply.
3. **Payout.** After the transaction, each tracked address's recipient is credited:

```text
revenue = gas_used * (base_fee_per_gas // REVENUE_SHARE_QUOTIENT)   # REVENUE_SHARE_QUOTIENT = 5
```

With a quotient of 5, roughly one fifth of the base fee for the gas a contract used is redirected to it instead of being burned. Externally owned accounts receive nothing, because they do not execute code.

Splitting by gas used, rather than paying everything to the transaction's `to` address, rewards every contract in a composed call chain and works with smart contract wallets, which are often the first contract called.

## Sample code

A contract redirecting its revenue to a treasury. Solidity has no keyword for the new opcode, so this is pseudocode for what the contract would execute on a chain implementing the EIP:

```text
// inside doWork(), before the main logic
PUSH20 <treasury address>
SETREVENUERECIPIENT        // opcode 0x49, 3 gas, pops 1 item
// ... rest of the function; gas used by this contract in this
// transaction now earns revenue for <treasury address>
```

Client-side payout logic:

```python
for addr, gas in gas_used_by_address.items():
    recipient = revenue_recipient.get(addr, addr)
    state.add_balance(recipient, gas * (header.base_fee_per_gas // REVENUE_SHARE_QUOTIENT))
```

## Things to know

- **Status: Stagnant.** It is a design for L2s to consider, not something Ethereum L1 will adopt.
- The spec text is inconsistent: the fee-mechanism paragraph says `base_fee * REVENUE_SHARE_QUOTIENT`, while the payout formula divides by it. The payout formula (division, about 20 %) is the one that makes sense.
- Opcode `0x49` was later assigned to `BLOBHASH` on Ethereum by [EIP-4844](/eip-4844/), so a chain adopting this would need a different opcode.
- Paying contracts per unit of gas creates an incentive to burn gas deliberately. The spec notes possible effects on block size and complexity but does not fully analyse gas-farming.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-6968
