<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Zach Miller</title>
    <description>The latest articles on DEV Community by Zach Miller (@zach_miller_1652eb31dcf60).</description>
    <link>https://dev.to/zach_miller_1652eb31dcf60</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3812362%2F1e8e81e7-b228-462e-adc1-0bece83d779a.jpg</url>
      <title>DEV Community: Zach Miller</title>
      <link>https://dev.to/zach_miller_1652eb31dcf60</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zach_miller_1652eb31dcf60"/>
    <language>en</language>
    <item>
      <title>x402 Beyond EVM: How to Gate Any API Behind Crypto Micropayments on Cosmos</title>
      <dc:creator>Zach Miller</dc:creator>
      <pubDate>Mon, 16 Mar 2026 23:12:19 +0000</pubDate>
      <link>https://dev.to/zach_miller_1652eb31dcf60/x402-beyond-evm-how-to-gate-any-api-behind-crypto-micropayments-on-cosmos-1e13</link>
      <guid>https://dev.to/zach_miller_1652eb31dcf60/x402-beyond-evm-how-to-gate-any-api-behind-crypto-micropayments-on-cosmos-1e13</guid>
      <description>&lt;p&gt;A step-by-step guide to implementing the x402 HTTP 402 Payment Required pattern on a Cosmos SDK chain using ClawPurse Gateway and NTMPI tokens — no EVM, no facilitator, no custody.&lt;/p&gt;

&lt;p&gt;Everyone's talking about &lt;a href="https://www.x402.org/" rel="noopener noreferrer"&gt;x402&lt;/a&gt; — the open payment protocol that brings HTTP 402 Payment Required back from the dead. Coinbase launched it, Cloudflare joined the foundation, Vercel shipped middleware for it, and Circle demoed AI agents autonomously paying for API calls.&lt;/p&gt;

&lt;p&gt;But here's the thing: &lt;strong&gt;every x402 implementation so far runs on EVM chains&lt;/strong&gt; (Base, Polygon, Solana) and settles in stablecoins through a centralized facilitator.&lt;/p&gt;

&lt;p&gt;What if you're building on Cosmos? What if you're a DePIN node operator who already earns and stakes a native token? What if you want to self-host the whole stack with no facilitator dependency?&lt;/p&gt;

&lt;p&gt;That's what &lt;a href="https://clawpurse.ai" rel="noopener noreferrer"&gt;ClawPurse&lt;/a&gt; does. It implements the same x402 pattern — 402 invoice → on-chain payment → retry with proof — on the &lt;strong&gt;Neutaro blockchain&lt;/strong&gt; (Cosmos SDK) with &lt;strong&gt;NTMPI&lt;/strong&gt; tokens. No facilitator. No custody. Fully self-hosted.&lt;/p&gt;

&lt;p&gt;Here's how to set it up in under 5 minutes.&lt;/p&gt;




&lt;h2&gt;
  
  
  What we're building
&lt;/h2&gt;

&lt;p&gt;A gated API where:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Any request to a protected endpoint returns &lt;code&gt;402 Payment Required&lt;/code&gt; with an invoice&lt;/li&gt;
&lt;li&gt;The caller (human, script, or AI agent) pays on-chain with NTMPI&lt;/li&gt;
&lt;li&gt;The caller retries with an &lt;code&gt;X-Payment-Proof&lt;/code&gt; header&lt;/li&gt;
&lt;li&gt;The gateway verifies the payment on Neutaro and proxies to your upstream API&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is the exact x402 flow. The only difference from Coinbase's version: we verify directly against the Neutaro REST API instead of routing through a facilitator.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Node.js 18+&lt;/li&gt;
&lt;li&gt;A Neutaro wallet address (we'll create one)&lt;/li&gt;
&lt;li&gt;Docker (optional, for gateway deployment)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Step 1: Install the ClawPurse agentic wallet
&lt;/h2&gt;

&lt;p&gt;ClawPurse is a local-only CLI wallet with encrypted keystores and guardrails built for autonomous agents.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/mhue-ai/ClawPurse.git
&lt;span class="nb"&gt;cd &lt;/span&gt;ClawPurse
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm run build &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm &lt;span class="nb"&gt;link&lt;/span&gt;

&lt;span class="c"&gt;# Create a wallet&lt;/span&gt;
clawpurse init &lt;span class="nt"&gt;--password&lt;/span&gt; yourpassword

&lt;span class="c"&gt;# Get your address&lt;/span&gt;
clawpurse address
&lt;span class="c"&gt;# → neutaro1abc...xyz&lt;/span&gt;

&lt;span class="c"&gt;# Check balance&lt;/span&gt;
clawpurse balance &lt;span class="nt"&gt;--password&lt;/span&gt; yourpassword
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Need tokens? Grab free NTMPI from the &lt;a href="https://drip.clawpurse.ai" rel="noopener noreferrer"&gt;Timpi Drip faucet&lt;/a&gt; — it uses proof-of-work instead of CAPTCHA, so it works for AI agents too.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2: Deploy the 402 gateway
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/mhue-ai/clawpurse-gateway.git
&lt;span class="nb"&gt;cd &lt;/span&gt;clawpurse-gateway
npm &lt;span class="nb"&gt;install

cp&lt;/span&gt; .env.example .env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit &lt;code&gt;.env&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;PORT&lt;/span&gt;=&lt;span class="m"&gt;4020&lt;/span&gt;
&lt;span class="n"&gt;GATEWAY_UPSTREAM&lt;/span&gt;=&lt;span class="n"&gt;http&lt;/span&gt;://&lt;span class="n"&gt;localhost&lt;/span&gt;:&lt;span class="m"&gt;3000&lt;/span&gt;
&lt;span class="n"&gt;GATEWAY_PAYMENT_ADDRESS&lt;/span&gt;=&lt;span class="n"&gt;neutaro1abc&lt;/span&gt;...&lt;span class="n"&gt;xyz&lt;/span&gt;  &lt;span class="c"&gt;# your address from step 1
&lt;/span&gt;&lt;span class="n"&gt;GATEWAY_DEFAULT_PRICE&lt;/span&gt;=&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;001&lt;/span&gt;                &lt;span class="c"&gt;# price per request in NTMPI
&lt;/span&gt;&lt;span class="n"&gt;JWT_SECRET&lt;/span&gt;=&lt;span class="n"&gt;your&lt;/span&gt;-&lt;span class="n"&gt;random&lt;/span&gt;-&lt;span class="n"&gt;secret&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start a test upstream (the gateway includes one):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run &lt;span class="nb"&gt;test&lt;/span&gt;:upstream
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Start the gateway:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. Your API is now gated behind NTMPI micropayments.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 3: Test the x402 flow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Hit the gated endpoint&lt;/span&gt;
curl http://localhost:4020/api/test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You get back:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"error"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Payment required"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"payment"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"invoiceId"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"inv_abc123"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"amount"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"0.001"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"address"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"neutaro1abc...xyz"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"memo"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"inv_abc123"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pay with ClawPurse:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;clawpurse send neutaro1abc...xyz 0.001 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--memo&lt;/span&gt; inv_abc123 &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--password&lt;/span&gt; yourpassword &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;--yes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Retry with proof:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-Payment-Proof: inv_abc123"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  http://localhost:4020/api/test
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;→ &lt;code&gt;200 OK&lt;/code&gt; with your upstream data. Done.&lt;/p&gt;




&lt;h2&gt;
  
  
  How this compares to Coinbase x402
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Coinbase x402&lt;/th&gt;
&lt;th&gt;ClawPurse Gateway&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Chain&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Base, Polygon, Solana&lt;/td&gt;
&lt;td&gt;Neutaro (Cosmos SDK)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Token&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;USDC, ERC-20s&lt;/td&gt;
&lt;td&gt;NTMPI&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Verification&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Centralized facilitator&lt;/td&gt;
&lt;td&gt;Direct on-chain query&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Header&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;X-PAYMENT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;X-Payment-Proof&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Wallet&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Coinbase Agentic Wallets&lt;/td&gt;
&lt;td&gt;ClawPurse CLI + API&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Deploy&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;SDK/middleware&lt;/td&gt;
&lt;td&gt;Docker or bare metal&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Custody&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Facilitator-mediated&lt;/td&gt;
&lt;td&gt;Zero custody, self-hosted&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The key architectural difference: Coinbase x402 uses a &lt;strong&gt;facilitator&lt;/strong&gt; — a server that verifies and settles payments on behalf of the resource server. ClawPurse skips this entirely. The gateway queries the Neutaro REST API directly (&lt;code&gt;/cosmos/tx/v1beta1/txs&lt;/code&gt;) to verify the payment amount, memo, and block confirmations.&lt;/p&gt;

&lt;p&gt;This means:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No trust dependency&lt;/strong&gt; on a third-party facilitator&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No rate limits&lt;/strong&gt; from facilitator API calls&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No registration&lt;/strong&gt; — deploy and go&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Making it agent-friendly
&lt;/h2&gt;

&lt;p&gt;The whole point of x402 is that machines can pay for things. Here's a Python agent that handles the 402 flow autonomously:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;paid_fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;402&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;inv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;payment&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

        &lt;span class="c1"&gt;# Pay with ClawPurse
&lt;/span&gt;        &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;clawpurse&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;send&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;address&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;amount&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--memo&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;memo&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;--yes&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;])&lt;/span&gt;

        &lt;span class="c1"&gt;# Retry with proof
&lt;/span&gt;        &lt;span class="n"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;X-Payment-Proof&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;inv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;invoiceId&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;paid_fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://gateway:4020/api/data&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;ClawPurse also includes guardrails specifically designed for agent autonomy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Spending limits&lt;/strong&gt; — cap how much an agent can send per transaction or per day&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Destination allowlists&lt;/strong&gt; — restrict which addresses an agent can pay&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confirmation thresholds&lt;/strong&gt; — require N block confirmations before considering payment settled&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Configure these with the guardrail wizard:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;clawpurse guardrails &lt;span class="nt"&gt;--password&lt;/span&gt; yourpassword
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Prepaid balances for high-frequency agents
&lt;/h2&gt;

&lt;p&gt;For agents making hundreds of API calls, paying on-chain every time is wasteful. ClawPurse Gateway supports &lt;strong&gt;prepaid balances&lt;/strong&gt; — deposit once, then make many calls:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Enable in .env&lt;/span&gt;
&lt;span class="nv"&gt;GATEWAY_PREPAID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent deposits NTMPI once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST http://localhost:4020/prepaid/deposit &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"txHash": "ABC123...", "clientId": "agent-001"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then subsequent requests just include the client ID:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"X-Client-Id: agent-001"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  http://localhost:4020/api/data
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The gateway deducts from the balance per call. No repeated on-chain transactions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Route-level pricing
&lt;/h2&gt;

&lt;p&gt;Not all endpoints are equal. Charge more for writes, less for reads:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="err"&gt;GATEWAY_ROUTES=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"POST /api/generate"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;0.01&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"GET /api/status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mf"&gt;0.0001&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Default price applies to everything else.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why this matters for DePIN
&lt;/h2&gt;

&lt;p&gt;DePIN operators run real infrastructure — GPU rigs, storage nodes, wireless hotspots, weather stations, dashcams. But monetizing that infrastructure usually means signing up for a platform, waiting for payouts, and dealing with fiat rails that weren't built for machines.&lt;br&gt;
ClawPurse flips that. Any HTTP endpoint becomes a paid service with one Docker command.&lt;br&gt;
Imagine:&lt;/p&gt;

&lt;p&gt;You rent out spare GPU compute for AI inference — agents pay per request, settled on-chain in seconds&lt;br&gt;
You run a sensor network and sell environmental data — 0.001 NTMPI per API call, no subscription required&lt;br&gt;
You host a proxy or VPN exit node — pay-per-session with no account signup&lt;br&gt;
You offer geolocation or mapping data from your fleet — agents query and pay automatically&lt;/p&gt;

&lt;p&gt;No payment processor. No platform cut. No waiting 30 days for a bank transfer. Just an HTTP endpoint, a price, and on-chain settlement.&lt;br&gt;
That's the micropayment layer DePIN has been missing — and x402 is the protocol that makes it work.&lt;/p&gt;




&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;x402 landing page&lt;/strong&gt;: &lt;a href="https://clawpurse.ai/x402/" rel="noopener noreferrer"&gt;clawpurse.ai/x402&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gateway docs&lt;/strong&gt;: &lt;a href="https://gateway.clawpurse.ai" rel="noopener noreferrer"&gt;gateway.clawpurse.ai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wallet repo&lt;/strong&gt;: &lt;a href="https://github.com/mhue-ai/ClawPurse" rel="noopener noreferrer"&gt;github.com/mhue-ai/ClawPurse&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Gateway repo&lt;/strong&gt;: &lt;a href="https://github.com/mhue-ai/clawpurse-gateway" rel="noopener noreferrer"&gt;github.com/mhue-ai/clawpurse-gateway&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent integration (SKILL.md)&lt;/strong&gt;: &lt;a href="https://github.com/mhue-ai/ClawPurse/blob/main/SKILL.md" rel="noopener noreferrer"&gt;github.com/mhue-ai/ClawPurse/blob/main/SKILL.md&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free NTMPI&lt;/strong&gt;: &lt;a href="https://drip.clawpurse.ai" rel="noopener noreferrer"&gt;drip.clawpurse.ai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tax tracking&lt;/strong&gt;: &lt;a href="https://ledger.clawpurse.ai" rel="noopener noreferrer"&gt;ledger.clawpurse.ai&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Coinbase x402 spec&lt;/strong&gt;: &lt;a href="https://www.x402.org/" rel="noopener noreferrer"&gt;x402.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenClaw AI framework&lt;/strong&gt;: &lt;a href="https://mhue.ai" rel="noopener noreferrer"&gt;mhue.ai&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;ClawPurse is open source (MIT) and maintained by the &lt;a href="https://mhue.ai" rel="noopener noreferrer"&gt;Mhue family&lt;/a&gt;. If it's saving you time, &lt;a href="https://clawpurse.ai" rel="noopener noreferrer"&gt;tip the builders&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>x402</category>
      <category>web3</category>
      <category>ai</category>
      <category>depin</category>
    </item>
    <item>
      <title>The Internet Was Supposed to Have a Pay Button. ClawPurse Finally Built It — for Machines.</title>
      <dc:creator>Zach Miller</dc:creator>
      <pubDate>Sun, 08 Mar 2026 03:13:02 +0000</pubDate>
      <link>https://dev.to/zach_miller_1652eb31dcf60/the-internet-was-supposed-to-have-a-pay-button-clawpurse-finally-built-it-for-machines-ln9</link>
      <guid>https://dev.to/zach_miller_1652eb31dcf60/the-internet-was-supposed-to-have-a-pay-button-clawpurse-finally-built-it-for-machines-ln9</guid>
      <description>&lt;p&gt;In 1992, Tim Berners-Lee's team reserved HTTP status code 402 — Payment Required — for "future use." They knew the web would need native payments. They just didn't have the rails.&lt;/p&gt;

&lt;p&gt;Three decades later, we got ads. We got subscriptions. We got data harvesting at scale. But we never got the thing the web's architects imagined: a way for one machine to pay another machine, instantly, for a tiny piece of value.&lt;/p&gt;

&lt;p&gt;ClawPurse is an open-source micropayment ecosystem on the Neutaro blockchain that finally gives HTTP 402 a real job. A local encrypted wallet, an HTTP reverse proxy that gates any API behind on-chain micropayments, and an agent-friendly faucet — wired together so AI agents can discover a service, pay for it, and get the result without a human ever touching a form.&lt;/p&gt;

&lt;p&gt;The code is on GitHub. The sites are live. Here's how it works.&lt;/p&gt;

&lt;p&gt;The Stack&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;ClawPurse Wallet — Self-Custodial Agent Treasury
bashnpm install &amp;amp;&amp;amp; npm run build &amp;amp;&amp;amp; npm link&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;clawpurse init --password &lt;br&gt;
clawpurse address&lt;br&gt;
clawpurse balance --password &lt;br&gt;
clawpurse send neutaro1... 1.25 --password &lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
**What it is:** A local-only NTMPI wallet with AES-256-GCM encrypted keystores and scrypt key derivation.

**Why it matters for devs:**
- Programmatic API: `send()`, `getBalance()`, `delegate()` — import directly into your agent scripts
- Guardrail wizard: set per-tx spend limits, confirmation thresholds, and destination allowlists before your agent touches real tokens
- Built-in staking: delegate, undelegate, redelegate, track rewards, manage the 22-day unbonding period
- Full audit trail: every send recorded locally with tx hash, block height, memo, and guardrail status

No cloud custody. No third-party key management. Your keys stay on your machine.

**Repo:** [github.com/mhue-ai/ClawPurse](https://github.com/mhue-ai/ClawPurse)

---

### 2. ClawPurse 402 Gateway — Monetize Any API in Minutes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Client (agent/script/browser)&lt;br&gt;
  │&lt;br&gt;
  ├── GET /api/data ──────────────▶  402 Gateway&lt;br&gt;
  │                                       │&lt;br&gt;
  │   ◀── 402 Payment Required ─────────┘&lt;br&gt;
  │       { invoiceId, amount, address, memo }&lt;br&gt;
  │&lt;br&gt;
  ├── clawpurse send &lt;/p&gt;  --memo &lt;br&gt;
  │&lt;br&gt;
  ├── GET /api/data ──────────────▶  402 Gateway&lt;br&gt;
  │   Header: X-Payment-Proof: &lt;br&gt;
  │                                       │&lt;br&gt;
  │   Gateway verifies tx on Neutaro      │&lt;br&gt;
  │                                       │&lt;br&gt;
  │   ◀── 200 OK (proxied upstream) ────┘

&lt;p&gt;What it is: An HTTP reverse proxy implementing 402 Payment Required. Put it in front of any backend. It handles invoicing, on-chain verification, and proxying.&lt;br&gt;
Two payment flows:&lt;br&gt;
Pay-per-request — each call gets an invoice, client pays on-chain, retries with proof:&lt;br&gt;
pythonimport requests, subprocess&lt;/p&gt;

&lt;p&gt;res = requests.get("&lt;a href="http://gateway:4020/api/data%22" rel="noopener noreferrer"&gt;http://gateway:4020/api/data"&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;if res.status_code == 402:&lt;br&gt;
    inv = res.json()["payment"]&lt;br&gt;
    subprocess.run([&lt;br&gt;
        "clawpurse", "send",&lt;br&gt;
        inv["address"], inv["amount"],&lt;br&gt;
        "--memo", inv["memo"], "--yes"&lt;br&gt;
    ])&lt;br&gt;
    res = requests.get(&lt;br&gt;
        "&lt;a href="http://gateway:4020/api/data" rel="noopener noreferrer"&gt;http://gateway:4020/api/data&lt;/a&gt;",&lt;br&gt;
        headers={"X-Payment-Proof": inv["invoiceId"]}&lt;br&gt;
    )&lt;/p&gt;

&lt;p&gt;data = res.json()&lt;br&gt;
Prepaid balance — deposit once, deduct per call:&lt;br&gt;
bash# Deposit&lt;br&gt;
curl -X POST &lt;a href="http://gateway:4020/prepaid/deposit" rel="noopener noreferrer"&gt;http://gateway:4020/prepaid/deposit&lt;/a&gt; \&lt;br&gt;
  -H "Content-Type: application/json" \&lt;br&gt;
  -d '{"txHash": "", "clientId": "my-agent"}'&lt;/p&gt;
&lt;h1&gt;
  
  
  Subsequent requests just use the client ID
&lt;/h1&gt;

&lt;p&gt;curl -H "X-Client-Id: my-agent" &lt;a href="http://gateway:4020/api/data" rel="noopener noreferrer"&gt;http://gateway:4020/api/data&lt;/a&gt;&lt;br&gt;
Key features:&lt;/p&gt;

&lt;p&gt;Route-level pricing: cheap reads, expensive writes via GATEWAY_ROUTES&lt;br&gt;
SQLite storage, zero external dependencies&lt;br&gt;
One-command deploy: docker compose up&lt;br&gt;
JWT-protected management API for internal wallets and transaction ledger&lt;br&gt;
On-chain verification directly against Neutaro REST API — no oracles, no bridges&lt;/p&gt;

&lt;p&gt;bash# Quick start&lt;br&gt;
git clone &lt;a href="https://github.com/mhue-ai/clawpurse-gateway.git" rel="noopener noreferrer"&gt;https://github.com/mhue-ai/clawpurse-gateway.git&lt;/a&gt;&lt;br&gt;
cd clawpurse-gateway &amp;amp;&amp;amp; npm install&lt;br&gt;
cp .env.example .env&lt;br&gt;
npm run dev&lt;br&gt;
Site: gateway.clawpurse.ai&lt;br&gt;
Repo: github.com/mhue-ai/clawpurse-gateway&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Timpi Drip Faucet — PoW Instead of CAPTCHA
Timpi Drip replaces CAPTCHA with proof-of-work challenges. ClawPurse ships the PoW solver, so agents can self-onboard with tokens and start transacting immediately. OpenClaw-authenticated agents get higher throughput drip rates.
This solves cold start — the chicken-and-egg problem where an agent can't pay for services without tokens, and can't prove it's legitimate if it has to solve a CAPTCHA.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Why This Matters Right Now&lt;br&gt;
The agentic economy went from demos to production in 2025. OpenClaw has 250,000+ GitHub stars. Coinbase open-sourced x402. Mastercard and Visa launched AI agent payment solutions. Deloitte projects $17.5 trillion in autonomous agent commerce by 2030.&lt;br&gt;
But most of that infrastructure targets the biggest chains and enterprise platforms. If you're building on Cosmos, running DePIN nodes, or managing validator infrastructure — the tooling gap is real.&lt;br&gt;
ClawPurse fills that gap for the Neutaro/Timpi ecosystem:&lt;br&gt;
x402 / CoinbaseAgent PlatformsClawPurseChainBase, Solana, AptosMulti-chainNeutaro (Cosmos SDK)CustodyFacilitator-basedPlatform-custodiedSelf-custodial, localTargetEnterprise APIsSaaS buildersDePIN ops, validators, indie devsOnboardingFunded walletPlatform signupPoW faucet, zero signupLicenseOpen sourceProprietary/freemiumMIT&lt;br&gt;
ClawPurse isn't competing with x402. It's implementing the same HTTP 402 pattern for an ecosystem that needs its own rails.&lt;/p&gt;

&lt;p&gt;The Business Case in 60 Seconds&lt;/p&gt;

&lt;p&gt;No payment processor fees — On-chain settlement to your own wallet. A 0.001 NTMPI request is as viable as a 100 NTMPI request.&lt;br&gt;
Agent-first architecture — Built inside OpenClaw. Machines parse invoices, pay, and retry with proof autonomously.&lt;br&gt;
Programmable guardrails — Spend limits, allowlists, confirmation thresholds. Your agent operates freely within boundaries you set.&lt;br&gt;
DePIN-native — Same CLI manages validator delegations, staking rewards, and API micropayments.&lt;br&gt;
MIT licensed, no lock-in — Fork it, extend it, self-host it. No vendor risk.&lt;/p&gt;

&lt;p&gt;Get Started&lt;br&gt;
bash# Wallet&lt;br&gt;
npm install &amp;amp;&amp;amp; npm run build &amp;amp;&amp;amp; npm link&lt;br&gt;
clawpurse init --password mypass&lt;br&gt;
clawpurse balance --password mypass&lt;/p&gt;
&lt;h1&gt;
  
  
  Gateway
&lt;/h1&gt;

&lt;p&gt;git clone &lt;a href="https://github.com/mhue-ai/clawpurse-gateway.git" rel="noopener noreferrer"&gt;https://github.com/mhue-ai/clawpurse-gateway.git&lt;/a&gt;&lt;br&gt;
cd clawpurse-gateway &amp;amp;&amp;amp; npm install&lt;br&gt;
cp .env.example .env &amp;amp;&amp;amp; npm run dev&lt;/p&gt;
&lt;h1&gt;
  
  
  Test the 402 flow
&lt;/h1&gt;

&lt;p&gt;curl &lt;a href="http://localhost:4020/api/test" rel="noopener noreferrer"&gt;http://localhost:4020/api/test&lt;/a&gt;&lt;br&gt;
Links:&lt;/p&gt;

&lt;p&gt;🌐 clawpurse.ai — Main platform&lt;br&gt;
🔀 gateway.clawpurse.ai — 402 Gateway&lt;br&gt;
💧 drip.clawpurse.ai — Drip Faucet&lt;br&gt;
📦 Wallet repo&lt;br&gt;
📦 Gateway repo&lt;br&gt;
🤖 SKILL.md — Agent integration docs&lt;/p&gt;

&lt;p&gt;The internet finally has its pay button. The question is what you'll build behind it.&lt;br&gt;
&lt;a href="https://clawpurse.ai" class="crayons-btn crayons-btn--primary" rel="noopener noreferrer"&gt;Explore ClawPurse&lt;/a&gt;
&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>blockchain</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
