mcpField
R
Receipt — sign an agent's work, verify it offline

Receipt — sign an agent's work, verify it offline

远程服务
github.com/ecstatica安全03 天前更新
代码仓库

关于 Receipt — sign an agent's work, verify it offline

Receipt 是供 Agent 和买方使用的 Python 工具,可为工作文件签名并离线验证。Ed25519 签名将文件哈希与任务、Agent 字段绑定,无需联网即可发现篡改。

主要功能

  1. 01签发 Ed25519 签名凭证
  2. 02离线验证凭证和文件哈希
  3. 03检测签名字段是否被更改
  4. 04使用规范化 JSON 签名

适用场景

  1. 01确认交付文件与凭证匹配
  2. 02在无网络时检查凭证
  3. 03发现文件或凭证被修改

MCP 相关

其 stdio MCP 服务向 MCP 客户端提供 `issue_receipt` 和 `verify_receipt` 工具。

配置

远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。

服务地址https://receipt.whirlwindcorp.com/mcp
一键复制安装命令
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。

安装包
mcpbggbank-receipt.mcpb

工具

详细介绍

receipt

为你的 Agent 完成的工作签名。让任何人都能离线验证。

收据通过 Ed25519 签名将 Agent、任务和文件绑定在一起。验证无需账号、区块链、网络,也无需我们的许可。修改文件中的一个字符或收据中的一个字段,验证就会失败。

这是 Agent 经济中最小且实用的一环:支付通道先于证明通道到来。x402 已处理 1.38 亿笔支付,但大多数 Agent 工作仍然没有资金支持,也未经任何独立方评估。

安装

git clone https://github.com/ecstatica/ggbank-receipt
cd ggbank-receipt
python3 -m pip install --user cryptography

除 cryptography 外无其他依赖。Python 3.10+。

使用

# 1. your agent's key (Ed25519, private key mode 0600)
python3 receipt.py keygen --out ~/.agent.key

# 2. sign a receipt over the artifact the agent delivered
python3 receipt.py issue \
  --key ~/.agent.key \
  --artifact report.pdf \
  --task q-1042 \
  --agent VOID-9 \
  --amount 25 \
  --out q-1042.receipt.json

# 3. anyone can verify it, offline
python3 receipt.py verify --receipt q-1042.receipt.json --artifact report.pdf
OK   signature valid · issuer QRs56MmYfzwtOAih…
OK   artifact matches 04002a7e5527bbad…
     deliver · VOID-9 · task q-1042 · 25.0 GG · 2026-10-25T11:56:24Z

将收据与文件一并发送。买家运行一条命令,就能确认该文件由该 Agent 生成,且此后未被更改。

它能证明什么,不能证明什么

能证明: 此密钥在此时间使用这些字段签署了此工件哈希,且此后未发生更改。

不能证明: 工作质量良好,也不能证明该密钥属于某个特定的人。质量是另一项判断;身份是另一项声明。

将其用作 MCP 服务(Agent 实际调用的方式)

mcp_server.py 通过标准输入/输出使用 JSON-RPC 通信——Claude Code、Cursor、Codex、Hermes 和大多数 Agent 框架都已支持此协议。提供两个工具:issue_receipt、verify_receipt。无需网络,除 cryptography 外无其他依赖。

{"mcpServers": {"receipt": {"command": "python3", "args": ["/abs/path/mcp_server.py"]}}}
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"issue_receipt",
 "arguments":{"artifact_path":"/tmp/report.pdf","agent":"VOID-9","task":"q-1042","amount_gg":25}}}
→ {"ok": true, "receipt": {...}}

已验证往返流程:issue_receipt → verify_receipt 返回 ok: true;更改金额后则返回 ok: false, reason: "signature: InvalidSignature"。

收据包含什么

{
 "spec": "ggbank.receipt/1",
 "verb": "deliver",
 "agent": "VOID-9",
 "task": "q-1042",
 "artifact": {"name": "report.pdf", "sha256": "04002a7e…", "bytes": 18422},
 "amount_gg": "25.000000",
 "fee_gg": "0.125000",
 "issued_at": "2026-10-25T11:56:24Z",
 "issuer": "<base64 public key>",
 "nonce": "…",
 "signature": "<base64>"
}

规范 JSON(键已排序,无空白字符)会进行签名,因此签名字节可在任何语言中复现。金额字段使用十进制字符串,绝不使用浮点数。

篡改检测,已通过测试

python3 receipt.py verify --receipt tampered.json     # FAIL signature: InvalidSignature
python3 receipt.py verify --receipt good.json --artifact edited.pdf
                                                      # FAIL artifact: hash mismatch

许可证

MIT。

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。