██╗ ██╗ ██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗ ██╗ ██╗ ██████╗
╚██╗██╔╝ ██║ ██║ ██╔═████╗ ╚════██╗ ██║ ██║ ██║ ██║ ██╔══██╗
╚███╔╝ ███████║ ██║██╔██║ █████╔╝ ███████║ ██║ ██║ ██████╔╝
██╔██╗ ╚════██║ ████╔╝██║ ██╔═══╝ ╚════██║ ██║ ██║ ██╔══██╗
██╔╝ ██╗ ██║ ╚██████╔╝ ███████╗ ██║ ╚██████╔╝ ██████╔╝
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═════╝ ╚═════╝
███████╗ █████╗ ██████╗ ██╗ ██╗ ██╗ ████████╗ █████╗ ████████╗ ██████╗ ██████╗
██╔════╝ ██╔══██╗ ██╔════╝ ██║ ██║ ██║ ╚══██╔══╝ ██╔══██╗ ╚══██╔══╝ ██╔═══██╗ ██╔══██╗
█████╗ ███████║ ██║ ██║ ██║ ██║ ██║ ███████║ ██║ ██║ ██║ ██████╔╝
██╔══╝ ██╔══██║ ██║ ██║ ██║ ██║ ██║ ██╔══██║ ██║ ██║ ██║ ██╔══██╗
██║ ██║ ██║ ╚██████╗ ██║ ███████╗ ██║ ██║ ██║ ██║ ██║ ╚██████╔╝ ██║ ██║
╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48
0xcebA9300f2b948710d2653dD7B07f33A8B32118C
0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359
0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E
0xaf88d065e77c8cC2239327C5EDb3A432268e5831
Connect any API service to this facilitator in 3 simple steps:
npm install selfx402-framework
// src/config/x402.ts
export const x402Config = {
network: "celo",
facilitatorUrl: "https://facilitator.x402hub.xyz",
paymentPrice: "0.001", // $0.001 for verified humans
walletAddress: process.env.PAYMENT_WALLET_ADDRESS
};
import { celoPaymentMiddleware } from "selfx402-framework/middleware";
const paymentMiddleware = celoPaymentMiddleware({
facilitatorUrl: x402Config.facilitatorUrl,
network: x402Config.network,
paymentPrice: x402Config.paymentPrice,
walletAddress: x402Config.walletAddress,
enableSelfProtocol: true, // Enable proof-of-unique-human
});
// Apply to protected routes
app.get("/api/protected", paymentMiddleware, (req, res) => {
const tier = req.tier; // "verified_human" | "unverified"
res.json({ message: "Access granted!", tier });
});
app.get("/.well-known/x402", (req, res) => {
// Use first enabled network as example
const exampleNetwork = networkService.getEnabledNetworks()[0] || "base";
const exampleConfig = networkService.getNetworkConfig(exampleNetwork);
res.json({
version: 1,
facilitatorUrl: "https://facilitator.x402hub.xyz",
payment: {
network: exampleNetwork,
asset: "${exampleConfig.usdcAddress}",
payTo: x402Config.walletAddress,
},
verification: {
enabled: true,
requirements: {
minimumAge: 18,
excludedCountries: [], // ISO 3166-1 alpha-3
ofac: false,
},
scope: "my-api-v1", // Unique identifier
},
pricing: {
tiers: {
unverified: { price: "1.00", description: "Bot pricing" },
verified_human: { price: "0.001", description: "1000x cheaper" }
}
}
});
});
Built with ❤️ for the Self ZK Residency (Oct 14-31, 2025)
Self Protocol • x402Hub • Multi-Chain • TypeScript • Express • Supabase