Semantic Layer Specification

ERC-1066

Unified "language" of status codes used by ERC-1066-x402 to enable machine-readable transaction feedback.

Overview

Status codes are 1-byte identifiers (represented as hex 0xXX in EVM and u16 in Solana/Sui) that represent the outcome of an intent validation or execution.

Core Status Map

Standard status codes and their HTTP mappings:

IDHexNameHTTP Map
10x01S_SUCCESS200
160x10S_DISALLOWED403
170x11S_ALLOWED200
320x20S_TOO_EARLY202
330x21S_TOO_LATE410
340x22S_NONCE_USED409
800x50S_TRANSFER_FAILED500
840x54S_INSUFFICIENT_FUNDS402
1600xA0S_INVALID_FORMAT400
1620xA2S_UNSUPPORTED_CHAIN421

Byte Encoding Rules

EVM (Solidity)

Implemented as bytes1 in StatusCodes.sol

Return values from canExecute should be explicitly cast to bytes1

Solana (Rust)

Implemented as u16 constants in status.rs

Mapped to ProgramError::Custom(status)

Sui (Move)

Implemented as u64 constants in intent_framework.move

Mapped to module-specific abort codes

Machine-Readable Branching

AI agents must use these codes to determine their next action:

  • 0x11→ Call execute()
  • 0x54→ Request funds from Facilitator
  • 0x20→ Wait and retry