███████╗███████╗██╗ ███████╗██╗ ██╗██╗ ██╗ ██████╗ ██████╗
██╔════╝██╔════╝██║ ██╔════╝╚██╗██╔╝██║ ██║██╔═████╗╚════██╗
███████╗█████╗ ██║ █████╗ ╚███╔╝ ███████║██║██╔██║ █████╔╝
╚════██║██╔══╝ ██║ ██╔══╝ ██╔██╗ ╚════██║████╔╝██║██╔═══╝
███████║███████╗███████╗██║ ██╔╝ ██╗ ██║╚██████╔╝███████╗
╚══════╝╚══════╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
███████╗ █████╗ ██████╗██╗██╗ ██╗████████╗ █████╗ ████████╗ ██████╗ ██████╗
██╔════╝██╔══██╗██╔════╝██║██║ ██║╚══██╔══╝██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗
█████╗ ███████║██║ ██║██║ ██║ ██║ ███████║ ██║ ██║ ██║██████╔╝
██╔══╝ ██╔══██║██║ ██║██║ ██║ ██║ ██╔══██║ ██║ ██║ ██║██╔══██╗
██║ ██║ ██║╚██████╗██║███████╗██║ ██║ ██║ ██║ ██║ ╚██████╔╝██║ ██║
╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
0xcebA9300f2b948710d2653dD7B07f33A8B32118C
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.selfx402.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) => {
res.json({
version: 1,
facilitatorUrl: "https://facilitator.selfx402.xyz",
payment: {
network: "celo",
asset: "0xcebA9300f2b948710d2653dD7B07f33A8B32118C",
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" }
}
}
});
});
📦 NPM: selfx402-framework
📦 Widget: selfx402-pay-widget
📖 Docs: GitHub Repository
🌐 Explorer: https://celoscan.io
🔗 x402: x402.gitbook.io
🔑 Self Protocol: docs.self.xyz
Built with ❤️ for the Self ZK Residency (Oct 14-31, 2025)
Self Protocol • x402 • Celo • TypeScript • Express • Supabase