BNB x402
Get Started
PROTOCOL v1.0

HTTP-Native
Blockchain Payments

One line of server code to accept digital dollars — no fee, ~2s settlement, $0.001 minimum payment

Integration in seconds

Add blockchain payments to your Express server with a single line of middleware

server.ts
// Express server with BNB x402 payment middleware
import { paymentMiddleware } from 'x402';
import express from 'express';

const app = express();

// One line to accept payments
app.use(
  paymentMiddleware("0xYourAddress", {
    "/api/premium": "$0.01",
    "/api/data": "$0.001"
  })
);

// Your protected endpoints work automatically
app.get('/api/premium', (req, res) => {
  res.json({ data: 'premium content' });
});

Built for the modern web

x402 solves the shortcomings of existing payment systems with a simple, permissionless protocol

Lightning Fast

~2 second settlement with minimal fees. Perfect for micropayments and high-frequency transactions.

Trust Minimizing

Facilitators never gain unilateral control of funds. Your money, your control.

Chain Agnostic

Works with any blockchain. Extensible to new chains and signing schemes.

HTTP Native

Payments carried alongside normal HTTP requests. No extra handshake required.

Open Standard

No reliance on a single provider. Permissionless and open source.

Gasless

Clients and resource servers pay no gas fees via facilitator services.

How it works

Simple 4-step flow that integrates seamlessly with your existing HTTP infrastructure

01

Client requests resource

Your application makes a standard HTTP request to a protected endpoint.

02

Server responds 402

Resource server returns HTTP 402 with payment requirements and accepted options.

03

Client constructs payment

Client chooses a payment method and creates a signed payment payload.

04

Payment verified & settled

Server verifies the payment (optionally via facilitator) and fulfills the request.

Ready to get started?

Choose your path to integrate x402 into your application

Quick Start

Install the package and run the example server in minutes

Documentation

Read the full protocol specification and integration guides

Contribute

Join the community and help build the future of web payments

Start accepting payments today

No signup required. No platform fees. Just add one line of code.