x402 Facilitator

Octo x402 Protocol Documentation

Overview

Octo x402 is a decentralized payment protocol that enables instant micropayments for digital content and API access. It supports both EVM (Ethereum Virtual Machine) and SVM (Solana Virtual Machine) networks, allowing merchants to accept USDC payments seamlessly across multiple blockchains.

Protocol Version: x402 v1 Facilitator URL: https://facilitator.octox402.xyz Status: Production Ready (12 networks) | Testing Phase (BSC, Ethereum, and more)

Architecture

The x402 protocol consists of three main components:

1. Facilitator

  • URL: https://facilitator.octox402.xyz

  • Verifies payment signatures and requirements

  • Submits transactions to blockchain

  • EVM Networks: Facilitator pays gas fees (~$0.001-0.01)

  • SVM Networks: Facilitator only verifies; consumer pays transaction fees (~$0.000005)

2. Merchant

  • Exposes content behind payment requirements

  • Returns HTTP 402 with payment requirements when payment is needed

  • Verifies payments via facilitator

  • Serves content after successful payment settlement

3. Consumer

  • Signs payment authorizations using wallet

  • Sends payments via X-PAYMENT header

  • Receives content after payment verification


Supported Networks

⚡ Production Ready (12 Networks)

EVM Networks (10 networks)

Network
Network ID
Chain ID
Type
Status

Base

base

8453

Mainnet

✅ Live

Base Sepolia

base-sepolia

84532

Testnet

✅ Live

Abstract

abstract

-

Mainnet

✅ Live

Abstract Testnet

abstract-testnet

-

Testnet

✅ Live

Polygon

polygon

137

Mainnet

✅ Live

Polygon Amoy

polygon-amoy

80002

Testnet

✅ Live

Avalanche C-Chain

avalanche

43114

Mainnet

✅ Live

Avalanche Fuji

avalanche-fuji

43113

Testnet

✅ Live

SEI

sei

-

Mainnet

✅ Live

SEI Testnet

sei-testnet

-

Testnet

✅ Live

IoTeX

iotex

4689

Mainnet

✅ Live

Peaq

peaq

-

Mainnet

✅ Live

SVM Networks (2 networks)

Network
Network ID
Type
Status

Solana

solana

Mainnet

✅ Live

Solana Devnet

solana-devnet

Testnet

✅ Live

🚧 Coming Soon (Testing Phase)

  • BSC (Binance Smart Chain) - Chain ID: 56

  • Ethereum Mainnet - Chain ID: 1

  • Optimism - Layer 2

  • Arbitrum - Layer 2

  • Additional EVM-compatible chains


Network Details

USDC Contract Addresses

EVM Networks

  • Base: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913

  • Polygon: 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359

  • Avalanche: 0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E

SVM Networks

  • Solana: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

Transaction Fees

Network
Average Fee
Who Pays
Settlement Time

Base

~$0.001

Facilitator

~2 seconds

Polygon

~$0.001

Facilitator

~2 seconds

Avalanche

~$0.01

Facilitator

~2 seconds

Solana

~$0.000005

Consumer

~400ms


Getting Started

Prerequisites

Environment Variables

Create a .env file:

Quick Start

1. Check Supported Networks

2. Test Health

3. Implement Consumer (See examples below)


EVM Implementation

Consumer (Base Mainnet)

Merchant (Base Mainnet)


SVM Implementation

Consumer (Solana Mainnet)

Important: On Solana, the consumer pays their own transaction fees (~$0.000005). The facilitator only verifies the payment.

Merchant (Solana Mainnet)


Payment Flow

1. Initial Request

2. Payment Required

3. Payment Creation

4. Payment Submission

5. Payment Verification

6. Payment Settlement

7. Content Delivery


Facilitator API Reference

Base URL: https://facilitator.octox402.xyz

Endpoints Overview

Endpoint
Method
Description
Auth Required

/

GET

Service information

No

/health

GET

Health check

No

/supported

GET

List supported networks

No

/stats

GET

Facilitator statistics

No

/verify

GET

Verify endpoint info

No

/verify

POST

Verify payment signature

Optional

/settle

GET

Settle endpoint info

No

/settle

POST

Settle payment on blockchain

Optional


GET /supported

Returns all supported payment networks and schemes.

Response:


GET /stats

Returns facilitator statistics and performance metrics.

Response:


POST /verify

Verifies payment signature and requirements without settling on blockchain.

Request Headers:

Request Body:

Success Response (200):

Failure Response (200):

Error Response (400/500):


POST /settle

Verifies and settles payment on blockchain. For EVM networks, facilitator pays gas fees. For SVM networks, facilitator only submits the pre-signed transaction.

Request Headers:

Request Body: Same as /verify

Success Response (200):

For Solana (SVM):

Failure Response (200):


Sample Transactions

EVM Transaction Example (Base Mainnet)

Transaction Hash: 0x1f00f9d92d433c29472354853f77c3a97398b01f4e0820c13a068e29daebdd2c

Explorer Link: View on Basescan

Transaction Details:

  • Network: Base Mainnet

  • From: Consumer Wallet

  • To: USDC Contract (transferWithAuthorization)

  • Amount: $0.01 USDC

  • Gas Fee: ~$0.001 (paid by facilitator)

  • Confirmation Time: ~2 seconds

  • Total Cost to Consumer: $0.01 USDC


SVM Transaction Example (Solana Mainnet)

Transaction Signature: 4haFW9Zp7cB8tgqPgASvyEJhPYfZaNKcLVHdhCKPhiKuCWudtSHEQWQhMDuWzhBEeg9F9LVED4ZC6E8hYU4CPWMi

Explorer Link: View on Solana Explorer

Transaction Details:

  • Network: Solana Mainnet

  • Transaction Type: SPL Token Transfer (v0 versioned transaction)

  • From: Consumer Token Account

  • To: Merchant Token Account

  • Amount: $0.01 USDC

  • Transaction Fee: ~$0.000005 (paid by consumer)

  • Confirmation Time: ~400ms

  • Total Cost to Consumer: $0.010005 USDC

Important Note: Solana transactions use versioned transactions (v0) which are more efficient and support lookup tables for reduced transaction size.


Advanced Examples

Multi-Network Consumer (Universal)

This example shows how to create a universal consumer that works across all supported networks:


Polygon Payment Example


Avalanche Payment Example


Multi-Endpoint Merchant

This example shows a merchant that accepts payments on multiple networks:

Security

  1. Never expose private keys in code or version control

  2. Use environment variables for sensitive configuration

  3. Validate all payment requirements match expected values

  4. Implement rate limiting on merchant endpoints

  5. Use HTTPS for all production deployments

Performance

  1. Cache payment verification results where appropriate

  2. Implement request timeouts (recommended: 30 seconds)

  3. Use connection pooling for RPC endpoints

  4. Monitor facilitator health regularly

Error Handling

  1. Always validate payment payload format before processing

  2. Return clear error messages to consumers

  3. Log all payment attempts for debugging

  4. Implement retry logic for network failures

  5. Handle expired signatures gracefully

Cost Optimization

EVM (Base)

  • Gas fees: ~$0.001 per transaction (paid by facilitator)

  • Payment amount: $0.01+ USDC

  • Total consumer cost: Payment amount only

SVM (Solana)

  • Transaction fees: ~$0.000005 per transaction (paid by consumer)

  • Payment amount: $0.01+ USDC

  • Total consumer cost: Payment amount + ~$0.000005


Support

  • Facilitator URL: https://facilitator.octox402.xyz

  • Documentation: https://docs.octonet.ai/key-features/octo-x402

  • Website: https://octonet.ai

  • Protocol Version: x402 v1

Network Status

  • Production Ready: Base, Base Sepolia, Abstract, Abstract Testnet, Polygon, Polygon Amoy, Avalanche, Avalanche Fuji, SEI, SEI Testnet, IoTeX, Peaq, Solana, Solana Devnet (12 networks)

  • Testing Phase: BSC (Binance Smart Chain), Ethereum Mainnet, Optimism, Arbitrum

Key Features

  • ✅ 12 production-ready networks across EVM and SVM

  • ✅ Instant micropayments with USDC

  • ✅ HTTP 402 payment protocol

  • ✅ EIP-712 signatures for EVM

  • ✅ Versioned transactions (v0) for Solana

  • ✅ Facilitator pays gas on EVM networks

  • ✅ Consumer pays minimal fees on Solana (~$0.000005)

  • ✅ Production-grade facilitator with 99.9% uptime

Sample Transactions

EVM (Base): 0x1f00f9... SVM (Solana): 4haFW9...

Last updated