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: Cross-chain Message Format and Mailbox #766

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

Conversation

elliedavidson
Copy link

When opening a pull request to submit a new EIP, please use the suggested template: https://github.com/ethereum/EIPs/blob/master/eip-template.md

We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met:

  • The PR edits only existing draft PRs.
  • The build passes.
  • Your GitHub username or email address is listed in the 'author' header of all affected PRs, inside .
  • If matching on email address, the email address is the one publicly listed on your GitHub profile.

@github-actions github-actions bot removed the w-ci label Dec 12, 2024
@github-actions github-actions bot added the w-ci label Dec 12, 2024
@github-actions github-actions bot removed the w-ci label Dec 12, 2024
ERCS/erc-0000.md Outdated Show resolved Hide resolved
ERCS/erc-0000.md Outdated Show resolved Hide resolved
Copy link

The commit 59928c2 (as a parent of 3514096) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot added the w-ci label Dec 16, 2024
@github-actions github-actions bot removed the w-ci label Dec 16, 2024

## Abstract

This ERC proposes a **mailbox API** and **message format** for sending and receiving data between L2s. This standard makes it easier for developers to build cross-chain applications that work over a variety of VMs, chain settlement mechanisms (e.g., ZK or optimistic settlement), and messaging protocols (e.g., synchronous or asynchronous protocols). Example applications include an intent-based bridge, a liquidity-unifying DEX operating across multiple chains, or a cross-chain lending application.
Copy link
Contributor

Choose a reason for hiding this comment

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

You abstract should sketch out a high level technical overview so readers get a sense of how your proposal accomplishes its goals.

}
```

It is RECOMMENDED that there exists a global rollup registry service that supports registration, deregistration, and efficient lookup of a rollup's chain ID. This work is outside the scope of this ERC, however. To display the sender and receiver of a `Message`, wallets and frontends MAY use [ERC-3770](./eip-3770.md) for chain-specific addresses.
Copy link
Contributor

Choose a reason for hiding this comment

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

It is RECOMMENDED that there exists a global rollup registry service that supports registration, deregistration, and efficient lookup of a rollup's chain ID.

This is a weird way to word this. You're creating a recommendation not for implementers of your standard, but for the entire ecosystem.

I'd recommend something more like:

Suggested change
It is RECOMMENDED that there exists a global rollup registry service that supports registration, deregistration, and efficient lookup of a rollup's chain ID. This work is outside the scope of this ERC, however. To display the sender and receiver of a `Message`, wallets and frontends MAY use [ERC-3770](./eip-3770.md) for chain-specific addresses.
Implementations SHOULD use a global rollup registry service that supports registration, deregistration, and efficient lookup of a rollup's chain ID. This work is outside the scope of this ERC, however.
To display the sender and receiver of a `Message`, wallets and frontends MAY use [ERC-3770](./eip-3770.md) for chain-specific addresses.

type: Standards Track
category: ERC
created: 2024-12-12
---
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
---
requires: 3770
---

/// @notice Mailbox for sending (resp. receiving) messages to (resp. from)
/// other chains, standardized for messaging protocols that support
/// synchronous or asynchronous, or both types of message passing.
abstract contract Mailbox {
Copy link
Contributor

Choose a reason for hiding this comment

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

abstract contracts include too much implementation detail, and as such we don't generally allow them. I don't really see anything in here that couldn't be included in an interface, unless the storage requirements of inbox are meaningful?


### Related Proposals

In comparison to IBC-like standards, this ERC is designed to work in a *stateless* manner. Messages do not need to pass a proof from the source chain at the time they are consumed on the destination chain. This allows use cases such as synchronous composability and intra-block messaging since messages don’t need to include finalized state from the source chain. Additionally, this ERC does not require multiple steps to establish a link between two chains. Messages can be directly sent from one chain to another in a single step.
Copy link
Contributor

Choose a reason for hiding this comment

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

IBC-like

Please expand uncommon abbreviations the first time they are used.


In comparison to IBC-like standards, this ERC is designed to work in a *stateless* manner. Messages do not need to pass a proof from the source chain at the time they are consumed on the destination chain. This allows use cases such as synchronous composability and intra-block messaging since messages don’t need to include finalized state from the source chain. Additionally, this ERC does not require multiple steps to establish a link between two chains. Messages can be directly sent from one chain to another in a single step.

[ERC-7683](./eip-7683.md) standardizes intent-based systems by defining structs for orders and interfaces for settlement smart contracts. This standard is application-specific and aimed at designers of cross-chain intent systems, while our proposal is more general and targets developers implementing arbitrary cross-chain applications. However, an intent system based on ERC-7683 **can be built on top** of our standard due to its modularity. An application implementing ERC-7683 could use the `Mailbox` API defined in this proposal to send `originData` from event messages between the source chain (where user funds are deposited) and the destination chain(s) (where intents are solved). We provide more details in the *Example Usage* section.
Copy link
Contributor

Choose a reason for hiding this comment

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

If you mention ERC-7683, your standard will not be able to progress past its status. See markdown-link-status for more detail.

There's absolutely nothing wrong with that. I just wanted to let you know.


### Example Usage - Sync and Async Cross-chain Transfers

We show a *possible* implementation of the mailbox contract for synchronous messaging protocol, and explain how it can be easily modified to support asynchronous protocols as well.
Copy link
Contributor

Choose a reason for hiding this comment

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

This sounds like it belongs in the reference implementation section?


## Copyright

Copyright and related rights waived via CC0.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use the exact copyright waiver from the template.

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