This guide walks you through running a complete dual-chain payment example using the Shielded x402 protocol. You’ll authorize and execute payments on both Base and Solana relayers using a single sequencer credit balance.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.
The multi-chain example demonstrates sequencer-authorized fast execution. For anonymous proof-backed payments, see the shielded fetch integration guide.
Prerequisites
You need the following installed:- Node.js 18+ and pnpm 8+
- Foundry for Solidity contract tests
- PostgreSQL 14+ running locally
- Solana CLI tools (for devnet deployment)
Step 1: Clone and Build
Clone the repository and install dependencies:Step 2: Start the Local Stack
The development stack includes:- Credit Sequencer (port 3200): Authorizes intents and tracks credit balances
- Base Relayer (port 3100): Executes EVM payments in noop or onchain mode
- Solana Relayer (port 3101): Executes Solana devnet transactions
Step 3: Deploy Solana Programs
The Solana relayer requires two onchain programs:- Verifier Program: Groth16 proof verification using Sunspot
- Gateway Program: x402 payment settlement with CPI verify
The deployment scripts use
solana config get to determine your keypair and RPC URL. Ensure you’re configured for Solana devnet before deploying.Step 4: Configure Environment
Set required environment variables for the example:.env
Step 5: Run the Multi-Chain Example
Execute the dual-chain payment flow:Generate agent keypair
Creates an Ed25519 keypair for signing payment intents. The
agentId is derived from the public key hash.Credit agent balance
Calls
POST /v1/admin/credit to seed the agent’s sequencer balance with 5,000,000 micros ($5.00 USD equivalent).Authorize Base payment
Constructs an
IntentV1 for 1,500,000 micros on eip155:8453, signs it with the agent’s private key, and sends AuthorizeRequestV1 to the sequencer.The sequencer validates nonce ordering and balance sufficiency, then returns AuthorizationV1 with a sequencer signature.Execute Base relay payment
Sends
RelayPayRequestV1 to the Base relayer with the signed authorization. The relayer:- Verifies the sequencer signature
- Calls the merchant endpoint (noop adapter by default)
- Reports execution via
POST /v1/credit/executions - Returns merchant response to agent
Authorize Solana payment
Repeats the authorization flow for Solana with
agentNonce: '1' (strictly increasing) and 2,500,000 micros.Step 6 (Optional): Enable Base Onchain Mode
To execute real EVM transactions on Base Sepolia:Step 7: Verify Commitments
Enable commitment epoch posting to test auditability:POST /v1/commitments/run and fetch inclusion proofs:
In production, the sequencer posts commitment roots to
CommitmentRegistryV1 on Base mainnet hourly. Anyone can verify authorization inclusion by reconstructing the merkle path.Cleanup
Stop all running services:What You Learned
You successfully:- Started a local sequencer + dual relayer stack
- Deployed Solana verification programs to devnet
- Authorized and executed payments on Base (noop) and Solana (onchain)
- Verified commitment inclusion proofs
Next Steps
SDK Integration
Integrate
MultiChainCreditClient into your applicationShielded Fetch
Learn anonymous proof-backed x402 payments
Merchant Setup
Accept x402 payments in your API
API Reference
Explore sequencer and relayer endpoints