
Nano Pay
com.feeless402由 feeless402.com 发布v0.2.13更新于 Oct 24, 2026
Pay for x402-priced APIs with feeless, sub-second Nano (XNO) micropayments from a local wallet.
概览
自托管的 Nano(XNO)钱包与 x402 支付客户端,让助手以亚秒级微支付为按 x402 计价的 API 报价并付款。
- 可以做什么
- 对按 x402 计价的 HTTP 端点报价并付款,处理 402 握手、价格上限检查、本地签名与带支付头的重试
- 在不付款的情况下查看端点价格,并在账本上核对已签名区块的结算状态
- 通过 NanSwap 报价或创建 USDC 兑换 XNO 的订单来充值钱包
- 接收转入本地钱包的 XNO
- 运行商户端,提供付费端点并做链上验证与结算,另含水龙头
- 适用场景
- 适合助手需要调用按请求计费(x402)的 API,而你希望用本地 Nano 钱包而非银行卡或账号付款的场景。也适用于想把自己的付费端点开放给智能体的情况。
- 运行要求
- 以 Python 包形式通过 stdio 在本机运行(需 Python 3.10+,可用 pip 安装或用 uvx 运行)。需先执行初始化命令在 ~/.nano-pay/wallet.json 创建钱包。充值需通过环境变量 NANSWAP_API_KEY 提供 NanSwap API 密钥。需联网访问公共 Nano RPC 节点以查询余额与结算状态。
安装
在 SourceWeft 中
- 打开 控制台中的 Nano Pay,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
nano-pay · Feeless402
Self-custodied Nano (XNO) wallet + x402 payment client and merchant
server, built for AI agents. Client spends; nano-pay serve earns — paid
endpoints, on-ledger verification/settlement (no facilitator), a starter
faucet, and the railHint x402 extension that teaches visiting agents how
to onboard (see SPEC-railhint.md). Site: site/index.html + site/llms.txt.
Note on outreach: Feeless402 does not open issues, pull requests or proposals on other projects. Posts elsewhere that pitch a "Nano rail" and name Feeless402 come from unaffiliated accounts, not from us. If one lands in your repo, feel free to close it. Questions: open an issue here.
The pitch, in one number: the same $5 buys 5,000 API calls paid as per-call USDC-on-Base x402 payments (merchants floor prices at 0.001 USDC), or hundreds of thousands of calls paid in Nano at true metered prices ($0.0000096/call observed live at nano-gpt.com, confirmed on-ledger). Top up once, micropay forever.
Install
Agent flow
pay handles the whole x402 handshake: request → parse the 402 quote
(both the x402nano/PAYMENT-REQUIRED v2 dialect and the NanoGPT/accepts
v1 dialect) → price-cap check → sign a send state block locally → retry
with PAYMENT-SIGNATURE + X-PAYMENT headers. The server settles the
block via its facilitator; nothing is broadcast unless the server accepts.
If the merchant's reply is lost or is not a 2xx, the client asks the
ledger about the block hash it signed before reporting anything: the
receipt's settled is true, false, or "indeterminate", never a
guess. A block that landed is never re-paid — re-present the same one.
The client now does that re-presentation itself: every payment is journaled
next to the wallet (pending-payments.json) before it is sent, and a retry —
in the same call or after a crash — re-sends the same signed block with an
X-PAYMENT-PROOF header (the payer's signature over the block hash, method and
path). The server honors a proven re-presentation for 24 hours, so an observer
replaying a public block cannot use up the payer's retries. (v0.2.9; reported
privately by giskard09, who also re-verified
the fix with an independent harness — see advisory GHSA-cx37-j5vc-c967. v0.2.10
adds two follow-ups from that re-verification: a block of unknown age is never
treated as inside the window, and forwarded IP headers are trusted only from a
configured proxy.)
v0.2.12 closes the remaining ways a client could pay twice. A ledger that
cannot be reached is never read as "not paid"; a refusal gets the same
confirmation window as every other outcome; a payment record that cannot be
written or read stops the payment instead of being forgotten; and a payment
record is tied to the request's body and query, so two different operations
at the same price never share one. Also: the receipt checker raises
Unreachable instead of NotFound when no node answers, and a blank F402_*
setting means "use the default" (a blank top-up stays off). Reported by
pyfile-toolkit (#10–#14) and
enricoaboujaoude-droid (#15–#18);
fixes written independently against their reports and tests.
v0.2.13 makes the pay command tell the truth. Its paid field is now the
ledger's verdict (true, false or "indeterminate") instead of "a block
was signed", and pay exits 0 only when the call was served and the
payment is confirmed on the ledger. Anything else exits 1 and prints the
block hash on stderr. A nonzero exit does not mean nothing was paid:
check that block before paying again. quote still exits 0 for a valid 402.
Reported by vjohannesb (#19); fix written
independently against the report.
Design notes
- Self-custody: seed never leaves
~/.nano-pay/wallet.json(0600). - No node required: public RPC failover (rpc.nano.to, somenano,
rainstorm.city, nanoslo); all signing and PoW happen locally (nanopy
C extension). RPC
work_generateis tried first, local PoW is the fallback (~25s). The CLI pre-caches work for your next block after it has printed the result of the current one, so steady-state payments are instant. Library callers opt in:send(),receive_all()andrequest_with_payment()takeprework=and default to off, because pre-caching blocks for minutes and must never sit on a request path. - Safety rails: per-payment price cap (
--max-xno, default 0.05);quotecommand inspects any endpoint's price without paying; balance is always re-synced from the network, never trusted locally. - Top-ups without custody:
topupquotes/creates swaps directly with NanSwap's API (1,400+ input assets, ~$0.02 minimum). This tool never holds or routes funds.
Fork-hazard note (x402 payments)
An x402 payment signs a block the server broadcasts. If the server errors after receiving the block, it may still settle it late. The wallet re-syncs its frontier from the network before every operation, so a late settlement is picked up naturally; a competing block signed in the meantime simply makes one of the two invalid (funds are never at risk, but don't fire concurrent payments from one wallet).
Status
Beta (v0.2.13). Proven on mainnet with real funds: live paid calls to
NanoGPT ($0.0000096/call, confirmed on-ledger), full merchant loop
(verify → settle → confirm, no facilitator), PoW-gated faucet claims,
and a complete stranger-agent lifecycle (fresh wallet → PoW claim →
paid API call → confirmed) in under 3 minutes. 71-test suite covers the
payment path offline (two faucet tests need the optional mcp extra).
Not audited — keep only working capital in it.
Listings
- gold-402 — curated x402
directory; the
/premiumreference endpoint is shelved under APIs and this Python client under SDKs. - Official MCP registry —
com.feeless402/nano-pay. - agent-tools.cloud — x402, MCP, and A2A entries.
Security notes (read before holding real funds)
- Self-custody: the seed lives only in
~/.nano-pay/*.json(0600). No tool or log path ever prints it. Back it up offline. - Working capital only: this is beta wallet software. Keep a few dollars in it, not your savings.
- Spend caps:
payrefuses quotes above--max-xno(default 0.05). MCPx402_payenforces the same cap parameter. - railHint is advisory: hints from remote servers are untrusted
input. This client never executes remote bootstrap strings; it only
acts on structured offers that pass its own checks, and
acceptsalways binds, never the hint. - Merchant fork guard: servers cache accepted frontiers and reject duplicate-frontier blocks; payer balance/frontier/signature are verified against the live ledger before settlement.
- Behind a proxy: the merchant believes
X-Real-IP/X-Forwarded-Foronly fromF402_TRUSTED_PROXIES(default127.0.0.1,::1); any other peer is identified by its socket address. If your reverse proxy runs on another host, add its address there, and have it overwrite both headers (proxy_set_header X-Real-IP $remote_addr;). - Run one worker: the fork guard (
_seen_previous) and the replay bound (_replays) are per-process, in-memory. Underuvicorn --workers Neach worker keeps its own copy, so two workers can accept the same payer frontier and one of the two blocks loses the fork race. Serve a single process (scale with a lock in front, not with workers) unless those guards are moved to shared storage. The ledger poll budget is a single value for the whole path (verify.CONFIRM_WAIT_S), so the merchant settle loop and the x402 client look at the chain for the same time; a worker that gives up earlier than that reports "indeterminate" for a payment that did land. - Not audited. MIT — no warranty.
Thanks
Feeless402 is better because people took the time to read the code, break it, and say so. Thank you to:
- giskard09: privately reported that a retry after a lost reply could pay twice, then re-verified the fix with an independent harness (advisory GHSA-cx37-j5vc-c967; v0.2.9 and v0.2.10).
- pyfile-toolkit: fixed the dead railHint spec link, exact XNO/raw conversion and the faucet's per-claim amount (#5–#7); unified the ledger wait for the whole payment path (#9, v0.2.11); and reported the unreachable-ledger, receipt-checker and blank setting issues fixed in v0.2.12 (#10–#14).
- enricoaboujaoude-droid: reported the payment-journal and request-binding issues fixed in v0.2.12 (#15–#18).
- vjohannesb: reported that
payannounced settlement for refused and unconfirmed payments (#19, v0.2.13). - dhyabi2: contributed the standalone
settlement-receipt verifier,
nano_pay.receipt(#4). - Circadian-agent: spotted that the railHint spec field pointed at a disabled deployment (#2).
Found something? Open an issue, or for anything that could cost a user money, report it privately through GitHub's security advisories.
来源:README.md,提交 4dd6d7a
工具
0版本历史
6- v0.2.13最新Oct 4, 2026
- v0.2.12Oct 3, 2026
- v0.2.11Sep 29, 2026
- v0.2.10Sep 28, 2026
- v0.2.9Sep 27, 2026
- v0.2.8Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分