Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
This article examines ERC-7683, a proposal defining interfaces for cross-chain trade execution systems. It describes the version of the proposal covered by the original article on June 14, 2024; later revisions may use different interfaces.
This article translates, summarizes, and expands on the specification linked below.
I also cover a variety of other EIPs.
Overview
The standard proposes a common API for executing cross-chain trades.
It introduces a generic CrossChainOrder struct and an ISettlementContract interface.
I think of an intent as a way to automatically carry out a specific operation that a user wants to perform. For example, if a user wants to sell a token at a particular price or convert token A into token B and then token C, they can click a button rather than manually executing each instruction. This makes even complicated operations easier for users. At present, interacting with cryptocurrencies is simply too complicated for users who are unfamiliar with them, including people coming from Web2. Intents address this problem. As the name suggests, an intent expresses what a user wants and lets a system fulfill that intention.
For more details, see the following articles.
https://diveintocrypto.xyz/p/web3-intent-based-architecture
https://www.coindeskjapan.com/208693/
Motivation
Intent-based systems have become a particularly effective way for end users to interact across blockchains, removing much of the complexity and timing constraints associated with bridging tokens and NFTs, such as transaction execution times and multi-step procedures. However, cross-chain intent systems face a significant challenge in obtaining sufficient liquidity and maintaining an active network of fillers (users or systems that execute orders) across multiple chains. This problem may become more pronounced as the number of supported chains grows.
As a result, high costs, long waiting times, and high failure rates can degrade the user experience.
Standardization can address this problem by enabling cross-chain intent systems to interoperate and share infrastructure, including order dissemination systems (which forward transactions or intents issued by users to suitable fillers) and networks of fillers (individuals or systems that actually execute user orders). This increases competition to fulfill user intents and improves the user experience.
Users who place orders benefit when those orders are executed cheaply, quickly, and reliably. Fillers therefore compete on execution speed, lower costs, and reliable execution. Users can choose whichever filler they consider best, improving their experience.
Specification
ResolvedCrossChainOrder
Cross-chain order types conforming to the standard must implement the following CrossChainOrder struct.
/// @title CrossChainOrder type
/// @notice Standard order struct to be signed by swappers, disseminated to fillers, and submitted to settlement contracts
struct CrossChainOrder {
/// @dev The contract address that the order is meant to be settled by.
/// Fillers send this order to this contract address on the origin chain
address settlementContract;
/// @dev The address of the user who is initiating the swap,
/// whose input tokens will be taken and escrowed
address swapper;
/// @dev Nonce to be used as replay protection for the order
uint256 nonce;
/// @dev The chainId of the origin chain
uint32 originChainId;
/// @dev The timestamp by which the order must be initiated
uint32 initiateDeadline;
/// @dev The timestamp by which the order must be filled on the destination chain
uint32 fillDeadline;
/// @dev Arbitrary implementation-specific data
/// Can be used to define tokens, amounts, destination chains, fees, settlement parameters,
/// or any other order-type specific information
bytes orderData;
}settlementContract- The address of the contract responsible for settling the order.
- Fillers submit the order to this contract address.
- It is located on the origin chain.
swapper- The address of the user initiating the swap.
- The user's tokens are taken and escrowed.
nonce- A unique number used to prevent replay attacks.
- Ensures that each order is unique.
originChainId- The chainId of the origin chain.
- Indicates which chain the order originated from.
initiateDeadline- The timestamp by which the order must be initiated.
- The order must be initiated before this deadline.
fillDeadline- The timestamp by which the order must be filled on the destination chain.
- The order must be filled before this deadline.
orderData- Arbitrary byte data containing implementation-specific information.
- It defines order-specific information such as tokens, amounts, destination chains, fees, and settlement parameters.
Cross-chain execution systems must convert the orderData field into a custom subtype that can be decoded.
This subtype includes the following information.
- Tokens exchanged in the swap
- Token addresses and amounts.
- Destination chain ID
- The ID of the chain on which the order is fulfilled.
- Fulfillment constraints
- Conditions or restrictions that must be satisfied to fulfill the order.
- Settlement oracle
- The address of an oracle that provides information about the order.
- Verifies whether the order was fulfilled correctly.
ResolvedCrossChainOrder
Cross-chain order types conforming to the standard must be convertible into the following ResolvedCrossChainOrder struct.
/// @title ResolvedCrossChainOrder type
/// @notice An implementation-generic representation of an order
/// @dev Defines all requirements for filling an order by unbundling the implementation-specific orderData.
/// @dev Intended to improve integration generalization by allowing fillers to compute the exact input and output information of any order
struct ResolvedCrossChainOrder {
/// @dev The contract address that the order is meant to be settled by.
address settlementContract;
/// @dev The address of the user who is initiating the swap
address swapper;
/// @dev Nonce to be used as replay protection for the order
uint256 nonce;
/// @dev The chainId of the origin chain
uint32 originChainId;
/// @dev The timestamp by which the order must be initiated
uint32 initiateDeadline;
/// @dev The timestamp by which the order must be filled on the destination chain(s)
uint32 fillDeadline;
/// @dev The inputs to be taken from the swapper as part of order initiation
Input[] swapperInputs;
/// @dev The outputs to be given to the swapper as part of order fulfillment
Output[] swapperOutputs;
/// @dev The outputs to be given to the filler as part of order settlement
Output[] fillerOutputs;
}
/// @notice Tokens sent by the swapper as inputs to the order
struct Input {
/// @dev The address of the ERC20 token on the origin chain
address token;
/// @dev The amount of the token to be sent
uint256 amount;
}
/// @notice Tokens that must be receive for a valid order fulfillment
struct Output {
/// @dev The address of the ERC20 token on the destination chain
/// @dev address(0) used as a sentinel for the native token
address token;
/// @dev The amount of the token to be sent
uint256 amount;
/// @dev The address to receive the output tokens
address recipient;
/// @dev The destination chain for this output
uint32 chainId;
}This struct contains all the information needed to process a particular cross-chain order.
It allows fillers to calculate the exact inputs and outputs of any order and process it appropriately.
Decoding data from the CrossChainOrder struct and converting it into this format (ResolvedCrossChainOrder) makes integration across different systems easier.
ResolvedCrossChainOrder
settlementContract- The address of the contract responsible for settling the order.
swapper- The address of the user initiating the swap. This user's tokens are taken and escrowed.
nonce- A unique number used to prevent replay attacks.
- Ensures that each order is unique.
originChainId- The
chainIdof the origin chain. - Indicates which chain the order originated from.
- The
initiateDeadline- The timestamp by which the order must be initiated.
- The order must be initiated before this deadline.
fillDeadline- The timestamp by which the order must be filled on the destination chain.
- The order must be filled before this deadline.
swapperInputs- Specifies the token inputs taken from the swapper when the order is initiated.
swapperOutputs- Specifies the token outputs delivered to the swapper when the order is fulfilled.
fillerOutputs- Specifies the token outputs delivered to the filler when the order is settled.
Input
token- The address of an ERC20 token on the origin chain.
- Identifies the token supplied by the swapper.
amount- The amount of tokens to be sent.
- Indicates the quantity supplied by the swapper.
Output
token- The address of an ERC20 token on the destination chain.
- Identifies the token to be received when the order is fulfilled.
address(0)is a special value representing the native token.
amount- The amount of tokens to be sent.
- Indicates the quantity to be received.
recipient- The address receiving the output tokens.
- Identifies the recipient of those tokens.
chainId- The destination chain for this output.
- Indicates the chain to which the tokens are sent.
ISettlementContract
/// @title ISettlementContract
/// @notice Standard interface for settlement contracts
interface ISettlementContract {
/// @notice Initiates the settlement of a cross-chain order
/// @dev To be called by the filler
/// @param order The CrossChainOrder definition
/// @param signature The swapper's signature over the order
/// @param fillerData Any filler-defined data required by the settler
function initiate(CrossChainOrder order, bytes signature, bytes fillerData) external;
/// @notice Resolves a specific CrossChainOrder into a generic ResolvedCrossChainOrder
/// @dev Intended to improve standardized integration of various order types and settlement contracts
/// @param order The CrossChainOrder definition
/// @param fillerData Any filler-defined data required by the settler
/// @returns ResolvedCrossChainOrder hydrated order data including the inputs and outputs of the order
function resolve(CrossChainOrder order, bytes fillerData) external view returns (ResolvedCrossChainOrder);
}This is the standard interface for processing cross-chain orders.
initiate
Initiates settlement of a cross-chain order. The filler calls this function with the following arguments.
order- An order definition of type
CrossChainOrder. - This is the order to be settled.
- An order definition of type
signature- The signature of the swapper who issued the order.
- The signature establishes the authenticity of the order.
fillerData- Data that the filler must define.
- Contains additional information required to settle the order.
resolve
Converts a particular CrossChainOrder into a generic ResolvedCrossChainOrder.
Fillers or other contracts call this function with the following arguments.
order- An order definition of type
CrossChainOrder. - This is the order to be decoded.
- An order definition of type
fillerData- Data that the filler must define.
- Contains additional information required to decode the order.
The function returns data of type ResolvedCrossChainOrder.
Additional details
Order data
Standard cross-chain intent flow
- The swapper signs an off-chain message
- The swapper (the user making the trade) signs a message defining the order parameters.
- The signature establishes the authenticity of the order.
- The order is sent to a filler
- The signed order is sent to a filler (a person or system that executes orders).
- The filler initiates the trade on the specified chain
- The filler starts the trade on the specified chain.
- The filler executes the order on the specified chain
- The filler fulfills the order on the specified chain.
- The cross-chain settlement process is executed
- Once the order has been fulfilled, cross-chain settlement takes place and the trade is completed.
Customizable behavior
Developers can customize the following aspects of this flow.
- Pricing
- Examples include Dutch auctions (in which the price gradually decreases) and oracle-based pricing.
- Fulfillment constraints
- For example, orders may require certain conditions to be satisfied.
- Settlement procedures
- For example, the method used to settle an order.
The orderData field
The orderData field can be used to define the details of an order.
The resolve function and the ResolvedCrossChainOrder type
-
The
resolvefunction- Converts a particular
CrossChainOrderinto aResolvedCrossChainOrder. - It allows fillers to evaluate orders without needing detailed knowledge of
orderData.
- Converts a particular
-
The
ResolvedCrossChainOrdertype- Stores decoded order data and provides information about the order's inputs and outputs.
Using Permit2
Permit2 enables token transfers and order authorization with a single signature.
For more information about Permit2, see the following articles.
https://zenn.dev/cryptogames/articles/4251878665f6e4 https://chaldene.net/erc20permit
Using Permit2 provides the following benefits.
- A single signature can authorize both the token transfer and the order.
- Binding the token transfer to order initiation improves security.
The conventional approval model requires two signatures: one for token approval (using ERC2612 or an on-chain transaction) and another to authorize the swap conditions. Because token approval is separate from the swap, a bug or malicious settlement contract may allow approved tokens to be taken at any time.
For more information about ERC2612, see the article below.
[ERC2612] Executing ERC20 approve and transferFrom in a Single Transaction
When using Permit2, the following points need to be considered.
nonce- A
nonceis a unique number used to prevent reuse. - The order struct's
nonceuses the Permit2nonce. - This allows Permit2 to identify unique orders and prevent reuse.
- A
initiateDeadline- The
initiateDeadlineis the timestamp by which the order must be initiated. - The order struct's
initiateDeadlineuses the Permit2deadline. - This allows Permit2 to manage the order's expiration and ensure that it is processed before the deadline.
- The
- Complete order data
- A struct containing detailed order information obtained by decoding
orderData. - When using Permit2, the swapper who issues the order must sign the order authorization.
- The complete order data can be included in the data being signed.
- The swapper can therefore inspect the entire order before signing, maximizing transparency.
- A struct containing detailed order information obtained by decoding
Citation
Mark Toda (@marktoda), Matt Rice (@mrice32), Nick Pai (@nicholaspai), "ERC-7683: Cross Chain Intents [DRAFT]," Ethereum Improvement Proposals, no. 7683, April 2024. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7683.
Conclusion
This article covered ERC-7683, a proposal defining interfaces for cross-chain trade execution systems. I hope this explanation was helpful.
If you have questions, feel free to reach out via direct message on Twitter.
I also publish content on other platforms, which you can find below.



