bnb-x402-payment is an early-stage project in the AI payments / x402 ecosystem, focused on bitcoin, blockchain, bnb, explorer. It currently has 0 GitHub stars and 0 forks, and sits alongside related tools like solana-x402-payment, tdm-integration-kit, gold-402.
A simple, HTTP-native protocol for on-chain payments. x402 makes it trivial for web services to accept low-fee, fast blockchain payments with minimal integration.
"One line of server code to accept digital dollars — no fee, ~2s settlement, $0.001 minimum payment."
Quick example (Express):
app.use(
// How much you want to charge, and where you want the funds to land
paymentMiddleware("0xYourAddress", { "/your-endpoint": "$0.01" })
);
See examples/typescript/servers/express.ts for a complete example.
Requirements
Install and run examples (from the repository root):
# from repo root
cd examples/typescript
pnpm install; pnpm build
cd examples/typescript/servers/express
# set PAY_TO or similar in .env to your address
pnpm dev
cd examples/typescript/clients/axios
# set PRIVATE_KEY in .env to the paying account
pnpm dev
You should see the client successfully request and receive the resource after paying.
x402 was designed to solve shortcomings of existing online payment systems (high fees, friction, and poor programmatic control). Key principles:
x402 reuses HTTP status 402 (Payment Required). Typical flow:
X-PAYMENT: <base64(json)>./verify)./settle.X-PAYMENT-RESPONSE header (base64 JSON) describing settlement details.This design allows resource servers to trade off immediate response vs stronger settlement guarantees.
Payment Required Response (server -> client)
{
"x402Version": 1,
"accepts": [ /* paymentRequirements */ ],
"error": "" // optional
}
paymentRequirements
{
"scheme": "string", // logical payment scheme (eg. "exact")
"network": "string", // chain/network id
"maxAmountRequired": "string",// maximum amount in atomic units
"resource": "string", // resource URL
"description": "string",
"mimeType": "string",
"outputSchema": null | {},
"payTo": "string", // recipient address
"maxTimeoutSeconds": 30,
"asset": "string", // e.g. ERC20 contract address where appropriate
"extra": null | {} // scheme-specific metadata
}
Payment Payload (sent by client in X-PAYMENT, base64-encoded JSON)
{
"x402Version": 1,
"scheme": "exact",
"network": "1",
"payload": { /* scheme-specific */ }
}
A facilitator is an optional 3rd-party that performs verification and on-chain settlement so resource servers don't need node or wallet access.
POST /verify
Request body
{
"x402Version": 1,
"paymentHeader": "<base64-payment-header>",
"paymentRequirements": { /* object from server */ }
}
Response
{
"isValid": true,
"invalidReason": null
}
POST /settle
Request body same as /verify.
Response
{
"success": true,
"error": null,
"txHash": "0x...",
"networkId": "1"
}
GET /supported
Response
{
"kinds": [ { "scheme": "exact", "network": "1" } ]
}
Schemes are logical payment methods (for example exact, which transfers a fixed amount). Each (scheme, network) pair defines how the payload is built, verified, and settled. Implementations and facilitators must declare supported pairs.
The repo contains a first-pass spec for exact on EVM chains at specs/schemes/exact/scheme_exact_evm.md.
examples/typescript/servers/express.ts — Express resource server using x402 middleware.examples/typescript/clients/axios — Example client that follows the 402 flow and pays via X-PAYMENT header.Follow the Getting started section above to run them locally.
From the examples/typescript directory:
cd examples/typescript
pnpm install
pnpm test
This runs the unit tests for the x402 packages.
Contributions are welcome. Please follow these guidelines:
CONTRIBUTING.md (if present). If not present, open an issue to discuss large changes first.specs/schemes.pnpm test.See ROADMAP.md (if present) for longer-term plans and priorities.
This project is provided under the terms of the LICENSE file in the repository root.
If you'd like, I can also:
Next: I'll verify the updated README.md content and report back.
x402 payment on solana
Developer integration tools for adding TDM payments to AI agents, apps, and workflows. CLI, MCP server, and copy-paste examples
⚡ The gold standard for x402 resources. 300+ projects, SDKs, tools, facilitators, and ecosystem data for the HTTP 402 Payment Required protocol. Curated by 24K Labs.
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.