Title: ERC_7802__Crosschain_Token_Interface
Category: ERCs

Author: drgorilla.eth
Date: 2024-10-30T19:29:27.895Z

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.
The interface is bridge agnostic and fully extensible.
PR:

github.com/ethereum/ERCs








Add ERC: Crosschain Token Interface


master ← defi-wonderland:erc/crosschain-token-interface



          opened 06:00PM - 30 Oct 24 UTC




            0xParticle
          



+259
-0






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

Author: radek
Date: 2024-11-06T22:43:22.538Z

I welcome the minimalism.
Yet, how do you expect the compatibility with xERC20? ( ERC 7281 ) - would be nice to have that elaborated in the compatibility section.

Author: amattm
Date: 2024-11-08T07:56:15.644Z

+1 to @radek s question.

Author: ernestognw
Date: 2024-11-28T08:43:10.825Z

Hi @drgorilla.eth, I like the ERC design as it is pretty minimal!
We’ve been working on ERC-7786 (crosschain messaging gateways) to define a minimal standard to simply “get a message to another chain”. I tried to implement ERC-7802 on top of ERC-7786. Here’s the code (WIP). We’re planning to include it in the community version of OpenZeppelin Contracts
The idea to combine these 2 standards is because ERC-7802 defines an interface where a bridge address can mint or burn, but I would argue that it would be better if ERC-7802 depends on ERC-7786 to make the crosschain token its messaging gateway. This way, the bridge integration is abstracted away and the ERC20 can expose a crosschainTransfer that burns tokens on the source chain and relays a mint instruction to the destination chain.
EDIT: I’m rethinking the crosschainTransfer idea since I see the reasoning behind offloading the logic from the token. Still, we appreciate feedback, we’re planning to put this into the library pretty soon

Author: ernestognw
Date: 2024-11-29T17:59:51.812Z

They complement each other. ERC-7802 defines the minimal interface for an ERC-20 token to communicate cross-chain, but it doesn’t specify how a protocol should send a cross-chain message to communicate with such tokens. Similarly, it doesn’t specify how a user will transfer tokens on-chain.
I agree this standard should remain minimal, but I would agree it may benefit if they specify an optional interface for the “token bridge” that depends on ERC-7786. It also makes sense to put it in another ERC.

Author: Particle
Date: 2024-12-04T14:24:58.987Z

Regarding compatibility with xERC20 (ERC-7802), I wrote this document:


Notion



Your connected workspace for wiki, docs & projects | Notion
A new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team

Author: frangio
Date: 2024-12-05T19:03:40.178Z

Can it be an issue that an adapter for xERC20 doesn’t emit CrosschainMint/Burn? This is not discussed in the document, but these events are specified as “MUST”. If these events wont be reliable, it might make sense to lower the requirement in the spec (SHOULD or MAY) or even remove it.

Author: Particle
Date: 2024-12-18T14:55:15.157Z

The adapter itself is not an implementation of the IERC7802 standard, nor is it an ERC20 token. Instead, it serves as an intermediary to enable a bridge—already compliant with the IERC7802 API—to interact with xERC20 tokens that may not natively implement this interface.
Since the adapter is merely a compatibility layer and not a token contract, it is not required to emit CrosschainMint or CrosschainBurn events. These events are only mandatory for contracts that directly implement IERC7802. The role of the adapter is to translate standardized bridge calls into the xERC20’s existing mint and burn functionality, ensuring operational compatibility.

Author: Arvolear
Date: 2025-01-08T10:20:06.453Z

Love the proposal! There is definitely a problem with bridges as every provider forces to use their own mint/burn interface.
Have several questions though:


Maybe it is worth expanding the crosschainMint() and crosschainBurn() interfaces to accept an additional bytes parameter?
So the new function signatures will be:
function crosschainMint(address _account, uint256 _amount, bytes memory _payload);
function crosschainBurn(address _account, uint256 _amount, bytes memory _payload);

Possibly this can allow ERC-7802 tokens to perform some business-specific logic.


In the provided reference implementation, shouldn’t there be token allowance spending in the crosschainBurn() function?
function crosschainBurn(address _from, uint256 _amount) external onlyTokenBridge {
    _spendAllowance(_from, msg.sender, _amount); // <-- add this line
    _burn(_from, _amount);
    emit CrosschainBurn(_from, _amount, msg.sender);
}

It is probably fine the way it is implemented now provided the TokenBridge understands current behavior and prohibits grefing.

Author: Particle
Date: 2025-01-09T18:47:00.597Z

Great points!

I understand that incorporating a bytes parameter could facilitate business-specific logic; however, it goes against the design goal of maintaining a minimal interface. The goal is to keep tokens straightforward and allow for more complex hooks or logic to be handled at the bridge level.
Do you have any examples in mind of logic that would require using these bytes and cannot be implemented at the bridge level?
In this scenario, we assume the bridge is trusted and does not require allowance checks. Including _spendAllowance would be more consistent with systems like xERC20, where allowances are essential. However, for this minimal approach, it is not necessary. If needed, allowances can always be added later for specific implementations.

Author: modtail
Date: 2025-01-14T14:58:32.646Z

I agree with the rational and adding metadata byte param.

Author: radek
Date: 2025-01-15T15:38:13.471Z

Being in the middle of the implementation into ERC20 using both xERC20 and ERC7802.
I believe the mentioned msg.sender is not correct in the standard:

Events
CrosschainMint
MUST trigger when crosschainMint is successfully called. The _sender parameter MUST be set to the msg.sender at the time the function is called.
event CrosschainMint(address indexed _to, uint256 _amount, address indexed _sender);

I assume the rationale to emit sender is to filter out which events are related to the particular bridge.
In the case there is an adapter between the bridge and ERC20 token, such adapter becomes msg.sender.

Author: skeletor
Date: 2025-01-31T16:55:50.903Z

This is an interesting point. I see the concern about the adapter becoming msg.sender, but I don’t necessarily think it’s an issue for the event to emit the adapter’s address. If we change _sender, we might introduce inconsistencies or require extra logic to track the original caller. Keeping msg.sender as-is ensures consistency, and indexers can be designed to trace the adapter path when necessary.

Author: ilovelili
Date: 2025-02-19T09:31:16.819Z

Hi does ERC-7802 has a public audit report so far? Thank you! @drgorilla.eth

Author: radek
Date: 2025-03-12T12:17:20.810Z

FYI - here is the draft of the minimal xERC20 standard:

github.com/ethereum/ERCs








Create erc (minimal xERC20)


ethereum:master ← radeksvarz:patch-2



          opened 12:10PM - 12 Mar 25 UTC




            radeksvarz
          



+224
-0






Minimal interface of Sovereign Bridged Token (minimal xERC20)