Standalone x402 facilitator service for Stacks blockchain payment verification and settlement
x402-stacks-facilitator is an early-stage TypeScript project in the AI payments / x402 ecosystem. It currently has 0 GitHub stars and 0 forks.
Standalone x402 facilitator service for Stacks blockchain payment verification and settlement.
Implements the x402 V2 facilitator spec: verifies payment payloads against requirements and settles transactions on the Stacks network.
npx @stackstasker/x402-stacks-facilitator
npm install @stackstasker/x402-stacks-facilitator
npx x402-stacks-facilitator
git clone https://github.com/StacksTasker/x402-stacks-facilitator.git
cd x402-stacks-facilitator
npm install
npm start
The facilitator starts on http://localhost:4000 by default.
| Endpoint | Method | Description |
|---|---|---|
/verify |
POST | Verify a payment payload against a requirement |
/settle |
POST | Broadcast a verified transaction to Stacks |
/supported |
GET | List supported schemes, networks, assets |
/health |
GET | Health check |
/tx/:txId |
GET | Check transaction status |
{
"payload": {
"scheme": "exact",
"network": "stacks",
"chainId": 2147483648,
"recipient": "ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM",
"amount": "5000",
"asset": "STX",
"nonce": 1,
"signature": "...",
"publicKey": "..."
},
"requirement": {
"scheme": "exact",
"network": "stacks",
"chainId": 2147483648,
"recipient": "ST1PQHQKV0RJXZFY1DGX8MNSNYVE3VGZJSRTPGZGM",
"amount": "5000",
"asset": "STX"
}
}
{
"payload": {
"serializedTx": "0x...",
"scheme": "exact",
"network": "stacks",
"chainId": 2147483648,
"recipient": "...",
"amount": "5000",
"asset": "STX",
"nonce": 1,
"signature": "...",
"publicKey": "..."
}
}
| Environment Variable | Default | Description |
|---|---|---|
FACILITATOR_PORT |
4000 |
Port to listen on |
STACKS_NETWORK |
testnet |
Stacks network (mainnet or testnet) |
import { createFacilitator, startFacilitator } from '@stackstasker/x402-stacks-facilitator';
// Start with defaults
startFacilitator();
// Or customize
startFacilitator({
port: 5000,
network: 'mainnet',
corsOrigin: 'https://myapp.com',
});
// Or get the Express app for custom middleware
const { app, port } = createFacilitator({ port: 5000 });
app.use(myCustomMiddleware);
app.listen(port);
x402 is an HTTP-native payment protocol that uses the 402 Payment Required status code. When a client requests a paid resource, the server responds with 402 and payment requirements. The client creates a payment, and the facilitator verifies and settles it on the blockchain.
This is an open-source project and we welcome contributions from the community! Whether it's bug fixes, new features, documentation improvements, or ideas -- all contributions are appreciated.
See CONTRIBUTING.md for details.
This facilitator is used by StacksTasker, an AI agent task marketplace powered by x402 + Stacks.
Apache-2.0 -- see LICENSE for details.
Free to use, modify, and distribute. We believe open infrastructure accelerates the x402 ecosystem for everyone.
Production-ready x402 facilitator server.
Rust SDK for the x402 payment protocol.
Accept payments from AI agents. Open-source. Your data, your domain, your rules. Free forever.
A production-ready payment settlement service for the x402 protocol. Built with Elysia and Node.js, it verifies cryptographic payment signatures and settles transactions on-chain for EVM, SVM (Solana), and Starknet networks.
Golang implementation of an x402 payment facilitator
x402 payment facilitator — verifies and settles EIP-3009 USDC micropayments on Base, Arbitrum, and Ethereum.