Docs/ERC-1066-x402/Guides/Multi-Chain Deployment

Multi-Chain Deployment

ERC-1066-x402 is designed to be network-agnostic, providing a unified intent and status layer across heterogeneous blockchains.

Overview

The system achieves multi-chain support through three key components: a global status specification, on-chain adapters, and gateway adapters.

Global Status Spec

Standardized status IDs (e.g., 84 for Insufficient Funds) used across all chains

On-Chain Adapters

Smart contracts (EVM), programs (Solana), or modules (Sui) that map runtime-specific errors

Gateway Adapters

Off-chain middleware handling chain-specific RPC calls and simulation

Architecture

The gateway automatically determines the chain type and routes requests to the appropriate adapter. Each adapter handles chain-specific validation and status code extraction.

Network-Agnostic Design

The gateway uses Chainlist for automatic RPC discovery, so you can add new networks without code changes. See the Gateway Setup guide for configuration details.

Chain-Specific Mappings

EVM (Ethereum, L2s)

  • Encoding: bytes1
  • Mechanism: view functions returning status codes
  • Verification: eth_call (readContract)

Solana (Anchor)

  • Encoding: u16
  • Mechanism: ProgramError::Custom(status)
  • Verification: simulateTransaction. Gateway parses simulation logs to find custom error code

Sui (Move)

  • Encoding: u64
  • Mechanism: abort status
  • Verification: dryRunTransactionBlock. Gateway extracts abort code from transaction effects

Intent Routing

When an agent sends an intent to the Gateway, the following flow occurs:

  1. 1Agent sends POST request with intent and chainId
  2. 2Gateway determines ChainType (EVM, Solana, Sui) from chainId
  3. 3Gateway routes to appropriate adapter (EVM/Solana/Sui)
  4. 4Adapter performs chain-specific simulation/dry-run
  5. 5Adapter extracts error code/status from chain response
  6. 6Adapter maps chain-specific code to global status ID (e.g., 0x54)
  7. 7Gateway returns HTTP response with status code and headers

Real-World Deployments

ERC-1066-x402 is deployed and verified on multiple networks:

Solana Devnet

Program ID: B5fwL2MnnGTsJzShmJYjdVGSDwduyr3Guan9XNAF7Vbb

Verified

Sui Testnet

Package ID: 0x2557e9f986be02da639277dbdd14b028964288fb46b801e3d151312571a2bb8e

Verified