
Tollbooth Authority
io.github.lonniev由 GitHub 账号 lonniev 发布v0.12.0更新于 Oct 27, 2026
Tollbooth Authority — Certified Purchase Order Service for DPYC operators
发布方自己的服务:authority.md
概览
面向 DPYC 收费亭运营者的认证机构:登记运营者、收取闪电网络费用,并签发 Schnorr 签名的采购订单证书。
- 可以做什么
- 登记与管理运营者:采纳申请、批准或拒绝、注册表更新、注销与架构修复
- 处理额度与支付:购买额度、获取闪电网络发票、查询付款与余额
- 认证收费:按 2% 从价费率扣费并签发 Nostr kind 30079 证书
- 身份证明:NIP-98 签名请求,或 OAuth 持有者通过 Nostr 私信证明 npub
- 用 OpenTimestamps 公证与验证账本,并提供预言机委派与定价工具
- 适用场景
- 适用于 DPYC / Tollbooth 生态内的运营者与所有者,需要在收费亭开启前由权威机构认证已付费的采购订单,或希望自行运行一套认证实例。
- 运行要求
- 远程 streamable HTTP 端点,要求 OAuth;OAuth 持有者客户端无需 API 密钥,持密钥客户端用 NIP-98 签名请求。自托管需要 Neon Postgres 连接串、用于签名的 Nostr nsec,以及通过 Secure Courier 交付的 BTCPay 凭据。
安装
在 SourceWeft 中
- 打开 控制台中的 Tollbooth Authority,将其添加到工作区。
- 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
- 为需要使用其工具的对话启用该服务。
Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。
交给智能体安装
把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。
阅读 https://sourceweft.com/mcp/io.github.lonniev%2Ftollbooth-authority/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。其他 MCP 客户端
把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。
{
"mcpServers": {
"tollbooth-authority": {
"type": "http",
"url": "https://tollbooth-authority.fastmcp.app/mcp"
}
}
}README
Tollbooth Authority
[Milo drives the Lightning Turnpike — Don't Pester Your Customer]
The institution that built the infrastructure.
The metaphors in this project are drawn with admiration from The Phantom Tollbooth by Norton Juster, illustrated by Jules Feiffer (1961). Milo, Tock, the Tollbooth, Dictionopolis, and Digitopolis are creations of Mr. Juster's extraordinary imagination. We just built the payment infrastructure.
The Turnpike Authority
Every turnpike has an authority. Not the operators who run the booths, and not the drivers who pay the fares — but the institution that poured the concrete, erected the signs, and stamped the purchase orders.
The Tollbooth Authority is the Massachusetts Turnpike Authority of the Lightning economy. It doesn't operate any toll booths. It doesn't touch operator BTCPay stores. It never sees user payment data. What it does is simpler and more essential:
- It registers operators who want to run toll booths on the turnpike.
- It collects a modest certification fee — 2% of every fare, minimum 10 sats — paid in advance via Lightning.
- It stamps purchase orders — Schnorr-signed Nostr event certificates (kind 30079) that prove an operator has paid their fee before collecting a fare.
- It never touches the fare itself. The operator collects from the user directly.
The Authority's signature is the proof that the turnpike is legitimate. Without the stamp, the toll booth doesn't open.
Architecture
As of v0.9.0, this Authority is a thin consumer of the tollbooth-dpyc wheel. Every piece of generic Authority code — onboarding state machine, Schnorr certificate signer, replay tracker, Neon tenant provisioner, and the full Authority tool surface — lives in the wheel's tollbooth.authority package. This repo's server.py supplies only actor-specific configuration: identity name, human-readable instructions, OperatorRuntime construction, and two register_*_tools(mcp, runtime) calls.
Refactor history:
- v0.5.0 introduced
OperatorRuntimeand delegated standard tools to the wheel — ~1,900 lines → ~970. - v0.19.0 required+verified proof on every tool that names it; the local
_verify_operator_proofhelper was promoted to wheel-sidetollbooth.identity_proof.require_proof. - v0.21.0 (wheel) promoted 6 supporting modules (onboarding, nostr_signing, replay, tenant_provisioner, role_migration, settings) from forked Authority code into
tollbooth.authority.*. - v0.22.0 (wheel) promoted the 10 Authority
@tooldefinitions intoregister_authority_tools(mcp, runtime). - v0.9.0 (this release) deleted the eight now-redundant modules and slimmed server.py from ~970 lines to about a hundred. NorthAmerica and NewEngland followed suit in their own
0.4.0releases.
Three-Party Protocol
The Tollbooth ecosystem is a three-party protocol spanning three repositories:
The Wider DPYC Federation
The three-party protocol above is the core, but the Authority certifies a wider federation of independent MCP services, all built on the same tollbooth-dpyc SDK:
How It Works
-
Adopt. An operator calls
request_adoption(authority_npub=..., service_url=..., display_name=...)on its own MCP, signing the request with its nsec. Its service delivers the request to the Authority, which records it as pending and notifies its owner. The owner approves it withapprove_operator_request(or turns it down withreject_operator_request); approval creates the operator's ledger entry, provisions its isolated Neon schema and registers it through the Oracle. -
Fund. The operator calls
purchase_creditswith the number of sats they want to pre-fund. The Authority returns a Lightning invoice from its own BTCPay Server. The operator pays. After settlement,check_paymentcredits the balance. -
Certify. When a user wants to buy credits from an operator, the operator's server calls
certify_credits. The Authority deducts the 2% ad valorem fee (via the@runtime.paid_tooldecorator), signs a Schnorr-based Nostr event certificate, and returns it. -
Verify. The operator's tollbooth-dpyc library verifies the certificate using the Authority's Nostr npub. Only if the stamp is valid does the operator create a Lightning invoice for the user. No stamp, no fare.
Nostr Certificate Format (kind 30079)
Certificates are Schnorr-signed Nostr events (NIP-33 parameterized replaceable events) rather than Ed25519 JWTs. Each certificate contains the operator npub in a p tag, the certified amount and protocol in t/L tags, an expiration tag, and the content field holds the structured claim data. Verification uses BIP-340 Schnorr signatures against the Authority's Nostr npub.
DPYC Registry Enforcement
The Authority checks the dpyc-community registry cache members/read-only-lookup-cache.json at certification time. Operators must have "status": "active" in the registry. The registry is HTTP-cached with a configurable TTL. Design is fail-closed: if the registry is unreachable, certification is denied.
Upstream Topology Is Registry Metadata
Parent Authority relationships live in the dpyc-community registry — each Authority's upstream_authority_npub points at its sponsor. Operator MCPs resolve their certifying Authority through the Oracle (resolve_authority_for(npub)), which walks that registry chain; no per-Authority env var configures the upstream. The Authority's own certify_credits simply collects the ad valorem fee from its operator's pre-funded balance and signs the certificate — no per-transaction upstream call.
Ad Valorem Pricing
certify_credits is registered as a @runtime.paid_tool with 2% ad valorem pricing on the amount_sats parameter (minimum 10 sats). The fee is debited by the decorator, and the cost is read from runtime._last_debit_cost — no double computation.
OTS Notarization
OpenTimestamps notarization is enabled (ots_enabled=True on the runtime). Ledger state can be notarized and verified through the standard notarize_ledger and get_notarization_proof tools provided by the wheel.
Anti-Replay (ReplayTracker)
Every certificate includes a unique JTI (JWT ID). The Authority tracks seen JTIs in an in-memory ordered dict with TTL-based pruning. This prevents certificate replay attacks even if a certificate is intercepted before expiration.
MCP Tools
All tools are now wheel-defined and registered by the two register_*_tools calls in server.py. For the full canonical tables (Authority tools mounted by register_authority_tools, standard tools mounted by register_standard_tools) see the tollbooth-dpyc README. The short version:
- Authority tools (Schnorr cert signing, operator lifecycle, 3-step Authority onboarding, registry membership check) —
register_authority_tools(mcp, runtime). This set also includes the owner's request queue:receive_adoption_request(where an operator's adoption request arrives),list_operator_requests,approve_operator_requestandreject_operator_request. The queue holds two kinds of request, an adoption and an update to an operator's registry entry (update_operator, which the operator calls and the owner approves).deregister_operatorneeds no approval: either the operator (leaving) or the Authority's owner (disowning it) may call it alone.repair_operator_schemais the owner's repair of a tenant's table ownership. - The standard tools (credit/payment, identity, secure courier, npub proof, pricing model, OpenTimestamps notarization, oracle delegation) —
register_standard_tools(mcp, "authority", runtime, ...).
Every tool that takes npub requires the connection to prove it, and each request acts as exactly one npub. A request signed with that npub's nsec (NIP-98) proves it. A keyless client connects as an OAuth holder and proves the npub into its wallet once, with request_npub_proof, a reply to the DM, then receive_npub_proof. Owner-only tools require the request to prove the Authority's own npub. No proof travels in a tool argument.
Getting Started
Connecting via Horizon MCP
The Authority runs on Horizon. Any MCP client (Claude Desktop, Cursor, your own agent) can connect via Horizon:
Connecting needs no API key. A client holding a key signs each request with it (NIP-98). Any other client connects with OAuth as a holder, which acts as no npub until one is proven into it by a Nostr DM.
First Connection Walkthrough
Once connected, walk through the bootstrap in order:
request_adoption(authority_npub="npub1...", service_url="...")— call it on your own operator MCP, signed with your operator nsec. The Authority's owner approves it (approve_operator_request), which creates your ledger entry and provisions your Neon schema. Your operator'sadoption_statusreadsprovisionedonce it is done.purchase_credits(amount_sats=1000)— Returns a Lightning invoice. Pay it with any Lightning wallet.check_payment(invoice_id="...")— Pass the invoice ID from step 2. Confirms settlement and credits your balance.check_balance— Verify your balance is funded.operator_status— See your registration, balance, vault backend, and the Authority's npub. tollbooth-dpyc looks that npub up in the registry when it verifies a certificate, so there is nothing to hardcode.
Self-Hosting
To run your own Authority instance, set these environment variables:
Required
Credentials via Secure Courier (NOT env vars)
BTCPay credentials are delivered via Secure Courier, not set as environment variables:
Optional
Per-Operator Schema Isolation
Each registered operator receives an isolated Neon schema (op_{hash}) with a dedicated Postgres LOGIN role. The Authority schema (authority) holds the Authority's own ledger. Operator schemas are provisioned automatically when the owner approves an adoption and access is enforced via role-based grants -- no cross-operator data access is possible.
Development
Key Generation
Nostr Signing Key (Schnorr certificates)
The Authority signs certificates with a Nostr nsec/npub keypair. Generate one using any Nostr key generator (e.g., nak key generate). The nsec goes in TOLLBOOTH_NOSTR_OPERATOR_NSEC; the npub is surfaced via operator_status for tollbooth-dpyc verification.
DPYC Identity (Nostr npub)
Each Authority has a Nostr keypair that identifies it on the DPYC Certification Chain:
Further Reading
The Phantom Tollbooth on the Lightning Turnpike — the full story of how we're monetizing the monetization of AI APIs, and then fading to the background.
License
Apache License 2.0 — see LICENSE and NOTICE for details.
Because every turnpike needs an authority. Not to control the road — just to make sure the stamps are real and the fares are fair.
来源:README.md,提交 68519ad
工具
0版本历史
2- v0.12.0最新Oct 21, 2026
- v0.11.9Sep 16, 2026
评分
已满足适用检查项的 85%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通必需25 分
- 已声明认证方式必需10 分
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Authority 集成
authority.md
md.authority官方发布者
让助手在 authority.md 市场上搜索、浏览 AI 思维框架、工具、Playbook 与组合包,并生成结账链接。

Japan Authority Updates (FSA, BOJ, MOF)
由 GitHub 账号 sition-jp 发布
面向AI代理的日本金融厅、日本央行和财务省更新。免费健康工具;付费工具通过Base上的x402 USDC提供。AI 翻译

PlainRows SEO tools: volume, backlinks, authority
由 GitHub 账号 NadaHo 发布
托管在 Apify 上的远程 MCP 服务器,为助手提供五项 SEO 查询:关键词搜索量、Keyword Planner 数据、外链、域名权重和域名流量。

Domain Authority & Spam Score Checker
由 GitHub 账号 NadaHo 发布
由 Apify 托管的远程 MCP 服务器,让助手批量查询最多 10,000 个域名的域名权重、SEO 垃圾评分、外链和引用域名。
SecureAuth Agent Authority
com.secureauth
一个远程企业级 MCP 网关,对每次工具调用进行基于身份的授权并保留审计记录。