PYPI · PYTHON MIDDLEWARE

proof402 — Python x402 Middleware on PyPI

proof402 is the Python counterpart to mcp-x402-xrpl: FastAPI and Flask/WSGI middleware that gates any route behind RLUSD micropayments on the XRP Ledger via 402Proof. Token verification is a local HMAC-SHA256 check — no network call, sub-millisecond.

Quick facts

  • Install: pip install proof402
  • Frameworks: FastAPI and Flask/WSGI
  • License: MIT
  • Runtime: Python 3.9+
  • Verification speed: sub-millisecond, pure local HMAC-SHA256 — zero network call once a token secret is configured.

Frequently asked questions

How does an agent get a valid token?

It sends RLUSD on XRPL, calls POST /v1/verify on 402Proof, and receives a signed X-Payment-Token back — which it then attaches to its retried request.

Does proof402 call out to a server on every request?

No. Once a token_secret is configured, verification is a pure local HMAC-SHA256 check — no network round-trip, under a millisecond.

What frameworks does it support?

FastAPI (via a Depends-style dependency) and Flask/WSGI, both documented in the package README.

Related