Add blockchain payments to your Express server with a single line of middleware
// Express server with RUST402 payment middleware
import { paymentMiddleware } from 'rust402';
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' });
});Watch a live payment flow from request to settlement
RUST402 solves the shortcomings of existing payment systems with a simple, permissionless protocol
~2 second settlement with minimal fees. Perfect for micropayments and high-frequency transactions.
Facilitators never gain unilateral control of funds. Your money, your control.
Works with any blockchain. Extensible to new chains and signing schemes.
Payments carried alongside normal HTTP requests. No extra handshake required.
No reliance on a single provider. Permissionless and open source.
Clients and resource servers pay no gas fees via facilitator services.
Simple 4-step flow that integrates seamlessly with your existing HTTP infrastructure
Your application makes a standard HTTP request to a protected endpoint.
Resource server returns HTTP 402 with payment requirements and accepted options.
Client chooses a payment method and creates a signed payment payload.
Server verifies the payment (optionally via facilitator) and fulfills the request.
Choose your path to integrate RUST402 into your application