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.
Endpoint
Overview
The relay pay endpoint executes a sequencer-signed authorization by performing the merchant request and reporting the execution result back to the sequencer. It supports multiple payout modes including forwarding requests to merchant endpoints, Solana transfers, and EVM transfers.Authentication
Optional bearer token for authenticating relay callers. Required if
RELAYER_CALLER_AUTH_TOKEN is configured on the relayer.Request Body
The sequencer-signed authorization for the payment
ED25519 signature from the sequencer (64-byte hex, e.g.,
0x1234...)The HTTP request to execute for the merchant
Payout Modes
The relayer can operate in different modes configured viaRELAYER_PAYOUT_MODE:
forward (default)
Forwards the merchant request to the specified URL and returns the response. Requirements:merchantRequest.urlmust use HTTPS- URL cannot resolve to private/internal IPs
- URL hostname must be in allowlist (if
RELAYER_ALLOWED_HOSTSis configured)
noop
Returns a mock success response without making any external calls. Used for testing. Response:solana
Executes a Solana payment using the gateway program. Body Payload (inmerchantRequest.bodyBase64, JSON encoded):
txSignature: Solana transaction signature
evm
Executes an EVM native token transfer. Body Payload (inmerchantRequest.bodyBase64, JSON encoded):
payload.privateKey(if valid)RELAYER_EVM_PRIVATE_KEYenvironment variable
txHash: EVM transaction hash (0x-prefixed 64-char hex)
Response
Execution transaction hash. For
solana mode, this is the transaction signature. For evm mode, this is the transaction hash. For forward and noop modes, this is a derived hash.The authorization ID from the request (32-byte hex)
Execution status:
DONE or FAILEDPresent when
status is FAILED. Contains error details.Present when
status is DONE. Contains the merchant response.Status Codes
- 200 OK: Payment executed successfully (
status: "DONE") - 401 Unauthorized: Invalid or missing
x-relayer-auth-token - 422 Unprocessable Entity: Payment failed (
status: "FAILED") - 429 Too Many Requests: Rate limit exceeded
Examples
Forward Mode Example
Solana Mode Example
EVM Mode Example
Failure Response (422 Unprocessable Entity)
Error Handling
Common failure reasons include:"unauthorized caller"- Invalid or missing auth token"authorization expired"- Authorization timestamp is pastexpiresAt"authorization chainRef mismatch"- Request chain doesn’t match relayer configuration"invalid sequencer signature"- Signature verification failed"unknown sequencer_key_id"- Sequencer key not in configured key map"merchant URL must use https"- Non-HTTPS URL in forward mode"merchant hostname resolves to private/internal IP"- Security check failed"merchant response exceeded max allowed size"- Response too large"merchant request timeout"- Request exceeded configured timeout"solana payout mode requires merchantRequest.bodyBase64 payload"- Missing required field"evm private key unavailable/invalid"- No valid EVM private key configured
Security
URL Validation (Forward Mode)
The relayer enforces strict URL validation:- Must use HTTPS protocol
- Cannot use
localhostor.localdomains - Hostname must be in allowlist (if configured)
- DNS resolution cannot point to private IP ranges:
10.0.0.0/8127.0.0.0/8169.254.0.0/16172.16.0.0/12192.168.0.0/16- IPv6 loopback and link-local
Rate Limiting
The relayer implements per-IP rate limiting configurable viaRELAYER_RATE_LIMIT_PER_MINUTE (default: 180 requests/minute).
Response Size Limits
Merchant responses are limited toRELAYER_MAX_RESPONSE_BYTES (default: 1MB) to prevent memory exhaustion.
Signature Verification
All requests must include a valid ED25519 signature from a known sequencer public key configured inRELAYER_SEQUENCER_KEYS_JSON.
Execution Reporting
After executing the merchant request, the relayer automatically reports the execution result to the sequencer viaPOST /v1/credit/executions. The report includes:
- Execution transaction hash
- Success/failure status
- ED25519 signature from the relayer’s private key
Configuration
Key environment variables:RELAYER_CHAIN_REF- Chain identifier (required)RELAYER_SEQUENCER_URL- Sequencer base URL (required)RELAYER_PAYOUT_MODE- One of:forward,noop,solana,evm(default:forward)RELAYER_CALLER_AUTH_TOKEN- Optional bearer token for caller authenticationRELAYER_ALLOWED_HOSTS- Comma-separated list of allowed merchant hostnamesRELAYER_MERCHANT_TIMEOUT_MS- Request timeout in milliseconds (default: 5000)RELAYER_MAX_RESPONSE_BYTES- Max response size in bytes (default: 1048576)RELAYER_RATE_LIMIT_PER_MINUTE- Rate limit per IP (default: 180)RELAYER_EVM_PRIVATE_KEY- Private key for EVM mode (required forevmmode)RELAYER_SEQUENCER_KEYS_JSON- JSON map of sequencer key IDs to public keys (required)RELAYER_REPORTING_PRIVATE_KEY- ED25519 private key for signing execution reports (required)