Need help? Join the Discord for the assistant and get latest updates.
Technical Architecture Overview
On Prism, X402 is implemented using EIP-3009 compatible tokens and a facilitator service:- Define payment requirements - The seller defines payment requirements (amount, asset, network, expiry, nonce scope)
- Sign authorization - The buyer signs an EIP-712 typed
transferWithAuthorizationpayload - Validate and verify - The facilitator validates the signature and checks chain state (nonce status, balances)
- Execute on-chain - The facilitator submits an on-chain transaction to the X402 token contract
- Distribute funds - After confirmation, the facilitator triggers Spectrum Registry for revenue splitting
This keeps settlement logic and on-chain orchestration in one place while your application stays focused on business behavior.
Component Overview
Wallets
Create and sign EIP-3009/EIP-712 authorizations
Facilitators
Verify and settle authorizations on-chain
Spectrum
Distribute settled amounts according to configured rules
EIP-3009 Explained
The FD X402 Token (fd-x402-coin) supports EIP-3009, which adds gasless, authorization-based transfers to ERC-20:
Core Functions
transferWithAuthorization- Transfer tokens based on signed payloadsreceiveWithAuthorization- Receive tokens based on signed payloads
Authorization Components
Each authorization includes:The contract tracks authorization state by
(authorizer, nonce) so each authorization can only be used once.Key Properties
Gasless Transfers
Gasless Transfers
Users sign authorizations; facilitators pay gas to execute transfers on-chain
Replay Protection
Replay Protection
Nonce-based mechanism ensures each authorization can only be used once
Time Bounds
Time Bounds
validAfter and validBefore timestamps limit authorization lifetimeEIP-712 Signatures
EIP-712 defines how clients sign structured data for authorizations:Domain Structure
The domain includes:- name - Token name
- version - Contract version
- chainId - Network chain ID
- verifyingContract - X402 token contract address
Type Definition
Seller Wallets
Seller wallets must:- Hold balances of the X402 token on supported networks
- Be addressable by the token contract (EOA or smart account)
- Integrate with treasury and reporting systems
Wallet Types
On Prism, seller wallets can be:Plain EOAs
Traditional externally owned accounts
Smart Accounts
Managed by Smart Wallet Server
MCP Wallets
Controlled through MCP servers for agentic flows
For agentic scenarios, combine seller wallets with MCP servers (e.g., FD X402 Wallet) so agents can reason about balances and authorizations without direct key access.
Authorization Format
A complete X402/EIP-3009 authorization includes:| Field | Type | Description |
|---|---|---|
from | address | Address authorizing the transfer |
to | address | Recipient address |
value | uint256 | Token amount in wei |
validAfter | uint256 | Earliest timestamp when valid |
validBefore | uint256 | Expiry timestamp |
nonce | bytes32 | Unique identifier for replay protection |
v, r, s | bytes | Signature components |
Settlement Process
The X402 Facilitator settlement pipeline:1
Receive authorization
Receive the signed authorization payload from client
2
Validate
Validate structure, signature, and temporal bounds
3
Query chain state
Check nonce status and balances on-chain
4
Submit transaction
Submit
transferWithAuthorization to X402 token contract5
Wait for confirmation
Wait for transaction receipt and confirm success
6
Trigger distribution
Call Spectrum Registry with payment metadata to execute distribution
7
Return result
Return deterministic result (success or error) to the caller
Spectrum Registry
Spectrum Registry is the on-chain distribution layer that X402 plugs into after settlement.What is Spectrum?
Distribution Configurations
Stores configurations that define how payments are split across multiple recipients
Post-Settlement Splits
Executes automated splits when called by the facilitator
How It Works
In a typical X402 flow on Prism:1
Create configuration
The seller or platform creates a Spectrum configuration with target addresses and weights
2
Reference in payments
X402 payments reference this configuration ID
3
Execute settlement
After
transferWithAuthorization succeeds, the facilitator calls Spectrum with payment metadata and configuration ID4
Distribute funds
Spectrum executes the distribution on-chain and emits events for reconciliation
Implementations
Spectrum EVM Registry
Spectrum EVM Registry
Location:
fd-prism-spectrum-evmA Solidity contract with minimal proxy forwarders so each provider gets a unique payment address. Payments sent to that forwarder are automatically received by Spectrum and distributed according to the configured structure.Component Types:- Basis points components - Percentage-based splits (e.g., 500 = 5%)
- Percentage components - Percentage values with decimal precision
- Fixed amount components - Fixed token amounts to specific recipients per settlement
Spectrum SVM Registry
Spectrum SVM Registry
Location:
fd-prism-spectrum-svmA Solana program offering the same fee and distribution model with atomic settlement in a single transaction.Component Types:- Basis points components - Percentage-based splits (e.g., 500 = 5%)
- Percentage components - Percentage values with decimal precision
- Fixed amount components - Fixed token amounts to specific recipients per settlement
Security Model
Key security properties for X402 on Prism:Replay Protection
Nonce tracking in the token contract ensures each authorization can only be used once
Signature Validation
EIP-712 typed signatures are validated against the token’s domain and types
Time-Bounded Authorizations
validBefore bounds authorization lifetime and reduces exposureScoped Facilitator
The facilitator is stateless and focused solely on verification and settlement, reducing attack surface
Spectrum Separation
Distribution logic is isolated from payment execution, simplifying audits and change management