Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/nhestrompia/shielded-x402/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Shielded x402 supports multiple blockchain networks through a unified credit sequencer and chain-specific payment relayers. This architecture enables AI agents to make payments across different chains using a single credit balance.

Supported Chains

Base (EVM)

  • Chain ID: 8453 (Mainnet), 84532 (Sepolia Testnet)
  • Chain Reference: eip155:8453, eip155:84532
  • Asset: Native ETH transfers
  • Integration: EVM-compatible via viem
Learn more about Base/EVM integration →

Solana

  • Network: Devnet (MVP target)
  • Chain Reference: solana:devnet
  • Asset: SOL (native)
  • Integration: Custom x402_gateway program with ZK verification
Learn more about Solana integration →

Architecture

Unified Credit System

The credit sequencer maintains a single balance per agent that can be used across all supported chains:
const client = new MultiChainCreditClient({
  sequencerUrl: 'https://sequencer.example.com',
  relayerUrls: {
    'eip155:8453': 'https://base-relayer.example.com',
    'solana:devnet': 'https://solana-relayer.example.com'
  }
});

// Credit the agent once
await client.adminCredit({
  agentId: 'agent_abc123',
  amountMicros: '5000000' // 5 USD equivalent in micros
});

Chain-Specific Relayers

Each supported chain has a dedicated payment relayer that:
  1. Receives authorized payment requests from the sequencer
  2. Executes the payment on the target chain
  3. Reports execution results back to the sequencer

Payment Flow

  1. Intent Creation: Agent creates a payment intent specifying requiredChainRef
  2. Authorization: Sequencer validates and authorizes the intent
  3. Relay: Authorization is sent to the chain-specific relayer
  4. Execution: Relayer executes the payment on the target chain
  5. Reporting: Relayer reports executionTxHash back to sequencer

Chain References

Chain references follow the CAIP-2 standard:
ChainReferenceDescription
Base Mainneteip155:8453Production Base network
Base Sepoliaeip155:84532Base testnet
Solana Devnetsolana:devnetSolana development network

Configuration

Sequencer

The sequencer must be configured with supported chain references:
export SEQUENCER_SUPPORTED_CHAIN_REFS="eip155:8453,solana:devnet"
Defaults to ['eip155:8453', 'solana:devnet'] if not specified.

Relayers

Each relayer is configured with its chain reference and payout mode: Base Relayer:
export RELAYER_CHAIN_REF="eip155:84532"
export RELAYER_PAYOUT_MODE="evm" # or "noop" for testing
export RELAYER_EVM_PRIVATE_KEY="0x..."
Solana Relayer:
export RELAYER_CHAIN_REF="solana:devnet"
export RELAYER_PAYOUT_MODE="solana"
export SOLANA_GATEWAY_PROGRAM_ID="..."
export SOLANA_PAYER_KEYPAIR_PATH="./keypair.json"

Multi-Chain Example

See the multi-chain example for a complete flow demonstrating payments across both Base and Solana using the same agent credit balance.
// Create intents for both chains
const baseIntent: IntentV1 = {
  version: 1,
  agentId,
  agentPubKey,
  signatureScheme: 'ed25519-sha256-v1',
  agentNonce: '0',
  amountMicros: '1500000',
  merchantId: baseMerchantId,
  requiredChainRef: 'eip155:8453',
  expiresAt: String(now + 300),
  requestId: randomHex32()
};

const solanaIntent: IntentV1 = {
  version: 1,
  agentId,
  agentPubKey,
  signatureScheme: 'ed25519-sha256-v1',
  agentNonce: '1',
  amountMicros: '2500000',
  merchantId: solanaMerchantId,
  requiredChainRef: 'solana:devnet',
  expiresAt: String(now + 300),
  requestId: randomHex32()
};

// Both will deduct from the same credit balance
const baseAuth = await client.authorize({ intent: baseIntent, agentSig });
const solanaAuth = await client.authorize({ intent: solanaIntent, agentSig });

Next Steps

Base/EVM Integration

Learn how to configure and use the Base/EVM adapter

Solana Integration

Deploy and configure the Solana gateway program

Build docs developers (and LLMs) love