Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ERC: ERC for Exit Format in State Channels #728

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mod
Copy link

@mod mod commented Nov 22, 2024

Pull Request Description

EIP Title

ERC-7825: State Channels Protocol with Account Abstraction

Description

This ERC introduces a standard for implementing Nitro Protocol-based state channels on Ethereum, integrated with ERC-4337 account abstraction. The proposal defines the essential structs and interfaces for Nitro-based state channels, enabling scalable off-chain execution, efficient on-chain dispute resolution, and enhanced interoperability. By leveraging ERC-4337, this standard allows programmable wallets to interact directly with Nitro state channels and supports custom plugins for state validation using NitroApps.

Author

Louis Bellet (<mod@yellow.org>)

Status

Draft

Type

Standards Track (ERC)

Category

ERC

Build Status

All required builds have passed successfully. The proposal adheres to the provided guidelines and submission criteria.

Notes

This pull request creates a new draft EIP for ERC-7250 and follows the template provided in [EIP-1](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1.md). The proposal aims to facilitate scalable state channel implementations on Ethereum while aligning with existing standards for account abstraction.

@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Nov 22, 2024

File ERCS/erc-7824.md

Requires 1 more reviewers from @g11tech, @SamWilsn, @xinbenlv

File ERCS/erc-7825.md

Requires 1 more reviewers from @g11tech, @SamWilsn, @xinbenlv

@eip-review-bot eip-review-bot changed the title Create erc-7250.md Add ERC: Nitro Protocol for State Channels with Account Abstraction Nov 22, 2024
@github-actions github-actions bot added the w-ci label Nov 22, 2024
ERCS/erc-7250.md Outdated
@@ -0,0 +1,160 @@
---
eip: 7250
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
eip: 7250
eip: 7824

Assigning next sequential EIP/ERC/RIP number.
Numbers are assigned by editors & associates.

Please also update the filename.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I applied the change of number as suggested,
I decided to split into two ERC

Please note this code was audited by Consensys Diligence

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I had missed this. 7825 has already been issued. @SamWilsn has issued a number for the second ERC.

ERCS/erc-7250.md Outdated
@@ -0,0 +1,160 @@
---
eip: 7250
title: Nitro Protocol for State Channels with Account Abstraction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERCs are for Ethereum standardization and not product/protocol promotion.

Suggested change
title: Nitro Protocol for State Channels with Account Abstraction
title: State Channels with Account Abstraction

Can this ERC be used by any state channel implementation, or is it limited to Nitro based state channels?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
There is no commercial name or product nitro,
this can be used by most state-channels

We are from the open-source project https://statechannels.org/
https://github.com/statechannels

We are mentioned in https://ethereum.org/en/developers/docs/scaling/state-channels/

I will remove nitro, as it's an historical name of the open source protocol, but we also have the following name: "Stateful Asset Transfer Protocol"

ERCS/erc-7250.md Outdated
title: Nitro Protocol for State Channels with Account Abstraction
description: A standard for implementing interoperable state channels on Ethereum using the Nitro Protocol, integrated with ERC-4337 for enhanced account abstraction.
author: Consensys Mesh (@statechennels), Layer 3 Foundation (@layer-3), Louis Bellet (@mod)
discussions-to: https://github.com/ethereum/EIPs/discussions/7250
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a discussions topic in Eth Magicians with a link to this PR: https://ethereum-magicians.org/c/ercs/57

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Account in progress, I will create the topic as soon as I have permissions

@mod mod reopened this Nov 29, 2024
@eip-review-bot eip-review-bot changed the title Add ERC: Nitro Protocol for State Channels with Account Abstraction Add ERC: ERC for Exit Format in State Channels Nov 29, 2024
@github-actions github-actions bot removed the w-ci label Nov 29, 2024
@mod mod changed the title Add ERC: ERC for Exit Format in State Channels Add ERC: ERC for Exit Format and State Channels Nov 29, 2024
@github-actions github-actions bot added the w-ci label Nov 29, 2024
@mod
Copy link
Author

mod commented Nov 29, 2024

The commit 7de0c81 (as a parent of cfda43d) contains errors. Please inspect the Run Summary for details.

Will be corrected soon

@eip-review-bot eip-review-bot changed the title Add ERC: ERC for Exit Format and State Channels Add ERC: ERC for Exit Format in State Channels Dec 12, 2024
@github-actions github-actions bot removed the w-ci label Dec 12, 2024
Copy link

The commit 74b085b (as a parent of fbe3c66) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot added the w-ci label Dec 12, 2024
@@ -0,0 +1,146 @@
---
eip: 7824
title: ERC for Exit Format in State Channels
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: ERC for Exit Format in State Channels
title: Exit Format in State Channels

You don't need to mention ERC in the title.


## Abstract

This ERC defines a standard **Exit Format** for specifying outcomes and asset allocations in state channels. The Exit Format supports diverse token types (native tokens, ERC-20, and others) and accommodates both simple and advanced allocation mechanisms. The standard ensures interoperability and clarity in the distribution of locked assets upon channel finalization, particularly in protocols like Nitro.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to see a brief definition of what an "exit format" is in your abstract, for anyone who isn't familiar with the term.


This ERC introduces new structs and enums for use in state channel contracts. It is designed to be forward-compatible with existing protocols like Nitro. Implementations not using this standard will need to adapt their on-chain logic to parse Exit Format structures.

## Test Cases
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test cases should be a list of inputs and expected outputs (or code essentially doing the same.)

You can omit this section, or you could include the input structs and what changes they should make on chain.


## Rationale

The Exit Format standardizes asset redistribution logic across state channel implementations, reducing ambiguity and improving interoperability. By supporting both simple and advanced allocations, it addresses a wide range of use cases, from basic payments to complex virtual channel setups.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mostly reads like motivation because it's justifying the proposal as a whole. The rationale should be used to explain why you made certain technical choices within the document. For example, why you've included metadata fields or why destination is 32 bytes long. Obviously you should explain actually important stuff 🤣


State channels rely on clear and interoperable methods for redistributing locked assets when a channel closes. Current implementations lack a standardized format for defining these outcomes, leading to inefficiencies and integration challenges. This ERC introduces a unified **Exit Format** that can be adopted across state channel implementations, improving compatibility and simplifying on-chain interactions.

## Specification
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your specification doesn't really explain where these structs fit into the big picture, or explain why they need to be standardized separately from the interface that will be using them. Normally we only accept standards that define externally visible behavior (like events/functions.)

Copy link
Contributor

@SamWilsn SamWilsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change the second EIP number.

@@ -0,0 +1,160 @@
---
eip: 7825
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
eip: 7825
eip: 7842

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please also update the filename.

@@ -0,0 +1,160 @@
---
eip: 7825
title: State Channel Standard data types and interfaces
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: State Channel Standard data types and interfaces
title: State Channel Data Types & Interfaces

---
eip: 7825
title: State Channel Standard data types and interfaces
description: Interoperable state channels on Ethereum using State Channel Protocol, integrated with ERC-4337 for enhanced account abstraction.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Interoperable state channels on Ethereum using State Channel Protocol, integrated with ERC-4337 for enhanced account abstraction.
description: Interoperable state channels using State Channel Protocol, integrated with ERC-4337 for enhanced account abstraction.


### Integration with ERC-4337

#### Benefits
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything not describing requirements should be in the rationale or motivation section.


## Rationale

This ERC builds on the modularity of Nitro Protocol and the flexibility of ERC-4337, creating a unified standard for state channel implementations. By decoupling execution rules from core protocol logic, it ensures adaptability for various applications while maintaining a secure and efficient dispute resolution process.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reads more like motivation. See my earlier comment on motivation vs. rationale.


This ERC depends on ERC-4337 and assumes its availability for account abstraction functionality. Legacy state channel implementations without Nitro compatibility will require adaptation.

## Test Cases
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same about test cases

title: ERC for Exit Format in State Channels
description: Outcomes and asset allocations definition in state channels using the Exit Format.
author: State Channels (@statechannels), Layer-3 Foundation (@layer-3), Louis Bellet (@mod)
discussions-to: https://ethereum-magicians.org/c/ercs/57
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a discussions topic in Eth Magicians linking to this PR
https://ethereum-magicians.org/c/ercs/57

title: State Channel Standard data types and interfaces
description: Interoperable state channels on Ethereum using State Channel Protocol, integrated with ERC-4337 for enhanced account abstraction.
author: State Channels (@statechannels), Layer-3 Foundation (@layer-3), Louis Bellet (@mod)
discussions-to: https://ethereum-magicians.org/c/ercs/57
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create a discussions topic in Eth Magicians linking to this PR
https://ethereum-magicians.org/c/ercs/57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants