xRail enables seamless, secure blockchain payments with minimal friction. Build the future of decentralized commerce with our facilitator infrastructure powered by x402 protocol.
The XRail facilitator on Base Sepolia is a paid service supporting the X-402 protocol. It uses a credit-based system where credits are purchased with USDC and automatically deducted when the facilitator settles your payments.
Note: This is a testnet deployment on Base Sepolia for testing and demonstration purposes. The fees shown here are for testing only. Mainnet deployment will have significantly lower fees.
Send USDC to the facilitator contract. You'll be credited the full USDC amount, minus the facilitator fee.
When you submit a payment through the facilitator, your credit balance is checked to ensure you have sufficient credits.
The facilitator executes your USDC transfer on-chain and automatically deducts the fee per transaction from your credits.
The XRailFacilitator contract (proxy) is deployed on Base Sepolia at:
0xe51E3Fd47aa2B70F1211D6614dBaF418Bf51D7D2
View on BaseScan ↗
Technical Details: The contract uses EIP-3009 for gasless USDC payments and implements an upgradeable proxy pattern (ERC-1967) for future improvements. Credits use 6 decimals (same as USDC). All balances are verifiable on-chain and tied to your wallet address.
// Install the PayRail SDK
npm install @payrail/sdk-nodejs
// Initialize and attach to your HTTP client
import axios from 'axios';
import { PayRail } from '@payrail/sdk-nodejs';
const payrail = new PayRail({
facilitatorUrl: 'https://facilitator.xrail.io',
privateKey: process.env.PRIVATE_KEY!,
debug: true
});
const client = axios.create({
baseURL: 'https://api.example.com'
});
// Attach interceptor - automatically handles 402 responses
payrail.attachInterceptor(client);
// Make requests normally - payment is handled automatically
const response = await client.get('/paid-endpoint');
Add @payrail/sdk-nodejs to your project with npm
Initialize with facilitator URL and your private key
Connect SDK to your axios HTTP client instance
SDK automatically handles 402 responses and processes payments
Complete API documentation with all endpoints, parameters, and response formats.
View API Docs →Step-by-step tutorials for integrating xRail into various platforms and frameworks.
Read Guide →Technical specification of the x402 protocol, including security model and architecture.
View Spec →Sample code, use cases, and example implementations for common scenarios.
Browse Examples →