{"_id":"@0xkobold/pi-erc8004","_rev":"2-18d2370e3b940daebdfb4c0c10cab422","name":"@0xkobold/pi-erc8004","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@0xkobold/pi-erc8004","version":"0.1.0","keywords":["pi-package","erc-8004","agent","identity","reputation","ethereum","base","agents","discovery"],"author":{"name":"0xKobold"},"license":"MIT","_id":"@0xkobold/pi-erc8004@0.1.0","maintainers":[{"name":"moikapy","email":"warrenckhan@gmail.com"}],"homepage":"https://github.com/0xKobold/pi-erc8004#readme","bugs":{"url":"https://github.com/0xKobold/pi-erc8004/issues"},"pi":{"image":"https://8004.org/logo.svg","extensions":["./dist/index.js"]},"dist":{"shasum":"459b5d28cf4ef7990a1cbccefe7f3059a4a6c544","tarball":"https://registry.npmjs.org/@0xkobold/pi-erc8004/-/pi-erc8004-0.1.0.tgz","fileCount":8,"integrity":"sha512-6keaXWDQCUkin691LzVjGPuCBraUKZ85iTpYPpiiYnHjM7MeJM1InnbtF7TBs1tlhpYlME2zyPeiiaAZHYj5Ig==","signatures":[{"sig":"MEUCIF7JVpiqST8t1smarGKiMNek5ljek6/lJLpJFAS7EiTgAiEArgn1bwdPdgrQUrLevMcr51X5WoaoPBWJ0R04UolIyis=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":82612},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"21c27fa114e570df80642ff37f43d32f14ce2848","scripts":{"dev":"tsc --watch","lint":"echo 'No linter configured'","test":"bun test","build":"tsc","prepublishOnly":"npm run build && npm test"},"_npmUser":{"name":"moikapy","email":"warrenckhan@gmail.com"},"repository":{"url":"git+https://github.com/0xKobold/pi-erc8004.git","type":"git","directory":"packages/pi-erc8004"},"_npmVersion":"11.6.2","description":"ERC-8004 Protocol for pi-coding-agent. Agent identity, reputation, and discovery on Base L2","directories":{},"_nodeVersion":"25.1.0","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","typescript":"^5.0.0","@types/node":"^20.0.0"},"peerDependencies":{"@sinclair/typebox":"^0.32.0","@mariozechner/pi-coding-agent":">=0.6.0"},"_npmOperationalInternal":{"tmp":"tmp/pi-erc8004_0.1.0_1773339048294_0.36917842863320494","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@0xkobold/pi-erc8004","version":"0.1.1","description":"ERC-8004 Protocol for pi-coding-agent. Agent identity, reputation, and discovery on Base L2","keywords":["pi-package","erc-8004","agent","identity","reputation","ethereum","base","agents","discovery"],"author":{"name":"0xKobold"},"license":"MIT","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc","dev":"tsc --watch","test":"bun test","lint":"echo 'No linter configured'","prepublishOnly":"npm run build && npm test"},"pi":{"extensions":["./src/index.ts"],"image":"https://8004.org/logo.svg"},"dependencies":{},"peerDependencies":{"@mariozechner/pi-coding-agent":">=0.6.0","@sinclair/typebox":"^0.32.0"},"devDependencies":{"@types/bun":"latest","@types/node":"^20.0.0","typescript":"^5.0.0"},"repository":{"type":"git","url":"git+https://github.com/0xKobold/pi-erc8004.git","directory":"packages/pi-erc8004"},"bugs":{"url":"https://github.com/0xKobold/pi-erc8004/issues"},"homepage":"https://github.com/0xKobold/pi-erc8004#readme","gitHead":"059e41c5634947dd39e52c4d0935a41bf1debdc2","_id":"@0xkobold/pi-erc8004@0.1.1","_nodeVersion":"25.1.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-8jnFDvZ/CO8lUy9MK1F4sLWomVN8E1z8vfRHBNO23SRp2sJj+hOm5KOxb9VEc3ksFN51HlQtCAGm9hj5nE+yMg==","shasum":"26cb2e9b1bee9ea4ca8c5286558bed2314383fe7","tarball":"https://registry.npmjs.org/@0xkobold/pi-erc8004/-/pi-erc8004-0.1.1.tgz","fileCount":8,"unpackedSize":82623,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDatXfZ5IGyOCmDQiMfD8MgQwXgsl0lzBUDyvJg4BmR5gIhAIdHifpay93NmlDpskX9fwF/JG3kJErCX+58EPuoe1dB"}]},"_npmUser":{"name":"moikapy","email":"warrenckhan@gmail.com"},"directories":{},"maintainers":[{"name":"moikapy","email":"warrenckhan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-erc8004_0.1.1_1773340953058_0.3462531897186736"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-12T18:10:48.102Z","modified":"2026-03-12T18:42:33.379Z","0.1.0":"2026-03-12T18:10:48.450Z","0.1.1":"2026-03-12T18:42:33.245Z"},"bugs":{"url":"https://github.com/0xKobold/pi-erc8004/issues"},"author":{"name":"0xKobold"},"license":"MIT","homepage":"https://github.com/0xKobold/pi-erc8004#readme","keywords":["pi-package","erc-8004","agent","identity","reputation","ethereum","base","agents","discovery"],"repository":{"type":"git","url":"git+https://github.com/0xKobold/pi-erc8004.git","directory":"packages/pi-erc8004"},"description":"ERC-8004 Protocol for pi-coding-agent. Agent identity, reputation, and discovery on Base L2","maintainers":[{"name":"moikapy","email":"warrenckhan@gmail.com"}],"readme":"# Pi ERC-8004 Extension\n\nERC-8004 Protocol for [pi-coding-agent](https://github.com/badlogic/pi-mono). Agent identity, reputation, and discovery on Base L2.\n\n## Installation\n\n```bash\n# Via pi CLI\npi install npm:@0xkobold/pi-erc8004\n\n# Or in pi-config.ts\n{\n  extensions: [\n    'npm:@0xkobold/pi-erc8004'\n  ]\n}\n```\n\n## Features\n\n- 🔗 **Agent Identity** - Register with wallet address and capabilities\n- 📊 **Reputation** - Submit and query attestation scores (0-100)\n- 🔍 **Discovery** - Find agents by capability\n- ⛓️ **On-chain Ready** - Real deployed contracts (Phase 2 coming)\n- 🪙 **Integrated** - Works with `@0xkobold/pi-wallet`\n\n## Quick Start\n\n```bash\n# Register identity\n/erc8004 register specialist --capabilities typescript,react,node\n\n# Check status\n/erc8004 status\n\n# Submit attestation for worker\n/erc8004 attest --worker 0x742d35... --rating 95 --task-id abc123 --comment \"Great work\"\n\n# Discover agents\n/erc8004 discover --capability typescript\n\n# Check reputation\n/erc8004 reputation\n/erc8004 reputation --worker 0x742d35...\n```\n\n## Contracts\n\n| Network | IdentityRegistry | ReputationRegistry | Chain ID |\n|---------|-----------------|-------------------|----------|\n| Base Mainnet | `0x8004A169...` | `0x8004BAa1...` | 8453 |\n| Base Sepolia | `0x8004A818...` | `0x8004B663...` | 84532 |\n\n**Full addresses:**\n- IdentityRegistry Mainnet: `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432`\n- ReputationRegistry Mainnet: `0x8004BAa17C55a88189AE136b182e5fdA19dE9b63`\n- IdentityRegistry Sepolia: `0x8004A818BFB912233c491871b3d84c89A494BD9e`\n- ReputationRegistry Sepolia: `0x8004B663056A597Dffe9eCcC1965A193B7388713`\n\n## Commands\n\n| Command | Description |\n|---------|-------------|\n| `/erc8004 register TYPE` | Register identity with capabilities |\n| `/erc8004 status` | Show identity and reputation |\n| `/erc8004 attest --worker ADDR --rating N` | Submit attestation |\n| `/erc8004 discover --capability CAP` | Find agents |\n| `/erc8004 reputation [--worker ADDR]` | Check reputation |\n\n## Tools\n\n### `erc8004_register`\n```typescript\n{\n  agentType: \"specialist\",\n  capabilities?: [\"typescript\", \"react\"]\n}\n```\n\n### `erc8004_attest`\n```typescript\n{\n  worker: \"0x742d35...\",\n  score: 95,\n  taskId?: \"task-123\"\n}\n```\n\n### `erc8004_discover`\n```typescript\n{\n  capability: \"typescript\"\n}\n```\n\n### `erc8004_reputation`\n```typescript\n{\n  worker?: \"0x742d35...\"  // Omit for self\n}\n```\n\n## Reputation System\n\n### Tiers\n| Tier | Score | Description |\n|------|-------|-------------|\n| Bronze | 0-39 | New agent |\n| Silver | 40-69 | Active agent |\n| Gold | 70-89 | Trusted agent |\n| Platinum | 90+ | Elite agent |\n\n### Calculation\n- Attestations given: +5 points each\n- Base score: 10\n- Max: 100\n\n### Example\n```typescript\n// Given 7 attestations\nconst score = Math.min(100, 7 * 5 + 10) // 45\nconst tier = \"silver\"\n```\n\n## Integration with Wallet\n\n```bash\n# 1. Create wallet\n/wallet-create --email me@example.com\n\n# 2. Register identity (auto-links wallet)\n/erc8004 register specialist --capabilities coding\n\n# 3. Attest and pay\n/erc8004 attest --worker 0x... --rating 95 --task-id abc\n/wallet-x402 --url https://api.service.com/task/abc/pay\n```\n\n## Configuration\n\nConfig stored at `~/.0xkobold/erc8004/`:\n\n### `~/.0xkobold/erc8004/agent.json`\n```json\n{\n  \"address\": \"0x742d35...\",\n  \"metadataHash\": \"0x...\",\n  \"publicKey\": \"0x\",\n  \"capabilities\": [\"typescript\", \"react\"],\n  \"registeredAt\": 1710334800000,\n  \"chain\": \"sepolia\",\n  \"active\": true\n}\n```\n\n### `~/.0xkobold/erc8004/reputation.json`\n```json\n{\n  \"localScore\": 45,\n  \"attestations\": [{\n    \"worker\": \"0x742d35...\",\n    \"score\": 95,\n    \"taskId\": \"task-123\",\n    \"timestamp\": 1710334800000,\n    \"comment\": \"Excellent work\"\n  }]\n}\n```\n\n## Phase 2: On-chain\n\nPhase 2 will add:\n- Identity registration on-chain via ethers.js\n- Attestations written to ReputationRegistry\n- IPFS metadata storage\n- Cross-platform discovery\n\n**Prerequisites:**\n- Funded wallet (use `@0xkobold/pi-wallet`)\n- Sepolia ETH from faucet\n- Gas fees: ~0.0001 ETH\n\n## Local Development\n\n```bash\ngit clone https://github.com/0xKobold/pi-erc8004\ncd pi-erc8004\nnpm install\nnpm run build\npi install ./\n```\n\n## Testing\n\n```bash\n# Unit tests\nbun test test/unit/extensions/erc8004.test.ts\n\n# Integration tests with wallet\nbun test test/integration/wallet-erc8004.integration.test.ts\n```\n\n## References\n\n- **Protocol:** https://8004.org\n- **Contracts:** https://github.com/erc-8004/erc-8004-contracts\n- **Paper:** ERC-8004: Agent-Centric Trust Protocol\n- **Related:** `@0xkobold/pi-wallet` for payments\n\n## License\n\nMIT © 0xKobold\n","readmeFilename":"README.md"}