ERC-7683 · Draft · ERC · 2024-04-11
ERC-7683: Cross Chain Intents
A solver-facing standard for intent protocols: each protocol publishes a resolver contract that turns its opaque order payloads into a common list of steps, variables and payments any solver can evaluate and fill.
What problem does it solve?
Intent protocols let a user say what they want ("move 100 USDC from chain A to chain B") and let specialized actors, called solvers or fillers, do the work in exchange for payment. Cross-chain bridging and swapping are the classic use case.
Today each protocol has its own order format, settlement contract and fill flow. A solver has to write a custom integration for every protocol, so solver liquidity is fragmented and new protocols struggle to attract competitive fillers. ERC-7683 standardizes only the part solvers consume, so one "programmable solver" can support many protocols without protocol-specific code, while protocols stay free to design escrow, settlement, pricing and auctions however they like.
How it works
- A protocol encodes each order as an opaque payload and deploys a resolver contract.
- Solvers call
resolve(payload)off-chain viaeth_call. Because it is never executed in a transaction, resolution can be complex without costing users gas. - The resolver returns a
ResolvedOrder:- steps: currently
Callsteps (target, selector, arguments) with attributes such asSpendsERC20,SpendsGas,TimingBounds,RevertPolicy(ignoreorabort),NeedsStepandNeedsVariable. - variables: values the solver decides or observes, with roles like
PaymentRecipient,PaymentChain,StepCaller,ExecutionOutput(e.g. block timestamp of a step),Query(eth_call),QueryEvents(eth_getLogs) andWitness. - payments:
ERC20payments to the solver, tied to a step, with an estimated delay. - assumptions: named conditions the resolver cannot check itself; the solver must validate them (e.g. against a whitelist).
- steps: currently
- Addresses are ERC-7930 interoperable addresses, so orders can reference non-EVM chains.
- The resolver is the point of trust: solvers vet and whitelist resolver addresses, then follow their instructions.
Sample code
The core EVM interface (abridged from the spec):
interface IResolver {
struct Assumption {
string name;
bytes data;
}
struct ResolvedOrder {
bytes[] steps; // IStep ABI calldata, e.g. Call(...)
bytes[] variables; // IVariableRole ABI calldata
bytes[] payments; // IPayment ABI calldata
Assumption[] assumptions;
}
function resolve(bytes calldata payload) external view returns (ResolvedOrder memory);
}
A solver resolving an order off-chain (ethers v6):
import { Contract, JsonRpcProvider } from "ethers";
const provider = new JsonRpcProvider(process.env.RPC_URL);
const resolver = new Contract(RESOLVER_ADDRESS, [
"function resolve(bytes payload) view returns (tuple(bytes[] steps, bytes[] variables, bytes[] payments, tuple(string name, bytes data)[] assumptions))",
], provider);
const order = await resolver.resolve(payload); // eth_call, no gas spent
if (!WHITELISTED_RESOLVERS.has(RESOLVER_ADDRESS)) throw new Error("untrusted resolver");
for (const a of order.assumptions) validateAssumption(a.name, a.data);
Things to know
- Status: Draft. The interface has changed substantially. An earlier draft defined
IOriginSettler.open/openFor,IDestinationSettler.fillandResolvedCrossChainOrderwithmaxSpent/minReceived; the current text replaces that with the resolver model and explains why. Code written for the old draft is not compatible. - A resolver must guarantee that an order can only abort through declared revert policies; otherwise a solver following the steps must be able to complete them and get paid.
- The ERC does not make settlement secure. Solvers still carry risk from the moment they commit capital until payment is final, and must review any implicit assumptions a resolver documents.
- Order payloads with type-erased
byteswere one motivation for EIP-7713 box types for EIP-712 messages.