Multi-Chain Protocol Specification
v2.0How the intent framework is implemented across different blockchain runtimes while maintaining semantic consistency.
Overview
ERC-1066-x402 maintains semantic consistency across different blockchain runtimes through standardized status codes and protocol adapters.
Protocol Components
A complete implementation of the framework on any chain must provide:
- 1Status Registry: A library or module defining the standard status codes
- 2Policy Storage: A way to register and store user-defined permissions
- 3Validation Engine: A pre-flight function (
canExecuteorvalidate_intent) that returns a status code without committing state changes - 4Execution Engine: A function that performs the validation and then executes the intent logic
Chain Implementation Details
EVM (Ethereum, Metis, Mantle, Avalanche)
- Language: Solidity 0.8.24+
- Pattern: Interface-driven with
IIntentValidator - Address Format: 20-byte checksummed hex
- Error Handling: Uses
requirewith custom errors or returningbytes1
Solana
- Framework: Anchor 0.30+
- Pattern: Instruction-based dispatch
- Address Format: 32-byte Base58 string
- Error Handling: Mapped to
ProgramError::Custom(u16) - Pre-flight: Uses
simulateTransactionto extract the custom error code
Sui
- Language: Move (Sui Move 2024)
- Pattern: Module-based structs (
Intent,Policy) - Address Format: 32-byte long hex (
0x...) - Error Handling: Uses
abortwith constant values matching GlobalStatusId - Pre-flight: Uses
dryRunTransactionBlockto extract the MoveAbort code
Cross-Chain Hashing
To track intents across chains, the Gateway uses a normalized Keccak256 hash:
- 1Normalization: Non-EVM addresses (Solana/Sui) are converted to bytes and padded/truncated to 32 bytes
- 2Encoding: The fields are ABI-encoded using the following signature:Terminal
keccak256(abi.encode( bytes32, bytes32, bytes, uint256, uint256, uint256, uint256, bytes32 )) - 3ID: This hash serves as the
X-Intent-Hashacross the entire ecosystem