Plug x402 into Hathor and let your endpoints charge per request.
A production-ready facilitator service that bridges HTTP 402 and Hathor transactions. Verifies signatures, validates UTXOs, prevents double-spends, and settles payments on-chain. No gas. Just signed payments and instant access.
Facilitator live preview
Incoming 402 from /premium/reconcile
Endpoints: /verify, /settle, /supported, /health
Why this stack
Built for production with security-first design. The facilitator verifies every signature, checks UTXO availability, prevents double-spends, and handles settlement—all while keeping your keys safe.
402 based gating
Drop the middleware in front of any premium endpoint. Ask for payment, receive X-PAYMENT header, verify and settle through the facilitator.
UTXO aware
We don't pretend Hathor is EVM. Full transaction parsing, signature verification, UTXO validation, and PoW checks—all built for Hathor's architecture.
no private sharing
Client signs locally. Facilitator verifies cryptographically. We check signatures against dataToSignHash, validate UTXOs aren't spent, prevent double-spends, then broadcast. Your keys never leave your wallet.
How it works
The facilitator sits between your resource server and the Hathor network. It verifies payment transactions before settlement and broadcasts them to the blockchain.
- Resource server replies
402 Payment Requiredwith Hathor payment requirements (scheme, network, amount, asset, address). - Client constructs a signed Hathor transaction and sends it in
X-PAYMENTheader (base64-encoded JSON). - Resource server calls
POST /verifyto validate: signatures, UTXO availability, amount, PoW. - If verification passes, resource server calls
POST /settleto broadcast the transaction. - Facilitator pushes the tx to Hathor node and waits for confirmations (if configured).
- Resource server returns
200 OKwith the requested resource.
Getting started
Use the hosted facilitator service to integrate x402 payments into your API. Currently supports testnet-india only.
The facilitator is available at:
https://facilitator.x402.tax
Three endpoints are available:
GET /supported POST /verify POST /settle
Important: If /verify passes, there's a very high chance /settle will succeed. The verify endpoint checks signatures, UTXO availability, double-spend prevention, amount validation, and proof-of-work.
Call the facilitator from your resource server:
# 1. Verify payment
curl -X POST https://facilitator.x402.tax/verify \
-H "Content-Type: application/json" \
-H "X-PAYMENT: <base64-payload>" \
-d '{"requirements": {...}}'
# 2. If verify succeeds, settle payment
curl -X POST https://facilitator.x402.tax/settle \
-H "Content-Type: application/json" \
-H "X-PAYMENT: <base64-payload>"
The verify endpoint performs comprehensive checks: signature validation, UTXO unspent verification, double-spend detection, amount matching, and PoW validation.
A TypeScript SDK is in development for plug-and-play client integration. The SDK will handle wallet interaction, transaction construction, and facilitator communication automatically. Perfect for frontend applications and Node.js backends.
Payment schema
The X-PAYMENT header contains a base64-encoded JSON payload with the transaction and requirements. Here's the structure:
{
"scheme": "exact",
"network": "hathor-testnet",
"payload": {
"txHex": "0001000102...",
"dataToSignHash": "621c94a7c634a6d4d2efc2440e744b31b24cecf3fd0cb0a0ea57674c279a163a"
},
"requirements": {
"amount": 100,
"asset": "00",
"address": "WQ3emmxYypZduTsRgA7x6s1Bj5GqsPcnmo"
}
}
Fields:
• scheme: Payment scheme type (currently only "exact")
• network: "hathor-testnet" or "hathor-mainnet" (testnet-india currently)
• txHex: Fully signed Hathor transaction in hex format
• dataToSignHash: 64-char hex hash from tx-proposal (for signature verification)
• amount: Payment amount in smallest unit (100 = 1.00 HTR)
• asset: "HTR" or "00" for native token
• address: Merchant address to receive payment
API endpoints
The facilitator exposes four HTTP endpoints for payment verification and settlement.
Verifies a payment transaction without broadcasting. Checks signatures, UTXO availability, amount, and PoW.
Response: {
"success": true
}
Broadcasts the verified transaction to the Hathor network and waits for confirmations (if configured).
Response: {
"success": true,
"txID": "000056627b..."
}
Returns supported payment schemes, networks, and assets that this facilitator accepts.
Response: {
"success": true,
"schemes": [{
"scheme": "exact",
"networks": ["hathor-mainnet", "hathor-testnet"],
"assets": ["HTR", "00"]
}]
}
Health check endpoint to verify the facilitator service is running and responsive.
Response: {
"status": "healthy",
"service": "hathor-facilitator"
}