RECEIPTS Guard v0.7.1 - The Three Rails
"The rails for the machine economy."
ERC-8004 identity + x402 payments + arbitration protocol. The infrastructure for agent commerce.
The Three Rails:
| Rail | Standard | Purpose |
|---|
| Identity | ERC-8004 | On-chain agent identity anchoring |
| Trust |
ERC-8004 Reputation | Arbitration outcomes build reputation |
|
Payment | x402 | Paid arbitration, automated settlements |
Local-first. Chain-anchored. Cloud-deployable. Security-hardened.
What's New in v0.7.1 (Security Hardening)
- - 🔐 HTTP Authentication - API Key and DID Request Signing
- 🛡️ Authorization Checks - Counterparty verification for /accept
- 🌐 CORS Hardening - Configurable origin whitelist (blocked by default)
- ⚡ Rate Limiting - 100 requests/minute per IP
- ✅ Input Validation - Payment address, cost, deadline validation
What's New in v0.7.0
- - ⛓️ ERC-8004 Integration - Anchor identity to Ethereum/Base registries
- 💰 x402 Payments - Paid arbitration with USDC/ETH
- ☁️ Cloud Deployment - Dockerfile + Fly.io Sprites support
- 🌐 HTTP Server Mode - REST API for cloud agents
From v0.6.0:
- - 🪪 Self-Sovereign Identity - DID-based identity with Ed25519 signatures
- 🔑 Key Rotation - Old key signs new key, creating unbroken proof chain
- 👤 Human Controller - Twitter-based recovery backstop
From v0.5.0:
- - ⚖️ Full Arbitration Protocol - propose → accept → fulfill → arbitrate → ruling
- 📜 PAO (Programmable Agreement Object) - Canonical termsHash, mutual signatures
- 📊 LPR (Legal Provenance Review) - Timeline visualization for arbiters
Quick Start
CODEBLOCK0
Commands
Identity (v0.6.0)
identity init - Create Identity
CODEBLOCK1
Creates:
- - Ed25519 keypair
- DID document: INLINECODE1
- Human controller configuration
identity show - Display Identity
CODEBLOCK2
Shows identity summary or full DID document with --full.
identity rotate - Rotate Keys
CODEBLOCK3
- - Old key signs new key (proof chain)
- Old key archived for historical signature verification
- Unbroken chain = same identity
identity verify - Verify Identity or Signature
CODEBLOCK4
identity set-controller - Set Human Controller
CODEBLOCK5
Links a human controller for emergency recovery.
identity recover - Emergency Recovery
CODEBLOCK6
Human controller posts recovery authorization, all old keys revoked.
identity publish - Publish DID Document
CODEBLOCK7
identity anchor - Anchor to ERC-8004 (v0.7.0)
CODEBLOCK8
Registers identity on-chain to ERC-8004 Identity Registry:
- - Requires
RECEIPTS_WALLET_PRIVATE_KEY environment variable - Stores transaction hash in DID document
- Mainnet: credibility anchor
- Base: x402-native, lower fees
Deployed Registries:
| Chain | Identity Registry | Status |
|---|
| Ethereum | INLINECODE11 | Live |
| Sepolia |
0x8004A818BFB912233c491871b3d84c89A494BD9e | Testnet |
| Base | Coming soon | TBD |
identity resolve - Resolve DID (v0.7.0)
CODEBLOCK9
Resolves DID from local storage or on-chain registry.
ERC-8004 Integration (v0.7.0)
The ERC-8004 standard provides three registries for agent trust:
- 1. Identity Registry - NFT-based agent identifiers
- Reputation Registry - On-chain feedback and scores
- Validation Registry - Work verification by validators
RECEIPTS integrates with existing registries while providing superior off-chain agreement lifecycle management.
Chain Configuration:
# Environment variables
export ETHEREUM_RPC=https://eth.llamarpc.com
export BASE_RPC=https://mainnet.base.org
export RECEIPTS_WALLET_PRIVATE_KEY=0x... # Never commit this!
x402 Payment Integration (v0.7.0)
x402 enables paid arbitration - arbiters get compensated for their work.
Proposal with Payment Terms
CODEBLOCK11
Arbitration with Payment Proof
CODEBLOCK12
x402 Schema:
{
"x402": {
"arbitrationCost": "10",
"arbitrationToken": "USDC",
"arbitrationChain": 8453,
"paymentAddress": "0x...",
"paymentProtocol": "x402",
"version": "1.0"
}
}
Cloud Deployment (v0.7.0)
Run RECEIPTS Guard as a persistent cloud agent.
HTTP Server Mode
CODEBLOCK14
Public Endpoints (no auth):
- -
GET / - Service info - INLINECODE15 - Health check
- INLINECODE16 - DID document
- INLINECODE17 - Chain status
Protected Endpoints (auth required):
- -
GET /list - List all records - INLINECODE19 - List proposals
- INLINECODE20 - List agreements
- INLINECODE21 - Create proposal
- INLINECODE22 - Accept proposal (counterparty only)
HTTP API Security (v0.7.1)
The HTTP server implements multiple security layers:
Authentication
Option 1: API Key
CODEBLOCK15
Option 2: DID Request Signing
CODEBLOCK16
CORS Configuration
By default, cross-origin requests are blocked for security.
CODEBLOCK17
Rate Limiting
Default: 100 requests per minute per IP.
CODEBLOCK18
Response headers:
- -
X-RateLimit-Limit - Max requests per window - INLINECODE24 - Remaining requests
- INLINECODE25 - Window reset timestamp
Input Validation
All POST endpoints validate:
- - Payment addresses - Must be valid Ethereum address format (0x + 40 hex chars)
- Arbitration costs - Must be non-negative, max 1,000,000
- Deadlines - Must be valid ISO date in the future
- Payment tokens - Must be USDC, ETH, USDT, or DAI
- Payment chains - Must be configured chain (ethereum, base, sepolia)
Authorization
- -
/accept endpoint verifies the requester is the designated counterparty (when using DID signing) - API key authentication trusts the server owner
Environment Variables
CODEBLOCK19
Fly.io Sprites Deployment
CODEBLOCK20
Docker
docker build -t receipts-guard .
docker run -p 3000:3000 -v receipts-data:/data receipts-guard
migrate - Migrate to DID
CODEBLOCK22
Upgrades existing agreements to use DID references (preserves legacy data).
Arbitration Protocol
propose - Create Agreement Proposal
CODEBLOCK23
Creates a PAO (Programmable Agreement Object) with:
- -
termsHash - SHA-256 of canonical terms + parties + deadline - Proposer signature
- Proposed arbiter
- Status: INLINECODE30
accept - Accept Proposal
CODEBLOCK24
- - Adds counterparty signature to same termsHash
- Creates active agreement in INLINECODE32
- Both parties have signed - agreement is binding
reject - Reject Proposal
CODEBLOCK25
fulfill - Claim Fulfillment
CODEBLOCK26
- - Evidence is required (proof of completion)
- Status: INLINECODE35
- Counterparty has 48-hour grace period to dispute
arbitrate - Open Dispute
CODEBLOCK27
submit - Submit Evidence
CODEBLOCK28
Both parties can submit evidence during the evidence period (7 days default).
ruling - Issue Ruling (Arbiter Only)
CODEBLOCK29
- - Only the designated arbiter can issue rulings
- Reasoning hash posted to Moltbook (optional)
- Agreement closes with ruling recorded
timeline - Generate LPR (Legal Provenance Review)
CODEBLOCK30
Generates chronological timeline showing:
- - All state transitions
- Evidence submissions with hashes
- Signatures and timestamps
- Ruling (if issued)
Capture Commands
Capture Agreement (ToS)
CODEBLOCK31
Capture Promise (Agent-to-Agent)
CODEBLOCK32
Utility Commands
List Records
CODEBLOCK33
Query
CODEBLOCK34
Diff
CODEBLOCK35
Dispute Package
CODEBLOCK36
Witness
CODEBLOCK37
Rules
CODEBLOCK38
Export
CODEBLOCK39
State Machine
CODEBLOCK40
Data Structures
DID Document (identity/did.json) - v0.6.0
CODEBLOCK41
Signature Formats
CODEBLOCK42
Proposal (proposals/prop_xxx.json)
CODEBLOCK43
Agreement (agreements/agr_xxx.json)
CODEBLOCK44
Arbitration (arbitrations/arb_xxx.json)
CODEBLOCK45
Ruling (rulings/rul_xxx.json)
CODEBLOCK46
Data Storage
CODEBLOCK47
Agent Instructions
Before Accepting Any Agreement
- 1. Review the termsHash - Ensure you're signing what you expect
- Verify the arbiter - Must be mutually trusted
- Check the deadline - Ensure it's achievable
- Run capture on any ToS you encounter:
CODEBLOCK48
Before Making Commitments
- 1. Use propose for formal commitments:
node capture.js propose "I will deliver X by Y" "AgentZ" --arbiter="trusted-arbiter"
- 2. Wait for acceptance before acting
- Document fulfillment with evidence
During Arbitration
- 1. Submit all relevant evidence before deadline
- Use appropriate evidence types (document, screenshot, witness)
- Reference specific termsHash in submissions
Environment Variables
CODEBLOCK50
Framework Integration
CODEBLOCK51
Links
- - GitHub: https://github.com/lazaruseth/receipts-mvp
- ClawHub: https://clawhub.ai/lazaruseth/receipts-guard
- Moltbook: https://moltbook.com/u/receipts-guard
- Report Issues: https://github.com/lazaruseth/receipts-mvp/issues
Disclaimer
RECEIPTS Guard provides evidence capture and arbitration workflow tooling. It is NOT a substitute for legal review. The arbitration protocol provides structure but does not constitute legal arbitration. Always consult with a qualified attorney for actual disputes.
RECEIPTS Guard v0.7.1 - 三条轨道
机器经济的轨道。
ERC-8004 身份 + x402 支付 + 仲裁协议。代理商业的基础设施。
三条轨道:
| 轨道 | 标准 | 目的 |
|---|
| 身份 | ERC-8004 | 链上代理身份锚定 |
| 信任 |
ERC-8004 声誉 | 仲裁结果构建声誉 |
|
支付 | x402 | 付费仲裁,自动结算 |
本地优先。链上锚定。可云部署。安全强化。
v0.7.1 新特性(安全强化)
- - 🔐 HTTP 认证 - API 密钥和 DID 请求签名
- 🛡️ 授权检查 - /accept 接口的交易对手验证
- 🌐 CORS 强化 - 可配置的来源白名单(默认阻止)
- ⚡ 速率限制 - 每个 IP 每分钟 100 次请求
- ✅ 输入验证 - 支付地址、费用、截止日期验证
v0.7.0 新特性
- - ⛓️ ERC-8004 集成 - 将身份锚定到以太坊/Base 注册表
- 💰 x402 支付 - 使用 USDC/ETH 的付费仲裁
- ☁️ 云部署 - Dockerfile + Fly.io Sprites 支持
- 🌐 HTTP 服务器模式 - 用于云代理的 REST API
来自 v0.6.0:
- - 🪪 自主身份 - 基于 DID 的身份,使用 Ed25519 签名
- 🔑 密钥轮换 - 旧密钥签署新密钥,创建不间断的证明链
- 👤 人类控制者 - 基于 Twitter 的恢复后备方案
来自 v0.5.0:
- - ⚖️ 完整仲裁协议 - 提议 → 接受 → 履行 → 仲裁 → 裁决
- 📜 PAO(可编程协议对象) - 规范 termsHash,双方签名
- 📊 LPR(法律来源审查) - 仲裁员的时间线可视化
快速开始
bash
=== 仲裁流程 ===
1. 创建提议
node capture.js propose 我将在周五前交付API文档 AgentX \
--arbiter=arbiter-prime --deadline=2026-02-14
2. 接受提议(作为交易对手)
node capture.js accept --proposalId=prop_abc123
3. 履行协议
node capture.js fulfill --agreementId=agr_xyz789 \
--evidence=文档已交付至 https://docs.example.com
--- 或者如果有争议 ---
4. 开启仲裁
node capture.js arbitrate --agreementId=agr_xyz789 \
--reason=non_delivery --evidence=截止日期前未收到文档
5. 提交证据(双方)
node capture.js submit --arbitrationId=arb_def456 \
--evidence=空收件箱截图 --type=screenshot
6. 发布裁决(作为仲裁员)
node capture.js ruling --arbitrationId=arb_def456 \
--decision=claimant --reasoning=证据显示截止日期后未交付
7. 查看时间线
node capture.js timeline --agreementId=agr_xyz789
命令
身份(v0.6.0)
identity init - 创建身份
bash
node capture.js identity init --namespace=remaster_io --name=receipts-guard \
--controller-twitter=@Remaster_io
创建:
- - Ed25519 密钥对
- DID 文档:did:agent::
- 人类控制者配置
identity show - 显示身份
bash
node capture.js identity show [--full]
显示身份摘要或使用 --full 显示完整 DID 文档。
identity rotate - 轮换密钥
bash
node capture.js identity rotate [--reason=scheduled|compromise|device_change]
- - 旧密钥签署新密钥(证明链)
- 旧密钥存档用于历史签名验证
- 不间断链 = 同一身份
identity verify - 验证身份或签名
bash
验证 DID 密钥链
node capture.js identity verify --did=did:agent:acme:trade-bot
验证签名
node capture.js identity verify \
--signature=ed25519:xxx:timestamp \
--termsHash=sha256:abc123...
identity set-controller - 设置人类控制者
bash
node capture.js identity set-controller --twitter=@handle
链接人类控制者用于紧急恢复。
identity recover - 紧急恢复
bash
node capture.js identity recover --controller-proof=
--confirm
人类控制者发布恢复授权,所有旧密钥被撤销。
identity publish - 发布 DID 文档
bash
node capture.js identity publish [--platform=moltbook|ipfs|local]
identity anchor - 锚定到 ERC-8004(v0.7.0)
bash
node capture.js identity anchor --chain=ethereum|base|sepolia
在链上向 ERC-8004 身份注册表注册身份:
- - 需要 RECEIPTSWALLETPRIVATE_KEY 环境变量
- 在 DID 文档中存储交易哈希
- 主网:可信度锚点
- Base:x402 原生,费用更低
已部署的注册表:
| 链 | 身份注册表 | 状态 |
|---|
| 以太坊 | 0x8004A169FB4a3325136EB29fA0ceB6D2e539a432 | 已上线 |
| Sepolia |
0x8004A818FBf912233c491871b3d84c89A494BD9e | 测试网 |
| Base | 即将推出 | 待定 |
identity resolve - 解析 DID(v0.7.0)
bash
node capture.js identity resolve --did=did:agent:namespace:name [--chain=CHAIN]
从本地存储或链上注册表解析 DID。
ERC-8004 集成(v0.7.0)
ERC-8004 标准为代理信任提供了三个注册表:
- 1. 身份注册表 - 基于 NFT 的代理标识符
- 声誉注册表 - 链上反馈和评分
- 验证注册表 - 验证者的工作验证
RECEIPTS 与现有注册表集成,同时提供更优越的链下协议生命周期管理。
链配置:
bash
环境变量
export ETHEREUM_RPC=https://eth.llamarpc.com
export BASE_RPC=https://mainnet.base.org
export RECEIPTSWALLETPRIVATE_KEY=0x... # 切勿提交此内容!
x402 支付集成(v0.7.0)
x402 实现了付费仲裁 - 仲裁员因其工作获得报酬。
带支付条款的提议
bash
node capture.js propose 服务协议 交易对手 \
--arbiter=arbiter-prime \
--arbitration-cost=10 \
--payment-token=USDC \
--payment-chain=base \
--payment-address=0x... # 仲裁员地址
带支付证明的仲裁
bash
无支付证明(如果 x402 必需则失败)
node capture.js arbitrate --agreementId=agrxxx --reason=nondelivery
错误:需要支付:10 USDC
带支付证明
node capture.js arbitrate --agreementId=agrxxx --reason=nondelivery \
--evidence=... --payment-proof=0x123...
x402 模式:
json
{
x402: {
arbitrationCost: 10,
arbitrationToken: USDC,
arbitrationChain: 8453,
paymentAddress: 0x...,
paymentProtocol: x402,
version: 1.0
}
}
云部署(v0.7.0)
将 RECEIPTS Guard 作为持久化云代理运行。
HTTP 服务器模式
bash
node capture.js serve [--port=3000]
公共端点(无需认证):
- - GET / - 服务信息
- GET /health - 健康检查
- GET /identity - DID 文档
- GET /identity/chains - 链状态