Skip to content

Add ERC: Crosschain Token Interface#692

Merged
eip-review-bot merged 26 commits intoethereum:masterfrom
defi-wonderland:erc/crosschain-token-interface
Mar 3, 2025
Merged

Add ERC: Crosschain Token Interface#692
eip-review-bot merged 26 commits intoethereum:masterfrom
defi-wonderland:erc/crosschain-token-interface

Conversation

@0xParti
Copy link
Contributor

@0xParti 0xParti commented Oct 30, 2024

This ERC introduces a minimal interface for tokens to communicate cross-chain. It allows bridges with mint and burn rights to send and relay token transfers with a standardized API.

@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Oct 30, 2024

✅ All reviewers have approved.

@github-actions github-actions bot added the w-ci label Oct 30, 2024
@github-actions github-actions bot removed the w-ci label Oct 30, 2024
@github-actions github-actions bot removed the w-ci label Oct 30, 2024
Copy link

@blmalone blmalone left a comment

Choose a reason for hiding this comment

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

Some suggested amendments.

@0xParti
Copy link
Contributor Author

0xParti commented Dec 4, 2024

Regarding compatibility with xERC20 (ERC-7802), I wrote this document:
https://defi-wonderland.notion.site/xERC20-ERC7802-compatibility-14c9a4c092c780ca94a8cb81e980d813?pvs=4

ERCS/erc-7802.md Outdated
event CrosschainMint(address indexed _to, uint256 _amount, address indexed _sender);
```

Note: implementations might consider additionally emitting `Transfer(address(0), _to, _amount)` to be compliant with [ERC-5679](./eip-5679.md).
Copy link
Contributor

Choose a reason for hiding this comment

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

I strongly suggest making the Transfer events mandatory.

ERC-20 is more relevant than ERC-5679 IMO, and in the former it's already specified as SHOULD (i.e., a strong recommendation):

A token contract which creates new tokens SHOULD trigger a Transfer event with the _from address set to 0x0 when tokens are created.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very good catch. Just pushed to modify this invariant.

@SamWilsn
Copy link
Contributor

Gentle reminder to keep technical discussion in the Ethereum Magicians thread. It's easy to lose context after the pull request is merged.

ERCS/erc-7802.md Outdated
---
eip: 7802
title: Crosschain Token Interface
description: Minimal token interface for cross-chain transfers
Copy link
Contributor

Choose a reason for hiding this comment

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

Minimal

Too many standards claim to be minimal. I'd recommend removing this, and using your description to further elaborate on the ideas introduced in your title.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified this section, let me know your thoughts now

Choose a reason for hiding this comment

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

Can someone here explain how to view/claim tokens or prizes that were claimed too late because I didn't understand? I hope for the information

ERCS/erc-7802.md Outdated

## Abstract

This standard introduces a minimal interface for tokens to communicate cross-chain. It allows bridges with mint and burn rights to send and relay token transfers with a standardized API.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not bad, but I'd like to see a bit more technical meat here. Could you sketch out how your proposal operates, in addition to the description you already have.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added more technical details.


**`CrosschainMint`**

MUST trigger when `crosschainMint` is successfully called.
Copy link
Contributor

Choose a reason for hiding this comment

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

This leaves a lot unspecified (which is fine if it's intentional.) For example, should other non-standard functions that also effectively perform a crosschain mint also trigger this event, or is it specifically tied to this function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is intentionally unspecified. The CrosschainMint event MUST be triggered when the crosschainMint function is successfully called. However, implementers are not restricted from emitting this event when using other non-standard functions that effectively perform a crosschain mint.

If the implementation adheres to this standard, the full interface—including crosschainMint and crosschainBurn—will already be available, so it is expected that these functions are used for crosschain minting and burning. That said, the event is not mandated for every action that triggers a crosschain operation, as this standard focuses specifically on the standardized interface.

As discussed in the Motivation section, a minimal, flexible cross-chain standard interface is necessary. The problem becomes larger as more tokens are deployed without a standardized format.

- Upgradable tokens can be upgraded to implement the new interface.
- Non-upgradable tokens cannot implement the interface on the token itself. They can still migrate to a standard-compliant version using a lockbox mechanism, as proposed by xERC-20. The idea is to lock non-mintable tokens and mint the same amount of interface-compliant tokens. The bridge contract can act as a lockbox on the native chain.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does xERC-20 have an ERC? If so, you should link it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It has an open PR to the ERC repo with assigned number 7281, but it has not been merged. If I mention the ERC-7281 in this ERC, the EIP validator asks for an internal link, which I can't reference at the moment.

0xParti and others added 3 commits December 17, 2024 15:02
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
@github-actions
Copy link

The commit 5d26ebb (as a parent of d3b7d38) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot added the w-ci label Dec 17, 2024
@github-actions github-actions bot removed the w-ci label Dec 17, 2024
/// @notice Allows the TOKEN_BRIDGE to burn tokens.
/// @param _from Address to burn tokens from.
/// @param _amount Amount of tokens to burn.
function crosschainBurn(address _from, uint256 _amount) external onlyTokenBridge {

This comment was marked as off-topic.

skidipapo

This comment was marked as off-topic.

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.

I think this is acceptable for draft. Do try to take care of these comments eventually. Also replace xerc-20 with links to that proposal when it's merged.

@@ -0,0 +1,259 @@
---
eip: 7802
title: Crosschain Token Interface
Copy link
Contributor

Choose a reason for hiding this comment

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

"Interface" in an ERC title doesn't add a ton of information. Most ERCs contain some kind of interface.

How about:

Suggested change
title: Crosschain Token Interface
title: Permissioned Token Mint/Burn Across Chains

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree with the suggestion of removing "interface" from the title. I'm not convinced about using "Permissioned", as that is not inherent to the interface (it could be permissionless). What do you think about something like "Token with Mint/Burn access Across Chains"?


The interface also defines two standardized events, `CrosschainMint` and `CrosschainBurn`, which emit metadata, including the target address, token amount, and caller. These events facilitate deterministic indexing and monitoring of cross-chain activities by off-chain agents, such as indexers, analytics tools, and auditors.

`IERC7802` is intentionally lightweight, ensuring minimal overhead for implementation. Its modular design enables extensibility, allowing additional features—such as mint/burn limits, transfer fees, or bridge-specific access control mechanisms—to be layered on top without modifying the base interface.
Copy link
Contributor

Choose a reason for hiding this comment

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

This paragraph probably belongs (with some rewording) in the Rationale section, since it explains why this standard is designed the way it is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Rationale section already speaks about this design decision in more depth. I wanted to highlight this key property in the Abstract as well.
If you still consider this paragraph is too much information for the Abstract, I could rephrase it and make it shorter.


Mints `_amount` of token to address `_account`.

This function works as the minting entry point for bridge contracts. Each implementation is responsible for its access control logic.
Copy link
Contributor

Choose a reason for hiding this comment

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

You can move the access control notes on each method to the security considerations section.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The Security considerations mention this issue explicitly. I will remove these considerations from the method description to minimize redundancy.

@eip-review-bot eip-review-bot enabled auto-merge (squash) March 3, 2025 10:46
Copy link
Collaborator

@eip-review-bot eip-review-bot left a comment

Choose a reason for hiding this comment

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

All Reviewers Have Approved; Performing Automatic Merge...

@eip-review-bot eip-review-bot merged commit a7c7c8e into ethereum:master Mar 3, 2025
13 of 22 checks passed
@0xParti
Copy link
Contributor Author

0xParti commented Apr 14, 2025

I think this is acceptable for draft. Do try to take care of these comments eventually. Also replace xerc-20 with links to that proposal when it's merged.

Thanks for the feedback. I will open a new PR addressing the various comments.

Copy link

@Murshid69 Murshid69 left a comment

Choose a reason for hiding this comment

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

5

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.