x402receipts

السجل الرسمي الأمن

Record x402 agent purchases as reconciled, auditable receipts; verify any receipt on the ledger.

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

NPM package x402receipts-mcp
Claude Code
claude mcp add x402receipts -e 'X402RECEIPTS_EVM_PRIVATE_KEY=<your x402receipts_evm_private_key>' -e 'X402RECEIPTS_SOLANA_PRIVATE_KEY=<your x402receipts_solana_private_key>' -- npx -y x402receipts-mcp@1.0.0
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "x402receipts": {
            "command": "npx",
            "args": [
                "-y",
                "x402receipts-mcp@1.0.0"
            ],
            "env": {
                "X402RECEIPTS_EVM_PRIVATE_KEY": "<your x402receipts_evm_private_key>",
                "X402RECEIPTS_SOLANA_PRIVATE_KEY": "<your x402receipts_solana_private_key>"
            }
        }
    }
}

متغيرات البيئة

  • X402RECEIPTS_EVM_PRIVATE_KEY سري Optional. 0x… key holding USDC on Base; pays USD 1 per wallet per calendar month; later uploads that month are free.
  • X402RECEIPTS_SOLANA_PRIVATE_KEY سري Optional. ed25519 key (hex or base58) holding USDC on Solana.

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. x402receipts
  2. Use it
  3. The format is an open standard
  4. In this repo
  5. How it works

x402receipts

Accounting infrastructure for autonomous spending. Every x402 purchase an agent makes becomes a receipt, reconciled against the on-chain transaction, with missing or unmatched payments flagged, monthly statements for finance, and evidence anyone can verify.

Use it

In code — one wrapper around the fetch your agent already pays with (npm i x402receipts-sdk):

import { wrapFetchWithPayment } from "@x402/fetch";
import { withRegister } from "x402receipts-sdk";

const register = withRegister(fetch, { endpoint: "https://app.x402receipts.com", payWith: () => pay });
const pay = wrapFetchWithPayment(register, wallet);

As an MCP server (npx -y x402receipts-mcp): record_receipts, verify_receipt, service_info. See packages/mcp.

Over HTTP: POST https://app.x402receipts.com/api/v1/receipts — answers 402 with the x402 challenge; any x402 client pays it.

With an AI coding tool: paste the integration prompt into Claude Code or Cursor.

The format is an open standard

The record, its fingerprint, the append-only log above it, the anchor record and the verification algorithm are published as ARR-1 — Agent Receipt Record, released into the public domain (CC0). JSON Schemas are in spec/arr-1/. Implement it yourself, or check our implementation against it.

ARR-1 builds on existing standards rather than replacing them: the tree is the RFC 9162 profile used by Certificate Transparency, checkpoints are published as HCS-27 messages, accounts are named with CAIP-2/CAIP-10, and agents with HCS-14 identifiers.

In this repo

PathWhat
spec/arr-1/the ARR-1 specification and its JSON Schemas (CC0)
sdk/the x402receipts-sdk npm package (single file, no dependencies)
packages/mcp/the x402receipts-mcp MCP server
examples/plain Node, Vercel AI SDK, LangChain, OpenAI Agents
integrations/agentkit/Coinbase AgentKit action provider
integrations/x402-ecosystem/x402.org ecosystem entry

How it works

  1. Capture — the SDK records each paid call: resource, amount, counterparty, transaction reference, request/response fingerprints, delivery status, and the seller's signed receipt when it issues one (x402 offer-receipt).
  2. Reconcile — the connected wallets are read on Base and Solana; every outgoing USDC payment is matched to a receipt. What doesn't match is an exception, not an average.
  3. Prove — each night, the account's whole receipt log is hashed into one RFC 9162 Merkle tree and its root is written to the Hedera Consensus Service, linked to the previous day's root. Every receipt has a public verification page that redoes the maths in the browser.
  4. Report — the owner signs in with the wallet: spend by supplier, the register, CSV and signed JSON export.

Guide: https://x402receipts.com/guide.html · Status: https://app.x402receipts.com/status · Contact: hello@x402receipts.com

MIT licensed.

الأسئلة الشائعة

ما هو x402receipts؟

Record x402 agent purchases as reconciled, auditable receipts; verify any receipt on the ledger.

كيف أثبّت x402receipts؟

يعمل على جهازك. في Claude Code: claude mcp add x402receipts -e 'X402RECEIPTS_EVM_PRIVATE_KEY=<your x402receipts_evm_private_key>' -e 'X402RECEIPTS_SOLANA_PRIVATE_KEY=<your x402receipts_solana_private_key>' -- npx -y x402receipts-mcp@1.0.0. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج x402receipts إلى مفتاح API؟

نعم. يتطلب X402RECEIPTS_EVM_PRIVATE_KEY, X402RECEIPTS_SOLANA_PRIVATE_KEY، وتضبطها في إعداداته.

هل x402receipts مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون x402receipts؟

ينشره x402receipts. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.