{"_id":"@dcp-ai/w3c-did","name":"@dcp-ai/w3c-did","dist-tags":{"latest":"2.0.0"},"versions":{"2.0.0":{"name":"@dcp-ai/w3c-did","version":"2.0.0","description":"DCP-AI bridge for W3C Decentralized Identifiers (DIDs) and Verifiable Credentials","type":"module","main":"index.js","exports":{".":"./index.js"},"keywords":["dcp","w3c","did","vc","verifiable-credentials","identity","ai","agent","protocol"],"license":"Apache-2.0","author":{"name":"DCP-AI Contributors"},"repository":{"type":"git","url":"git+https://github.com/dcp-ai-protocol/dcp-ai.git","directory":"integrations/w3c-did"},"homepage":"https://dcp-ai.org","bugs":{"url":"https://github.com/dcp-ai-protocol/dcp-ai/issues"},"publishConfig":{"access":"public"},"engines":{"node":">=18"},"_id":"@dcp-ai/w3c-did@2.0.0","gitHead":"9a46e96e7dff55eafea00f959e8e0dce35aaa779","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-+1SiGrP8tSJFgZVF+UAAfjC+QU3rbh44p9TiYtvPyOB/UjTNBLzZRxy/gtITA1yEk8nB95XE838UY17HolA62w==","shasum":"ca150e06d61d69c31f8e26e015cba19e06eedbcf","tarball":"https://registry.npmjs.org/@dcp-ai/w3c-did/-/w3c-did-2.0.0.tgz","fileCount":3,"unpackedSize":9282,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCdjLQVaMV4lVipWe6R8BdXM9IokYht3SHfERB/0ZbB2QIgVL64pmACpPeg6MCMnxdXk8IBGdvRjeGRThcb+3aQ09E="}]},"_npmUser":{"name":"dcp-ai-protocol","email":"citizen-protocol@protonmail.com"},"directories":{},"maintainers":[{"name":"dcp-ai-protocol","email":"citizen-protocol@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/w3c-did_2.0.0_1776500637327_0.4631609314887599"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-18T08:23:57.261Z","2.0.0":"2026-04-18T08:23:57.441Z","modified":"2026-04-18T08:23:57.608Z"},"maintainers":[{"name":"dcp-ai-protocol","email":"citizen-protocol@protonmail.com"}],"description":"DCP-AI bridge for W3C Decentralized Identifiers (DIDs) and Verifiable Credentials","homepage":"https://dcp-ai.org","keywords":["dcp","w3c","did","vc","verifiable-credentials","identity","ai","agent","protocol"],"repository":{"type":"git","url":"git+https://github.com/dcp-ai-protocol/dcp-ai.git","directory":"integrations/w3c-did"},"author":{"name":"DCP-AI Contributors"},"bugs":{"url":"https://github.com/dcp-ai-protocol/dcp-ai/issues"},"license":"Apache-2.0","readme":"# DCP-AI ↔ W3C DID/VC Bridge\n\nConverts between DCP artifacts and W3C Decentralized Identifiers (DIDs) and Verifiable Credentials (VCs).\n\n## Supported DCP Specifications\n\nDCP-01 through DCP-09.\n\n## Overview\n\nThis bridge enables interoperability between the DCP-AI identity layer and the W3C decentralized identity ecosystem. It supports bidirectional conversion of:\n\n- **Responsible Principal Records ↔ DID Documents** — map DCP human identities to `did:dcp:` method DIDs with verification methods derived from RPR keys.\n- **Agent Passports ↔ Verifiable Credentials** — represent DCP agent certifications as W3C VCs, including capabilities, liability mode, and jurisdiction.\n- **Signed Bundles → Verifiable Presentations** — wrap full DCP Citizenship Bundles as W3C VPs for presentation to external verifiers.\n\n## Functions\n\n| Function | Direction | Description |\n|---|---|---|\n| `rprToDIDDocument(rpr)` | DCP → W3C | Convert a Responsible Principal Record to a DID Document |\n| `didDocumentToRPR(didDoc)` | W3C → DCP | Convert a DID Document back to an RPR skeleton |\n| `passportToVC(passport, issuerDid)` | DCP → W3C | Convert an Agent Passport to a Verifiable Credential |\n| `vcToPassport(vc)` | W3C → DCP | Convert a Verifiable Credential back to a Passport skeleton |\n| `bundleToVP(signedBundle, holderDid)` | DCP → W3C | Wrap a signed bundle as a Verifiable Presentation |\n| `rightsToServiceEndpoints(rightsDeclaration)` | DCP → W3C | Convert rights declaration to DID service endpoints (DCP-08) |\n\n## DID Method\n\nThis bridge uses the `did:dcp:` method namespace. DID identifiers are derived directly from RPR human IDs:\n\n```\ndid:dcp:<human-id-uuid>\n```\n\nVerification methods support both Ed25519 (classical) and post-quantum key types.\n\n## Usage\n\n```javascript\nimport { rprToDIDDocument, passportToVC, bundleToVP } from './index.js';\n\n// Convert an RPR to a DID Document\nconst didDoc = rprToDIDDocument(myRpr);\n\n// Issue a Verifiable Credential for an agent\nconst vc = passportToVC(myPassport, 'did:dcp:issuer-id');\n\n// Wrap a full bundle as a Verifiable Presentation\nconst vp = bundleToVP(signedBundle, 'did:dcp:holder-id');\n```\n\n## Notes\n\n- Skeleton conversions (W3C → DCP) produce partial records that require additional processing (key ID recomputation, signing, etc.) before they are valid DCP artifacts.\n- The `publicKeyMultibase` encoding uses the `z` prefix (base64url) as specified in the DID Core specification.\n","readmeFilename":"README.md","_rev":"1-b95357794db375129b8405c09e2c0cbe"}