-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproof402-python-middleware.html
More file actions
193 lines (190 loc) · 9.45 KB
/
Copy pathproof402-python-middleware.html
File metadata and controls
193 lines (190 loc) · 9.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE html>
<html lang="en">
<head>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-QHTHMG61N6"></script>
<script>
window.dataLayer=window.dataLayer||[];
function gtag(){dataLayer.push(arguments);}
gtag('js',new Date());
gtag('config','G-QHTHMG61N6');
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<title>proof402 — Python x402 Middleware — Script Master Labs</title>
<meta name="description" content="pip install proof402: FastAPI/Flask middleware that gates any Python API behind RLUSD micropayments on XRPL, with sub-millisecond local HMAC verification.">
<link rel="canonical" href="https://www.scriptmasterlabs.com/proof402-python-middleware.html">
<meta property="og:title" content="proof402 — Python x402 Middleware — Script Master Labs">
<meta property="og:description" content="pip install proof402: FastAPI/Flask middleware that gates any Python API behind RLUSD micropayments on XRPL, with sub-millisecond local HMAC verification.">
<meta property="og:type" content="article">
<meta property="og:url" content="https://www.scriptmasterlabs.com/proof402-python-middleware.html">
<meta property="og:image" content="https://www.scriptmasterlabs.com/og-image.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="proof402 — Python x402 Middleware — Script Master Labs">
<meta name="twitter:description" content="pip install proof402: FastAPI/Flask middleware that gates any Python API behind RLUSD micropayments on XRPL, with sub-millisecond local HMAC verification.">
<meta name="twitter:image" content="https://www.scriptmasterlabs.com/og-image.png">
<script src="https://analytics.ahrefs.com/analytics.js" data-key="eO57h84tnrmOGAsKKvyoyw" async></script>
<style>
:root{
--bg:#000000;--panel:#080C08;--panel2:#0D110D;--line:#1A221A;
--green:#39FF14;--green2:#00FF7F;--gold:#FFD700;--amber:#FF9500;
--blue:#00D4FF;--pink:#FF1493;--purple:#8B5CF6;--red:#FF4D4D;
--white:#F5F7F5;--mute:#8A958C;--mute2:#4A554C;
--mono:'JetBrains Mono','SF Mono',ui-monospace,Menlo,monospace;
--sans:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
}
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth}
body{background:var(--bg);color:var(--white);font-family:var(--sans);line-height:1.6;-webkit-font-smoothing:antialiased}
a{color:var(--green);text-decoration:none}
a:hover{text-decoration:underline}
.wrap{max-width:820px;margin:0 auto;padding:0 28px}
nav{border-bottom:1px solid var(--line);padding:18px 0}
nav .inner{display:flex;align-items:center;gap:28px;max-width:1100px;margin:0 auto;padding:0 28px}
nav .logo{font-family:var(--mono);font-size:13px;font-weight:700;color:var(--green);letter-spacing:1px;text-decoration:none}
nav .links{display:flex;gap:22px;margin-left:auto}
nav .links a{font-size:13px;color:var(--mute);text-decoration:none;transition:color .2s}
nav .links a:hover{color:var(--white);text-decoration:none}
nav .cta{font-family:var(--mono);font-size:11px;padding:8px 18px;border:1px solid var(--green);border-radius:6px;color:var(--green);transition:all .2s}
nav .cta:hover{background:var(--green);color:#000;text-decoration:none}
.hero{padding:56px 0 32px;border-bottom:1px solid var(--line)}
.eyebrow{font-family:var(--mono);font-size:11px;letter-spacing:3px;color:var(--green);text-transform:uppercase;margin-bottom:16px}
h1{font-size:clamp(28px,5vw,44px);font-weight:900;letter-spacing:-1.2px;line-height:1.1;max-width:760px}
.hero-sub{margin-top:16px;font-size:clamp(15px,2vw,17px);color:var(--mute);max-width:700px;line-height:1.7}
section{margin:44px 0}
h2{font-size:clamp(20px,3vw,26px);font-weight:800;letter-spacing:-.5px;margin-bottom:18px}
.facts{border:1px solid var(--line);border-radius:12px;background:var(--panel);padding:20px 24px;margin:24px 0}
.facts li{margin:8px 0;color:var(--mute);font-size:14px}
.facts li b{color:var(--white)}
.faq-item{border-bottom:1px solid var(--line);padding:20px 0}
.faq-item:first-child{padding-top:0}
.faq-item h3{font-size:16px;font-weight:700;margin-bottom:8px}
.faq-item p{color:var(--mute);font-size:14px;line-height:1.7}
.related{display:flex;flex-direction:column;gap:8px}
.related a{font-family:var(--mono);font-size:13px}
footer{border-top:1px solid var(--line);padding:28px 0;margin-top:40px;display:flex;justify-content:space-between;flex-wrap:wrap;gap:12px}
footer .fl{font-size:12px;color:var(--mute2)}
footer .links{display:flex;gap:18px}
footer .links a{font-size:12px;color:var(--mute)}
</style>
</head>
<body>
<nav>
<div class="inner">
<a href="/index.html" class="logo">SML ◈</a>
<div class="links">
<a href="/stack.html">Stack</a>
<a href="/central-bank.html">Central Bank</a>
<a href="/marketplace.html">Marketplace</a>
<a href="https://scriptmaster-vending-router.onrender.com/.well-known/agents.json" target="_blank">API</a>
</div>
<a href="https://scriptmaster-vending-router.onrender.com/mcp" class="cta" target="_blank">Connect Agent</a>
</div>
</nav>
<main>
<div class="wrap">
<div class="hero">
<div class="eyebrow">PYPI · PYTHON MIDDLEWARE</div>
<h1>proof402 — Python x402 Middleware on PyPI</h1>
<p class="hero-sub"><code>proof402</code> 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 <a href="https://four02proof.onrender.com" target="_blank">402Proof</a>. Token verification is a local HMAC-SHA256 check — no network call, sub-millisecond.</p>
</div>
<section>
<h2>Quick facts</h2>
<ul class="facts">
<li><b>Install:</b> <code>pip install proof402</code></li>
<li><b>Frameworks:</b> FastAPI and Flask/WSGI</li>
<li><b>License:</b> MIT</li>
<li><b>Runtime:</b> Python 3.9+</li>
<li><b>Verification speed:</b> sub-millisecond, pure local HMAC-SHA256 — zero network call once a token secret is configured.</li>
</ul>
</section>
<section>
<h2>Frequently asked questions</h2>
<div class="faq-item">
<h3>How does an agent get a valid token?</h3>
<p>It sends RLUSD on XRPL, calls <code>POST /v1/verify</code> on 402Proof, and receives a signed <code>X-Payment-Token</code> back — which it then attaches to its retried request.</p>
</div>
<div class="faq-item">
<h3>Does proof402 call out to a server on every request?</h3>
<p>No. Once a <code>token_secret</code> is configured, verification is a pure local HMAC-SHA256 check — no network round-trip, under a millisecond.</p>
</div>
<div class="faq-item">
<h3>What frameworks does it support?</h3>
<p>FastAPI (via a <code>Depends</code>-style dependency) and Flask/WSGI, both documented in the package README.</p>
</div>
</section>
<section>
<h2>Related</h2>
<div class="related">
<a href="https://pypi.org/project/proof402/" target="_blank">proof402 on PyPI →</a>
<a href="https://four02proof.onrender.com" target="_blank">402Proof payment firewall →</a>
<a href="/x402-protocol-guide.html">What is the x402 protocol? →</a>
</div>
</section>
</div>
</main>
<div class="wrap">
<footer>
<span class="fl">© 2026 Script Master Labs LLC</span>
<div class="links">
<a href="/privacy.html">Privacy</a>
<a href="/terms.html">Terms</a>
<a href="/stack.html">Stack</a>
<a href="/central-bank.html">Central Bank</a>
</div>
</footer>
</div>
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "WebPage",
"@id": "https://www.scriptmasterlabs.com/proof402-python-middleware.html#page",
"name": "proof402 \u2014 Python x402 Middleware \u2014 Script Master Labs",
"description": "pip install proof402: FastAPI/Flask middleware that gates any Python API behind RLUSD micropayments on XRPL, with sub-millisecond local HMAC verification.",
"url": "https://www.scriptmasterlabs.com/proof402-python-middleware.html",
"publisher": {
"@type": "Organization",
"name": "Script Master Labs LLC",
"url": "https://www.scriptmasterlabs.com"
}
},
{
"@type": "FAQPage",
"@id": "https://www.scriptmasterlabs.com/proof402-python-middleware.html#faq",
"mainEntity": [
{
"@type": "Question",
"name": "How does an agent get a valid token?",
"acceptedAnswer": {
"@type": "Answer",
"text": "It sends RLUSD on XRPL, calls POST /v1/verify on 402Proof, and receives a signed X-Payment-Token back \u2014 which it then attaches to its retried request."
}
},
{
"@type": "Question",
"name": "Does proof402 call out to a server on every request?",
"acceptedAnswer": {
"@type": "Answer",
"text": "No. Once a token_secret is configured, verification is a pure local HMAC-SHA256 check \u2014 no network round-trip, under a millisecond."
}
},
{
"@type": "Question",
"name": "What frameworks does it support?",
"acceptedAnswer": {
"@type": "Answer",
"text": "FastAPI (via a Depends-style dependency) and Flask/WSGI, both documented in the package README."
}
}
]
}
]
}
</script>
</body>
</html>