Middleware Domain
Express.js middleware and client utilities for adding cryptographic authentication and micropayment gating to HTTP services. There are two distinct payment paths: @bsv/payment-express-middleware layers payment requirements on top of authenticated Express routes, while @bsv/402-pay is an independent HTTP 402 flow that can work without auth middleware.
Packages
| Package | Purpose |
|---|---|
| @bsv/auth | Framework-neutral signed, expiry-bound, single-use wallet proofs with an injected replay store. |
| @bsv/auth-express-middleware | Express middleware implementing BRC-103 peer-to-peer mutual authentication via BRC-104 HTTP transport. |
| @bsv/payment-express-middleware | Authenticated legacy x-bsv-payment middleware with replay-safe payment acceptance. |
| @bsv/402-pay | Independent BRC-121 client and server HTTP 402 flow that does not require auth middleware. |