EIPs Explained

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 via eth_call. Because it is never executed in a transaction, resolution can be complex without costing users gas.
  • The resolver returns a ResolvedOrder:
    • steps: currently Call steps (target, selector, arguments) with attributes such as SpendsERC20, SpendsGas, TimingBounds, RevertPolicy (ignore or abort), NeedsStep and NeedsVariable.
    • 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) and Witness.
    • payments: ERC20 payments 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).
  • 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.fill and ResolvedCrossChainOrder with maxSpent / 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 bytes were one motivation for EIP-7713 box types for EIP-712 messages.

#intents #cross-chain #solvers #interoperability

Details

Authors
Francisco Giordano (@frangio), Mark Toda (@marktoda), Matt Rice (@mrice32), Nick Pai (@nicholaspai), Alexander Lindgren (@reednaa), Mark Gretzke (@mgretzke), Chris Cashwell (@ccashwell)
Status
Draft
Type
Standards Track / ERC
Created
2024-04-11
Requires

Machine-readable: Markdown · JSON