-
Notifications
You must be signed in to change notification settings - Fork 630
Add ERC: Universal On-Chain Metadata Parser Interface #755
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
Open
ZeroKPunk
wants to merge
10
commits into
ethereum:master
Choose a base branch
from
ZeroKPunk:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ee957cf
init erc-draft-wallet_transmitCrossChainIntents
ZeroKPunk 59a4801
Merge branch 'ethereum:master' into master
ZeroKPunk 127e5c2
Refactor ERC-7835: Redefined scope to an abstract metadata parser for…
ZeroKPunk 3805ce2
add description
ZeroKPunk c3ded74
add discussion link
ZeroKPunk 3fbfa5b
fix: Walidator error
ZeroKPunk f714c25
Merge branch 'master' into master
ZeroKPunk e21ed13
update
ZeroKPunk 558d5f3
Merge branch 'master' of https://github.com/ZeroKPunk/ERCs
ZeroKPunk 4d80df3
fix: eip id
ZeroKPunk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
--- | ||
title: wallet_transmitCrossChainIntents Method | ||
description: Standard Cross-Chain Intent Parsing Method For EVM Wallet | ||
author: ZeroKPunk (@ZeroKPunk), 0xbbPizza (0xbbPizza) | ||
discussions-to: <URL> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
status: Draft | ||
type: Standards Track | ||
category: ERC # Only required for Standards Track. Otherwise, remove this field. | ||
created: 2024-12-03 | ||
requires: 7683 # Only required when you reference an EIP in the `Specification` section. Otherwise, remove this field. | ||
--- | ||
|
||
## Abstract | ||
|
||
This proposal adds a wallet-namespaced method: `wallet_transmitCrossChainIntents`: providing a standard interface for parsing the users' cross-chain intentions between EVM compatible networks(eg. EVM Rollups). By integrating this RPC method into wallets like MetaMask, users can initiate, broadcast, and track cross-chain transactions with minimal effort, improving cross-chain interoperability and user experience. | ||
|
||
## Motivation | ||
|
||
Cross-chain transactions are currently complex and require users to interact with multiple blockchains manually. This often involves switching networks, signing multiple transactions, and relying on third-party tools (e.g., bridges or relayers). While EIP-7683 provides a standardized approach for cross-chain intents, wallets currently lack native support for such workflows, leading to: | ||
|
||
A poor user experience due to complex processes. | ||
A lack of standardized wallet interfaces for cross-chain intent execution. | ||
Fragmented cross-chain tooling that hinders interoperability. | ||
|
||
### Goals: | ||
|
||
Introduce a standardized RPC method for wallets to natively support [EIP-7683](https://eips.ethereum.org/EIPS/eip-7683) cross-chain intents. | ||
Simplify the user experience by abstracting cross-chain complexities. | ||
Enhance the adoption of cross-chain standards and drive interoperability between chains. | ||
|
||
## Specification | ||
|
||
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. | ||
|
||
This proposal defines a new wallet RPC method: `wallet_transmitCrossChainIntents` | ||
|
||
### `wallet_transmitCrossChainIntents` | ||
|
||
#### Parameter | ||
|
||
The `wallet_transmitCrossChainIntents` method's input contains several parameters, which is defined as follows: | ||
|
||
| Parameter Name | Type | Required | Description | | ||
| ------------------- | ----------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| `originChainId` | `uint256` | Yes | The chain ID of the originating blockchain where the user initiates the intent. | | ||
| `destinationChains` | `uint256[]` | Yes | A list of target chain IDs where the intent will be executed.无 | | ||
| `orderData` | `bytes` | Yes | The serialized cross-chain intent data (in compliance with EIP-7683). This includes token details, amounts, destination chains, and optional calldata. | | ||
| `options` | `object` | No | Additional options for the transaction, such as preferred fillers, gas settings, or execution constraints. | | ||
|
||
#### Return Value | ||
|
||
The method returns a JSON object containing information about the transaction(s): | ||
|
||
### Example Calls | ||
|
||
#### Example Request | ||
|
||
User initiates a cross-chain intent from Ethereum (chain ID: 1) to Polygon (chain ID: 137) and Optimism (chain ID: 10): | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"method": "wallet_transmitCrossChainIntents", | ||
"params": { | ||
"originChainId": 1, | ||
"destinationChains": [137, 10], | ||
"orderData": "0xabcdef123456...", | ||
"options": { | ||
"preferredFiller": "0xFILLER_ADDRESS", | ||
"gasLimit": 500000, | ||
"priorityFee": "high" | ||
} | ||
}, | ||
"id": 1 | ||
} | ||
``` | ||
|
||
#### Example Response | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"result": { | ||
"hashes": [ | ||
"0xabc123...", // Origin chain transaction hash | ||
"0xdef456...", // Destination chain 1 transaction hash | ||
"0xghi789..." // Destination chain 2 transaction hash | ||
], | ||
"status": "pending" | ||
} | ||
} | ||
``` | ||
|
||
#### Error response if the wallet fails to sign the transaction: | ||
|
||
```json | ||
{ | ||
"jsonrpc": "2.0", | ||
"id": 1, | ||
"error": { | ||
"code": -32602, | ||
"message": "Failed to sign the transaction." | ||
} | ||
} | ||
``` | ||
|
||
### WorkFlow | ||
|
||
#### 1. User Interaction: | ||
|
||
- The user initiates a cross-chain intent by selecting the origin chain, destination chain(s), and inputting transaction parameters (e.g., tokens, amounts, calldata). | ||
|
||
#### 2. Wallet Processing: | ||
|
||
- The wallet generates the cross-chain order (e.g., GaslessCrossChainOrder or OnchainCrossChainOrder as per EIP-7683). | ||
- If GaslessCrossChainOrder is used, the wallet signs the intent offline and broadcasts it to fillers. | ||
- If OnchainCrossChainOrder is used, the wallet submits the order to the origin chain settlement contract. | ||
|
||
#### 3.Broadcast and Tracking: | ||
|
||
- The wallet broadcasts the transaction on the origin chain and optionally tracks its progress on the destination chains. | ||
- Users can monitor the transaction status directly within the wallet. | ||
|
||
## Rationale | ||
|
||
### Why a Wallet-Level RPC Interface? | ||
|
||
- **User-Friendly Abstraction**: Wallets are the primary interface for blockchain users. By simplifying cross-chain workflows within wallets, users can interact with multiple chains without switching networks or relying on third-party tools. | ||
|
||
- **Drive Standardization**: A wallet-level RPC interface aligned with EIP-7683 ensures consistent cross-chain support across different wallets and protocols. | ||
|
||
- **Encourage Ecosystem Growth**: By natively integrating cross-chain standards, wallets can drive adoption of interoperable protocols and incentivize developers to build on these standards. | ||
|
||
### Why JSON-RPC? | ||
|
||
JSON-RPC is the de facto standard for wallet communication. Defining this interface as a JSON-RPC method ensures compatibility with existing wallet ecosystems like MetaMask while allowing easy integration into dApps and protocols. | ||
|
||
## Backwards Compatibility | ||
|
||
This proposal does not affect existing wallet functionality. It introduces a new, optional JSON-RPC method that is compatible with existing wallets and dApps. | ||
|
||
## Test Cases | ||
|
||
### Single Destination Chain: | ||
|
||
A user submits a cross-chain intent with one destination chain. Verify that the wallet correctly generates the order and broadcasts it. | ||
|
||
### Multiple Destination Chains: | ||
|
||
A user submits a cross-chain intent with multiple destination chains. Verify that the wallet correctly tracks and returns transaction hashes for all chains. | ||
|
||
### Invalid Parameters: | ||
|
||
Test the wallet's response to invalid inputs (e.g., unsupported destination chains, malformed order data). | ||
|
||
### Filler Network Interactions: | ||
|
||
Verify that the wallet can interact with filler networks to broadcast gasless orders and resolve intents. | ||
|
||
## Reference Implementation | ||
|
||
<!-- | ||
This section is optional. | ||
|
||
The Reference Implementation section should include a minimal implementation that assists in understanding or implementing this specification. It should not include project build files. The reference implementation is not a replacement for the Specification section, and the proposal should still be understandable without it. | ||
If the reference implementation is too large to reasonably be included inline, then consider adding it as one or more files in `../assets/eip-####/`. External links will not be allowed. | ||
|
||
TODO: Remove this comment before submitting | ||
--> | ||
|
||
## Security Considerations | ||
|
||
### User Consent | ||
|
||
- The wallet must prompt users to review and approve all transaction parameters before signing or broadcasting. | ||
|
||
### Filler Trust | ||
|
||
- Users should be warned of potential risks when interacting with unverified fillers. Wallets may implement reputation systems or filler whitelists for added security. | ||
|
||
### Cross-Chain Failures: | ||
|
||
- If a transaction fails on one of the destination chains, the wallet should provide clear error messages and rollback options (if applicable). | ||
|
||
### Replay Protection: | ||
|
||
- The wallet must ensure that cross-chain intents include nonces or other mechanisms to prevent replay attacks across chains. | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](../LICENSE.md). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assigning next sequential EIP/ERC/RIP number.
Numbers are assigned by editors & associates.
Please also update the filename.