{"_id":"@aipagents/did-resolver","_rev":"3-4ae29a614bf5dd733f6357dc36973907","name":"@aipagents/did-resolver","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@aipagents/did-resolver","version":"0.1.0","keywords":["did","did-resolver","solana","aip","agent-identity","w3c"],"license":"MIT","_id":"@aipagents/did-resolver@0.1.0","maintainers":[{"name":"wilsonempty","email":"emptylabs0@gmail.com"}],"homepage":"https://github.com/dr-wilson-empty/aip-website/tree/main/packages/did-resolver","bugs":{"url":"https://github.com/dr-wilson-empty/aip-website/issues"},"dist":{"shasum":"9f15cab4002bf9858250add0bb272c9081b4e01b","tarball":"https://registry.npmjs.org/@aipagents/did-resolver/-/did-resolver-0.1.0.tgz","fileCount":27,"integrity":"sha512-aPNm378xvYNUIkovu4TL68XtuMBNvK5hGA3O461Kwf5XwVzJDznfoWXez2ZRYgZF8dhbu30TuuUZpb3TcsR6pg==","signatures":[{"sig":"MEUCIBOftQgoxa/54UmWFGfVkgZ+vFXQYxJ6BUDDorbjTwdfAiEAleP/QNYyyw0fBKJbYdtxdX9nTLIer2vMVU88XfQSd4U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":43496},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"1897f83d5b5062c7dfa7c394a0bbf7387a21e859","scripts":{"test":"node --import tsx --test test/*.test.ts","build":"tsc -p tsconfig.json","clean":"rm -rf dist"},"_npmUser":{"name":"wilsonempty","email":"emptylabs0@gmail.com"},"repository":{"url":"git+https://github.com/dr-wilson-empty/aip-website.git","type":"git","directory":"packages/did-resolver"},"_npmVersion":"11.11.1","description":"Reference resolver for the did:aip W3C DID method (Solana-anchored agent identity)","directories":{},"_nodeVersion":"25.8.2","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.95.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","typescript":"^5.4.0","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/did-resolver_0.1.0_1779232403113_0.1949871405166701","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aipagents/did-resolver","version":"0.1.1","keywords":["did","did-resolver","solana","aip","agent-identity","w3c"],"license":"MIT","_id":"@aipagents/did-resolver@0.1.1","maintainers":[{"name":"wilsonempty","email":"emptylabs0@gmail.com"}],"homepage":"https://github.com/dr-wilson-empty/aip-website/tree/main/packages/did-resolver","bugs":{"url":"https://github.com/dr-wilson-empty/aip-website/issues"},"dist":{"shasum":"620afa70a0e2df53b6843c814fc1c7a90c90069b","tarball":"https://registry.npmjs.org/@aipagents/did-resolver/-/did-resolver-0.1.1.tgz","fileCount":27,"integrity":"sha512-8Wq8uZBp3SZRT9Xs7tjXTYuFIFZrr6IGIKJJRSDN9e1rekbQvYMhVSdHvg7osP05ox2rAwWBpwnCC0YSISDY/g==","signatures":[{"sig":"MEUCIFyVkx51D9a4Y7F3+rxFULPRMJO9g4pttC/UJuvlyc05AiEAjeuZQCuetS2Wt7ietRQrAaSQZvcU/NnvId24JmTKPr0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":45754},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"ef145d1b0e81f01abcc637c131db1d46acff712b","scripts":{"test":"node --import tsx --test test/*.test.ts","build":"tsc -p tsconfig.json","clean":"rm -rf dist"},"_npmUser":{"name":"wilsonempty","email":"emptylabs0@gmail.com"},"repository":{"url":"git+https://github.com/dr-wilson-empty/aip-website.git","type":"git","directory":"packages/did-resolver"},"_npmVersion":"11.11.1","description":"Reference resolver for the did:aip W3C DID method (Solana-anchored agent identity)","directories":{},"_nodeVersion":"25.8.2","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.95.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.0","typescript":"^5.4.0","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/did-resolver_0.1.1_1779311702173_0.44227417860014695","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aipagents/did-resolver","version":"0.1.2","description":"Reference resolver for the did:aip W3C DID method (Solana-anchored agent identity)","license":"MIT","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc -p tsconfig.json","test":"node --import tsx --test test/*.test.ts","clean":"rm -rf dist"},"keywords":["did","did-resolver","solana","aip","agent-identity","w3c"],"homepage":"https://github.com/dr-wilson-empty/aip-website/tree/main/packages/did-resolver","repository":{"type":"git","url":"git+https://github.com/dr-wilson-empty/aip-website.git","directory":"packages/did-resolver"},"bugs":{"url":"https://github.com/dr-wilson-empty/aip-website/issues"},"dependencies":{"@solana/web3.js":"^1.95.0","bs58":"^5.0.0"},"devDependencies":{"@types/node":"^22.10.0","tsx":"^4.19.0","typescript":"^5.4.0"},"engines":{"node":">=18.0.0"},"publishConfig":{"access":"public"},"gitHead":"5689708a8f9eefba5ca57724adf0478e762b3ee3","_id":"@aipagents/did-resolver@0.1.2","_nodeVersion":"25.8.2","_npmVersion":"11.11.1","dist":{"integrity":"sha512-IKCKtyYQXYIDmEaklYyVeWEwzD4Hrh7RJexNJx60DX9zDubVmhkvgx2BJRJcs7PigRA99Glh/H5AeKIogmqlLA==","shasum":"092c757c2fce5b2679c0cff4af52aed1470de580","tarball":"https://registry.npmjs.org/@aipagents/did-resolver/-/did-resolver-0.1.2.tgz","fileCount":27,"unpackedSize":47389,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCCdPECPQOaLNIYZ4B8d4hWoSrIa9LiAILWUusAvWDkzgIhAPTxjMhYutGBwaLUy/hi8nLC3Bs7YNB8fB1+CLRkqJpR"}]},"_npmUser":{"name":"wilsonempty","email":"emptylabs0@gmail.com"},"directories":{},"maintainers":[{"name":"wilsonempty","email":"emptylabs0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/did-resolver_0.1.2_1780322618638_0.2547034147474292"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-19T23:13:22.955Z","modified":"2026-06-01T14:03:38.975Z","0.1.0":"2026-05-19T23:13:23.283Z","0.1.1":"2026-05-20T21:15:02.316Z","0.1.2":"2026-06-01T14:03:38.798Z"},"bugs":{"url":"https://github.com/dr-wilson-empty/aip-website/issues"},"license":"MIT","homepage":"https://github.com/dr-wilson-empty/aip-website/tree/main/packages/did-resolver","keywords":["did","did-resolver","solana","aip","agent-identity","w3c"],"repository":{"type":"git","url":"git+https://github.com/dr-wilson-empty/aip-website.git","directory":"packages/did-resolver"},"description":"Reference resolver for the did:aip W3C DID method (Solana-anchored agent identity)","maintainers":[{"name":"wilsonempty","email":"emptylabs0@gmail.com"}],"readme":"# @aipagents/did-resolver\n\nReference resolver for the `did:aip` W3C DID method. Resolves Solana\nanchored agent identifiers into DID Documents using only a public RPC\nendpoint, with no central registry or third party service required.\n\nEvery AIP agent has a deterministic DID derived from its owner's\nSolana public key and an `agent_id` string the owner chose at\nregistration. This package turns that DID into a fully populated W3C\nDID Document by reading the corresponding `AgentRecord` PDA directly\nfrom the Solana program that backs the registry.\n\n## Install\n\n```bash\nnpm install @aipagents/did-resolver\n```\n\nRequires Node 18 or later.\n\n## Quick start\n\n```ts\nimport { AipDidResolver } from \"@aipagents/did-resolver\";\n\nconst resolver = new AipDidResolver({\n  rpcEndpoint: \"https://api.devnet.solana.com\",\n  network: \"solana:devnet\",\n});\n\nconst result = await resolver.resolve(\n  \"did:aip:7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU:my-agent\",\n);\n\nif (result.didDocument) {\n  console.log(result.didDocument);\n} else {\n  console.log(\"resolution error:\", result.didResolutionMetadata);\n}\n```\n\n## What it does\n\nWhen you call `resolver.resolve(did)`, the package:\n\n1. Parses the `did:aip` identifier against the ABNF grammar defined\n   in section 3.2 of the method specification.\n2. Derives the `AgentRecord` Program Derived Address using\n   `find_program_address` with the seeds `[\"agent\", owner_pubkey,\n   agent_id]`.\n3. Fetches the account from a Solana RPC endpoint at the configured\n   commitment level.\n4. Decodes the Anchor discriminator prefixed Borsh layout into a\n   typed `AgentRecord`.\n5. Constructs a DID Document that conforms to W3C DID Core 1.0,\n   exposing the owner public key as the verification method, the\n   agent endpoint as a `service`, and the capability list as\n   `serviceEndpoint` metadata.\n\nThe resolver does not require any private credentials and does not\nwrite to chain. It is purely a read path.\n\n## API\n\n### `new AipDidResolver(options)`\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `rpcEndpoint` | `string` | required | Solana RPC URL to read account data from. |\n| `programId` | `string` | AIP registry on devnet | Override the program id when targeting a non default deployment. |\n| `network` | `\"solana:devnet\" \\| \"solana:mainnet\"` | `\"solana:devnet\"` | Network identifier embedded in the resulting DID Document. |\n| `commitment` | `\"processed\" \\| \"confirmed\" \\| \"finalized\"` | `\"confirmed\"` | Solana commitment level for account reads. |\n\n### `resolver.resolve(did)`\n\nPerforms the full resolution. Returns\n`{ didDocument, didResolutionMetadata, didDocumentMetadata, agentRecord }`.\nIf the account is missing, `didDocument` is `null` and the metadata\nexplains why (`invalidDid`, `notFound`, `internalError`).\n\n### `resolver.derivePda(did)`\n\nReturns the PDA address for a DID without an RPC call. Useful when\nyou need the on chain address (for example, to display a Solana\nExplorer link) but do not want to fetch the account.\n\n### `parseDid(did)` / `formatDid(owner, agentId)`\n\nPure string helpers for parsing and constructing canonical\n`did:aip:<owner-pubkey>:<agent-id>` identifiers without any network\nor chain access.\n\n## Default program\n\nThe resolver defaults to the AIP Agent Registry Program on Solana\nDevnet:\n\n```\nCgchXu2dRV3r9E1YjRhp4kbeLLtv1Xz61yoerJzp1Vbc\n```\n\nOverride the `programId` option to point at a different deployment\n(for example, a fork on a local test validator or a mainnet release).\n\n## Tests\n\n```bash\nnpm test\n```\n\nThe unit tests run offline. The optional Devnet integration test runs\nonly when a funded keypair is available at `~/.config/solana/id.json`\nor wherever `SOLANA_DEVNET_KEYPAIR` points. It registers a fresh\nagent, resolves it, asserts the DID Document is correctly formed, and\ncleans up.\n\n## Source and license\n\nBuilt and published from the\n[`dr-wilson-empty/aip-beta`](https://github.com/dr-wilson-empty/aip-beta)\nmonorepo alongside the CLI, backend, and Agent SDK.\n\nMIT License.\n\n## Links\n\n- Website: https://aipagents.xyz\n- CLI: [@aipagents/cli](https://www.npmjs.com/package/@aipagents/cli)\n- Agent SDK: [@aipagents/agent-sdk](https://www.npmjs.com/package/@aipagents/agent-sdk)\n- Source: https://github.com/dr-wilson-empty/aip-beta\n- DID method specification: https://github.com/w3c/did-extensions/pull/704\n- Twitter/X: [@aipagents](https://x.com/aipagents)\n","readmeFilename":"README.md"}