The Payment Relayer is a chain-bound service that executes authorized payments on behalf of agents. Each relayer instance is tied to a specific blockchain and validates authorizations from the credit sequencer before executing transactions.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
The relayer runtime supports:- Authorization Validation - Verify signed authorizations from the sequencer
- Chain Enforcement - Each relayer instance bound to a specific
chainRef(CAIP-2) - Payment Execution - Execute payments on the target chain
- Execution Reporting - Send signed execution reports back to the sequencer
Legacy
/v1/relay/credit/* routes have been removed. Use /v1/relay/pay with sequencer authorizations.Installation
From the monorepo root:Required Configuration
CAIP-2 chain reference that this relayer instance will operate on.Examples:
eip155:84532(Base Sepolia)eip155:8453(Base Mainnet)solana:devnet(Solana Devnet)
Base URL of the credit sequencer service.Example:
https://sequencer.example.comJSON map of sequencer public keys for verifying authorization signatures.Example:
Ed25519 private key for signing execution reports. Accepts either 32-byte seed or 64-byte key as hex.Example:
0x1234567890abcdef...Logical identifier for this relayer’s key, sent to sequencer in execution reports.Example:
rel-base-prod-1Optional Configuration
HTTP port for the relayer service.
Payout execution mode. Options:
forward- Forward request to merchant endpointnoop- No-op mode for testing (no actual payment)solana- Direct Solana on-chain executionevm- Direct EVM on-chain execution
JSON object of static HTTP headers to include in outbound merchant requests (forward mode).Example:
{"X-API-Key": "secret"}Comma-separated allowlist of hosts for forward mode security.Example:
merchant1.com,merchant2.comTimeout for merchant HTTP requests in milliseconds.
Maximum response body size from merchant (1 MB default).
Rate limit for
/v1/relay/pay endpoint (requests per minute).Optional authentication token. When set,
/v1/relay/pay requires x-relayer-auth-token header.Optional fallback private key for EVM payout mode. Can be overridden per-request.
Payout Modes
Forward Mode
Forwards the payment request to a merchant-specified endpoint:No-op Mode (Testing)
For local smoke tests without actual chain execution:Solana Mode
Direct Solana on-chain payment execution. ThemerchantRequest.bodyBase64 must contain:
Solana RPC endpoint URL.
Solana WebSocket endpoint URL.
Solana gateway program ID.
Solana verifier program ID.
Gateway state PDA (Program Derived Address).
Recipient Solana public key.
Payment amount in lamports.
Authorization ID as hex string.
Authorization expiry timestamp (Unix).
Zero-knowledge proof encoded as base64.
Public witness data encoded as base64.
Path to payer keypair file.
EVM Mode
Direct EVM on-chain payment execution. ThemerchantRequest.bodyBase64 must contain:
EVM RPC endpoint URL.
Recipient EVM address (0x…).
Payment amount in wei.
Optional EVM chain ID.
Optional private key (overrides
RELAYER_EVM_PRIVATE_KEY).API Endpoints
Health & Monitoring
GET /health- Basic health checkGET /health/ready- Readiness probeGET /metrics- Prometheus-compatible metrics
Payment Execution
POST /v1/relay/pay- Execute an authorized payment
Configuration Examples
Base Sepolia Relayer
.env
Solana Devnet Relayer
.env
Multi-Relayer Setup
Run multiple relayers for different chains:Security Considerations
- Private Key Management - Store
RELAYER_REPORTING_PRIVATE_KEYandRELAYER_EVM_PRIVATE_KEYsecurely - Host Allowlist - Use
RELAYER_ALLOWED_HOSTSin forward mode to prevent SSRF attacks - Authentication - Set
RELAYER_CALLER_AUTH_TOKENfor production deployments - Rate Limiting - Adjust
RELAYER_RATE_LIMIT_PER_MINUTEbased on capacity
Next Steps
Credit Sequencer
Configure the authorization sequencer
Deployment Guide
Deploy to production