Open facilitator for the x402 protocol — pay-per-request APIs with stablecoins, cross-chain, zero intermediaries.
Server returns HTTP 402 with payment requirements and wallet address
Client sends stablecoin payment through Blocky402 facilitator
Original request retried with X-PAYMENT header, API responds with data
Built on HTTP 402 standard, no proprietary middleware needed
On-chain verification, no custody, transparent settlement
Self-hostable, auditable, community-driven development
Polygon Amoy, Solana Devnet, and Hedera Testnet on hosted testnet; Hedera Mainnet on hosted mainnet; additional EVM and Solana chains when self-hosting
// Node.js client — x402 v2, Hedera. The client never calls Blocky402 directly:
// it hits a protected resource server, and @x402/fetch handles the 402 →
// sign → retry-with-X-PAYMENT → decode-settlement dance. Blocky402 acts as
// the facilitator behind that resource server.
import { wrapFetchWithPayment } from '@x402/fetch';
import { x402Client, x402HTTPClient } from '@x402/core/client';
import { ExactHederaScheme } from '@x402/hedera/exact/client';
import { createClientHederaSigner, PrivateKey } from '@x402/hedera';
// 1. Build a Hedera client signer (payer account + ECDSA key).
const hederaSigner = createClientHederaSigner(
process.env.HEDERA_ACCOUNT_ID!, // e.g. '0.0.7326075'
PrivateKey.fromStringECDSA(process.env.HEDERA_PRIVATE_KEY!),
{ network: process.env.HEDERA_NETWORK || 'hedera:testnet' },
);
// 2. Register the Hedera scheme on a x402Client. Add @x402/evm or @x402/svm
// schemes here too if you want a single client to handle multiple families.
const client = new x402Client().register(
'hedera:*',
new ExactHederaScheme(hederaSigner),
);
// 3. Wrap fetch. fetchWithPayment retries 402 responses with an X-PAYMENT
// header automatically; httpClient lets you decode the settlement response.
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const httpClient = new x402HTTPClient(client);
// 4. Hit the protected resource. One call — no manual verify/settle.
const response = await fetchWithPayment('https://api.example.com/protected', {
method: 'GET',
});
const data = await response.json();
// 5. (Optional) Inspect the on-chain settlement the facilitator performed.
const settlement = httpClient.getPaymentSettleResponse(
(name) => response.headers.get(name),
);
if (settlement) {
console.log('Transaction:', settlement.transaction); // 0.0.<feePayer>@<seconds>.<nanos>
}
console.log('Data:', data);Yes. Blocky402 is an independent, open-source implementation that operates alongside other x402 facilitators.
Yes. Run your own instance using Docker or Node.js. See the documentation for setup instructions.
Hosted testnet: Polygon Amoy, Solana Devnet, and Hedera Testnet. Hosted mainnet: Hedera Mainnet. Additional chains are available when self-hosting. See networks documentation for details.
Yes! Testnet is fully operational and open access (no API key required). Perfect for development and testing. See testnet guide.