Built at ETHGlobal Open Agents 2026 | Live Demo | Demo Video |
npm install agenticproof
Live Demo | Demo Video | Demo | Verify | Eval | Trial | Team Feed
The evaluation layer every agent harness needs. Claude Code, Cursor, OpenClaw: agents are shipping everywhere. RECEIPT measures whether their work was actually useful. Signed, hash-linked receipts for verifiable AI agent handoffs with TEE-attested quality scoring.
Layer 1: Proof of Action. Every agent action (reading a file, calling an API, running inference, making a decision) produces a cryptographically signed receipt (ed25519 + SHA-256). Receipts hash-link into a tamper-proof chain. Any modification breaks the chain. When The Builder receives work from The Researcher, it independently verifies every receipt before continuing.
Layer 2: Proof of Usefulness. After verification, a TEE-attested LLM review scores the chain's output quality on three axes: alignment, substance, and quality (each 0-100). The review itself becomes a signed receipt, so the quality assessment is as tamper-proof as the work it evaluates.
Why TEE matters here. The review must be trustworthy. A regular LLM call could be spoofed; an operator could fake high scores. 0G Compute TEE attestation (Intel TDX) means the scoring ran inside a hardware enclave and can't be fabricated. The reviewer model is selected inside the enclave too. Agents can't pick their own grader.
The feedback loop. Usefulness scores anchor on-chain alongside the receipt hash, creating on-chain agent reputation. Only chains scoring above a quality threshold become fine-tuning data. The system self-improves: good agent work trains better agents, bad work is excluded.
Deployed Contracts (0G Mainnet):
- ReceiptAnchorV2:
0x73B9A7768679B154D7E1eC5F2570a622A3b49651: stores usefulness scores on-chain - AgentNFT:
0xf964d45c3Ea5368918B1FDD49551E373028108c9: ERC-7857 agent identity - ValidationRegistry:
0x2E32E845928A92DB193B59676C16D52923Fa01dd: ERC-8004 agent proof attestations - ReceiptRegistry:
0x717D062E47898441a51EAdcA40873190A339B328: on-chain chain coordination per wallet
The Researcher The Builder
│ │
├─ file_read → receipt₁ │
├─ api_call → receipt₂ │
├─ llm_call → receipt₃ │
├─ decision → receipt₄ │
├─ output → receipt₅ │
│ │
└──── handoff (peer-to-peer) ──────┤
├─ verify chain (ed25519 + hash links)
├─ file_read → receipt₆
├─ api_call → receipt₇
├─ decision → receipt₈
├─ output → receipt₉
└─ usefulness_review → receipt₁₀ (TEE-attested)
│
compute root hash
│
┌─────────────┬───────────┼───────────┬──────────────┬──────────────┐
│ │ │ │ │
0G Storage 0G Mainnet 0G Fine-Tune AgentNFT Validation
(Merkle root) (anchor tx) (TEE upload) (ERC-7857) (ERC-8004)
One pipeline run exercises verified compute, verified identity, and verified training: the full stack.
Verified Compute: 0G Sealed Inference (TEE)
Every LLM call runs inside an Intel TDX hardware enclave via @0glabs/0g-serving-broker. Used twice per pipeline: once for the Researcher's analysis inference, once for the Builder's independent quality review. The reviewer model is TEE-selected; the agent can't choose its own grader. Each receipt carries attestation metadata: provider address, TEE type, and a verifiable signature endpoint.
Verified Identity: ERC-7857 Agentic ID
Each agent mints an on-chain identity token via AgentNFT.sol (ERC-7857). The NFT carries the agent's Ed25519 public key hash and receipt chain root as iDatas. Supports the full iNFT lifecycle: mint, transfer, clone, authorizeUsage. Trust scores evolve as the agent builds on-chain reputation through verified work. Composable with ERC-8004 (Trustless Agents). RECEIPT receipts map to ERC-8004 Validation Registry responses.
Verified Training: Quality-Gated Fine-Tuning Only chains scoring ≥60/100 usefulness become training data. The pipeline discovers fine-tuning providers, uploads high-quality chains via TEE, and attempts LoRA deployment. Low-quality chains are excluded. The system self-improves by only training on proven good work.
All five 0G modules working as a coherent system:
- Compute: TEE-attested inference via Intel TDX enclaves. Dual use: Researcher inference (DeepSeek V3) and Builder quality review (GLM-5). Tries 4 provider addresses with automatic fallback. Real
processResponse()for TEE signature verification. - Storage: Content-addressed persistence via Merkle trees using
@0gfoundation/0g-ts-sdk. Receipt chains serialize to bytes, get Merkle-treed, and upload to 0G storage nodes. - Chain:
ReceiptAnchorV2.solon 0G Mainnet (chain ID 16661).anchorRoot(bytes32, bytes32, uint8)stores chain root hash, storage reference, and usefulness score permanently. Quality gate: chains scoring below 60/100 are NOT anchored. - Fine-Tuning: Quality-gated training pipeline. After
createFineTuningTask(), attemptsresolveAdapterName()thendeployAdapterByName()to close the loop. - Agentic ID (ERC-7857): On-chain agent identity NFT with dynamic trust scoring based on verified work history.
- KV Store: Agent reputation registry via
KvClient/StreamDataBuilder/Batcher. Each run writes the usefulness score to a queryable KV stream.
Agent-to-agent transport is powered by Gensyn AXL. When the Researcher completes its chain, the receipt bundle travels peer-to-peer via AXL. No central server touches it. The Builder receives, verifies, and extends the chain independently.
The SDK integration (packages/receipt-sdk/src/integrations/axl.ts) provides:
- Peer discovery via
/topology - A2A agent card discovery via
/a2a/{peerId} - Handoff via
sendHandoffA2A()with JSON-RPC 2.0SendMessageenvelope - MCP tool calls via
callMcpTool()(verify_chain, get_capabilities, get_chain_stats) - Broadcast to all peers via
broadcastHandoff()
When AXL is unavailable: direct HTTP handoff (clearly marked), no simulated data.
Standalone demos:
demo/axl/sender.ts: Creates receipt chain, sends handoff bundle to peerdemo/axl/receiver.ts: Receives bundle, verifies chain, extends with new receipts
- Live Demo: Watch Researcher + Builder generate receipts in real-time. Honest mode + adversarial tamper detection.
- Trial: Execution replay with timeline visualization, token/time/quality metrics, human review (becomes receipt #11), and comparison mode.
- Team: Multi-agent chain feed. Aggregates receipt chains from Claude Code hooks and OpenClaw plugin. Filter by source, verify any chain.
- Verify: Independent chain verifier using WebCrypto (ed25519 + SHA-256). Paste any chain and see exactly where it breaks.
- Eval: Constitutional AI evaluation harness. 60 test cases, 3 model evaluators, self-critique loop, consensus accuracy.
- Reputation: Agent leaderboard with verification rate and cost-per-useful-output analysis.
packages/
receipt-sdk/ npm: agenticproof: types, crypto, chain, agent, verify, integrations
receipt-cli/ CLI tool: run, verify, inspect, export, anchor
openclaw-plugin-receipt/ OpenClaw plugin: native agent lifecycle hooks
contracts/
ReceiptAnchorV2.sol On-chain anchor: stores usefulness scores (deployed on 0G Mainnet)
AgentNFT.sol ERC-7857 Agentic Identity NFT contract
ValidationRegistry.sol ERC-8004 agent proof attestations (deployed on 0G Mainnet)
ReceiptRegistry.sol On-chain chain coordination: maps wallets to receipt chains
demo/
app/ Next.js demo: 8 pages (home, live demo, trial, team, verify, eval, reputation, dashboard)
agents/ Standalone agent scripts (researcher → builder handoff)
axl/ Gensyn AXL P2P demo (sender + receiver)
npm install agenticproofimport { createAgentRun, wrapTool } from 'agenticproof';
const run = createAgentRun({ agentId: 'my-agent' });
run.contextRead('task', 'Audit vault-protocol for reentrancy');
const search = wrapTool(run, 'search_code', mySearchFunction);
const results = await search({ query: 'withdraw', repo: 'vault-protocol' });
run.decision('No critical vulnerabilities found', 'Recommend gas optimization');
run.messageSend('user', 'Audit complete. No issues.');
const chain = run.finalize();
console.log(chain.valid); // true: every action signed and hash-linkedimport { createReceiptMiddleware } from 'agenticproof';
const middleware = createReceiptMiddleware({ agentName: 'my-agent' });
const result = await middleware.wrap('llm_call', 'Analyze data', async () => {
return await llm.chat('Analyze this dataset');
});
const chain = middleware.getChain();For OpenClaw-based agents, install the plugin and every agent run gets receipted automatically:
openclaw plugins install openclaw-plugin-receiptNo code changes needed. The plugin hooks into the agent lifecycle:
| Agent Action | Receipt Type | Hook |
|---|---|---|
| Loading context/memory | context_read |
before_prompt_build |
| Calling a tool | tool_call |
before_tool_call |
| Tool returns result | tool_result |
after_tool_call |
| Sending a message | message_send |
message_sending |
| Final answer | decision |
agent_end |
Chains are queryable via HTTP on the gateway:
curl http://localhost:18789/plugins/receipt/latest # most recent chain
curl http://localhost:18789/plugins/receipt/chains # all chains
curl http://localhost:18789/plugins/receipt/verify/ID # verify integritySee packages/openclaw-plugin-receipt/ for full docs.
Every file read, edit, bash command, and agent spawn becomes a signed receipt:
npx receipt init --claude-codeThis installs hooks into .claude/settings.json. Chains are written to .receipt/chains/ when a session ends. No code changes, no manual wrapping: just install and every Claude Code action gets receipted.
See examples/claude-code-hooks/ for details.
For Cursor's agent mode, a lightweight watcher monitors file changes:
npx receipt init --cursor
node .receipt/cursor-watcher.mjsEvery file Cursor's agent edits becomes a receipt. Press Ctrl+C to finalize the chain.
| Agent | Integration | Setup |
|---|---|---|
| OpenClaw | Native plugin (lifecycle hooks) | openclaw plugins install openclaw-plugin-receipt |
| Claude Code | Hooks (PostToolUse, SessionStart, Stop) | npx receipt init --claude-code |
| Cursor | File watcher | npx receipt init --cursor |
| Custom agents | SDK wrapper (10 lines) | npm install agenticproof |
A team of 3 people running 2-3 agents each = 9 agents, all producing receipt chains. RECEIPT tells you which ones earned their keep and which ones burned tokens for nothing. Cost-per-useful-output across your entire agent fleet.
import { ReceiptAgent, verifyChain } from 'agenticproof';
const researcher = ReceiptAgent.create('researcher');
researcher.readFile('config.json', fileContents);
researcher.callApi('https://api.example.com', apiResponse);
researcher.callLlm('analyze this codebase', llmOutput);
researcher.decide('analysis reasoning', 'proceed with deployment');
researcher.produceOutput('research report', reportJson);
const builder = ReceiptAgent.continueFrom(researcher.getReceipts());
const results = verifyChain(researcher.getReceipts(), researcher.getPublicKey());
const allValid = results.every(r => r.valid); // true# Clone and install
git clone https://github.com/MorkeethHQ/receipt.git
cd receipt
npm install
# Run SDK tests (47 passing)
cd packages/receipt-sdk && npm install && npm test
# Run the demo app locally
cd demo/app && npm install && npm run dev
# Open http://localhost:3000Or use the SDK directly in your own project:
npm install agenticproofSee AGENT.md for a full setup guide after installing the SDK.
# Wrap OpenClaw with receipts
npx tsx packages/receipt-sdk/examples/wrap-openclaw.ts
# Two-machine handoff via Gensyn AXL
npx tsx packages/receipt-sdk/examples/two-machine-handoff.ts
# Basic agent wrapping
npx tsx packages/receipt-sdk/examples/wrap-agent.tsPRIVATE_KEY=wallet_private_key
OG_CONTRACT_ADDRESS=0x73B9A7768679B154D7E1eC5F2570a622A3b49651
AGENT_NFT_ADDRESS=0xf964d45c3Ea5368918B1FDD49551E373028108c9
VALIDATION_REGISTRY_ADDRESS=0x2E32E845928A92DB193B59676C16D52923Fa01dd
OG_COMPUTE_PROVIDER=0xd9966e13a6026Fcca4b13E7ff95c94DE268C471C
AXL_BASE_URL=http://127.0.0.1:9002 # optional, for live AXL
cd packages/receipt-sdk && npm testCovers: agent creation, all 6 action types (including usefulness_review), hash chain integrity, ed25519 signature verification, tamper detection, continueFrom handoffs, verifyChain pass/fail, computeRootHash, training data conversion, AXL handoff payloads, serialization, and attestation metadata.
- Claude Code (Anthropic): Implementation, code generation, debugging, and iteration
- Architecture design: the receipt chain mechanic, hash-linking strategy, and multi-agent handoff protocol
- Product decisions: what to build, what to skip, scope management
- Integration strategy: 0G full-stack integration, Gensyn AXL for P2P transport
- Demo direction: adversarial mode, execution replay, cost-per-useful-output metric, human review as receipt #11
- Deployment and operations: contract deployment, Vercel configuration, environment setup
- TypeScript, Next.js 15, ed25519 (@noble/ed25519), SHA-256 (@noble/hashes)
- Solidity (ReceiptAnchorV2.sol, AgentNFT.sol)
- 0G SDK (@0gfoundation/0g-ts-sdk v1.2.6, @0glabs/0g-serving-broker)
- Gensyn AXL (AxlTransport SDK, A2A protocol, MCP tool calls)
MIT
