receipts-guard
ERC-8004 identity, x402 payments, and arbitration protocol for autonomous agent commerce. The three rails for the machine economy.
What this skill does
# 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
```bash
# === ARBITRATION FLOW ===
# 1. Create proposal
node capture.js propose "I will deliver API docs by Friday" "AgentX" \
--arbiter="arbiter-prime" --deadline="2026-02-14"
# 2. Accept proposal (as counterparty)
node capture.js accept --proposalId=prop_abc123
# 3. Fulfill agreement
node capture.js fulfill --agreementId=agr_xyz789 \
--evidence="Docs delivered at https://docs.example.com"
# --- OR if there's a dispute ---
# 4. Open arbitration
node capture.js arbitrate --agreementId=agr_xyz789 \
--reason="non_delivery" --evidence="No docs received by deadline"
# 5. Submit evidence (both parties)
node capture.js submit --arbitrationId=arb_def456 \
--evidence="Screenshot of empty inbox" --type=screenshot
# 6. Issue ruling (as arbiter)
node capture.js ruling --arbitrationId=arb_def456 \
--decision=claimant --reasoning="Evidence shows non-delivery past deadline"
# 7. View timeline
node capture.js timeline --agreementId=agr_xyz789
```
## Commands
### Identity (v0.6.0)
#### `identity init` - Create Identity
```bash
node capture.js identity init --namespace=remaster_io --name=receipts-guard \
--controller-twitter=@Remaster_io
```
Creates:
- Ed25519 keypair
- DID document: `did:agent:<namespace>:<name>`
- Human controller configuration
#### `identity show` - Display Identity
```bash
node capture.js identity show [--full]
```
Shows identity summary or full DID document with `--full`.
#### `identity rotate` - Rotate Keys
```bash
node capture.js identity rotate [--reason=scheduled|compromise|device_change]
```
- Old key signs new key (proof chain)
- Old key archived for historical signature verification
- Unbroken chain = same identity
#### `identity verify` - Verify Identity or Signature
```bash
# Verify DID key chain
node capture.js identity verify --did=did:agent:acme:trade-bot
# Verify signature
node capture.js identity verify \
--signature="ed25519:xxx:timestamp" \
--termsHash="sha256:abc123..."
```
#### `identity set-controller` - Set Human Controller
```bash
node capture.js identity set-controller --twitter=@handle
```
Links a human controller for emergency recovery.
#### `identity recover` - Emergency Recovery
```bash
node capture.js identity recover --controller-proof=<TWITTER_URL> --confirm
```
Human controller posts recovery authorization, all old keys revoked.
#### `identity publish` - Publish DID Document
```bash
node capture.js identity publish [--platform=moltbook|ipfs|local]
```
#### `identity anchor` - Anchor to ERC-8004 (v0.7.0)
```bash
node capture.js identity anchor --chain=ethereum|base|sepolia
```
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 | `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` | Live |
| Sepolia | `0x8004A818BFB912233c491871b3d84c89A494BD9e` | Testnet |
| Base | Coming soon | TBD |
#### `identity resolve` - Resolve DID (v0.7.0)
```bash
node capture.js identity resolve --did=did:agent:namespace:name [--chain=CHAIN]
```
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
2. **Reputation Registry** - On-chain feedback and scores
3. **Validation Registry** - Work verification by validators
RECEIPTS integrates with existing registries while providing superior off-chain agreement lifecycle management.
**Chain Configuration:**
```bash
# 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
```bash
node capture.js propose "Service agreement" "counterparty" \
--arbiter="arbiter-prime" \
--arbitration-cost="10" \
--payment-token="USDC" \
--payment-chain="base" \
--payment-address="0x..." # Arbiter's address
```
#### Arbitration with Payment Proof
```bash
# Without payment proof (fails if x402 required)
node capture.js arbitrate --agreementId=agr_xxx --reason="non_delivery"
# Error: Payment required: 10 USDC
# With payment proof
node capture.js arbitrate --agreementId=agr_xxx --reason="non_delivery" \
--evidence="..." --payment-proof="0x123..."
```
**x402 Schema:**
```json
{
"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
```bash
node capture.js serve [--port=3000]
```
**Public Endpoints (no auth):**
- `GET /` - Service info
- `GET /health` - Health check
- `GET /identity` - DID document
- `GET /identity/chains` - Chain status
**Protected Endpoints (auth required):**
- `GET /list` - List all records
- `GET /proposals` - List proposals
- `GET /agreements` - List agreements
- `POST /propose` - Create proposal
- `POST /accept` - Accept proposal (counterparty only)
---
### HTTP API Security (v0.7.1)
The HTTP server implements multiple security layers:
#### Authentication
**Option 1: API Key**
```bash
# Generate a secure API key
export RECEIPTS_API_KEY=$(openssl rand -hex 32)
# Use in requests
curl -H "X-API-Key: $RECEIPTS_API_KEY" https://your-agent.fly.dev/list
```
**Option 2: DID Request Signing**
```bash
# Sign each request with your Ed25519 key
# Headers required:
# - X-DID: your DID (e.g., did:agent:namespace:name)
# - X-DID-Timestamp: Unix timestamp in milliseconds
# - X-DID-Signature: ed25519:BASE64URL_SIGNATURE:TIMESTAMP
# Signed message format: METHOD:PATH:TIMESTAMP
# Example: POST:/propose:1707494400000
```
#### CORS Configuration
By default, cross-origin requests are **blocked** for security.
```bash
# Allow specific origins
export RECEIPTS_ALLOWED_ORIGINS=https://app.example.com,https://dashboard.example.com
# Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts โ single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score โฅ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.