{"id":27950998,"url":"https://github.com/block-core/nostr-did-resolver","last_synced_at":"2025-08-04T11:34:04.549Z","repository":{"id":286362460,"uuid":"961154254","full_name":"block-core/nostr-did-resolver","owner":"block-core","description":"JavaScript Library for resolving DID Documents for Nostr identities","archived":false,"fork":false,"pushed_at":"2025-04-25T15:25:52.000Z","size":350,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-27T17:26:40.201Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/block-core.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-05T21:47:24.000Z","updated_at":"2025-04-25T15:25:56.000Z","dependencies_parsed_at":"2025-05-07T16:16:39.535Z","dependency_job_id":"1fc1e1d2-dcd3-4381-a31b-95f0c3e3b876","html_url":"https://github.com/block-core/nostr-did-resolver","commit_stats":null,"previous_names":["block-core/nostr-did-resolver"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/block-core/nostr-did-resolver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fnostr-did-resolver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fnostr-did-resolver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fnostr-did-resolver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fnostr-did-resolver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/block-core","download_url":"https://codeload.github.com/block-core/nostr-did-resolver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block-core%2Fnostr-did-resolver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268689356,"owners_count":24291075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-07T16:16:33.582Z","updated_at":"2025-08-04T11:34:04.512Z","avatar_url":"https://github.com/block-core.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nostr DID Resolver (JS)\n\nLibrary that helps resolve DID Documents (decentralized identities) from the \"did:nostr\" DID Method.\n\nSpecification: https://nostrcg.github.io/did-nostr/\n\n## Description\n\nThis library is a JavaScript implementation of the Nostr DID Resolver. It allows you to resolve DIDs (Decentralized Identifiers) using the Nostr protocol. The resolver constructs the DID document from the events retrieived specified relays (and user's relay list) and returns it in a standard format.\n\nThe relays provided (or default) will only be used to retrieve the relay list (kind:10002),\nupon retrieving the relay list, the resolver will use the relays from the list to retrieve the profile metadata (kind:0).\n\nIf the profile metadata is not found on the user's relays, it will fall back to the provided (or default) relays for another attempt at finding the user profile.\n\nThis ensures that Nostr can scale better and the initial bootstrapping is only to discover \nthe relay list (kind:10002).\n\n## Usage\n\n```sh\nnpm install did-resolver @blockcore/nostr-did-resolver\n```\n\n```ts\nimport is from '@blockcore/nostr-did-resolver';\nimport { Resolver } from 'did-resolver';\n\n// These are the default relays if none is provided.\nconst relays = ['wss://relay.damus.io', 'wss://relay.primal.net', 'wss://nos.lol'];\n\nconst resolver = new Resolver(is.getResolver(relays));\nconst didResolution = await resolver.resolve('did:nostr:124c0fa99407182ece5a24fad9b7f6674902fc422843d3128d38a0afbee0fdd2');\n```\n\n## Example\n\nHere is example of the output from the resolve function:\n\n```json\n{\n{\n  \"didDocument\": {\n    \"@context\": [\n      \"https://www.w3.org/ns/did/v1\",\n      \"https://w3id.org/nostr/context\"\n    ],\n    \"id\": \"did:nostr:17e2889fba01021d048a13fd0ba108ad31c38326295460c21e69c43fa8fbe515\",\n    \"verificationMethod\": [\n      {\n        \"@context\": \"https://www.w3.org/ns/cid/v1\",\n        \"id\": \"did:nostr:17e2889fba01021d048a13fd0ba108ad31c38326295460c21e69c43fa8fbe515#0\",\n        \"type\": \"Multikey\",\n        \"controller\": \"did:nostr:17e2889fba01021d048a13fd0ba108ad31c38326295460c21e69c43fa8fbe515\",\n        \"publicKeyMultibase\": \"z6DtPPzVD8nXDKTHG3x8cx8UpoVP6VSBsXaDhSWcoysUnkEY\"\n      }\n    ],\n    \"authentication\": [\n      \"did:nostr:17e2889fba01021d048a13fd0ba108ad31c38326295460c21e69c43fa8fbe515#0\"\n    ],\n    \"assertionMethod\": [\n      \"did:nostr:17e2889fba01021d048a13fd0ba108ad31c38326295460c21e69c43fa8fbe515#0\"\n    ],\n    \"capabilityDelegation\": [\n      \"did:nostr:17e2889fba01021d048a13fd0ba108ad31c38326295460c21e69c43fa8fbe515#0\"\n    ],\n    \"capabilityInvocation\": [\n      \"did:nostr:17e2889fba01021d048a13fd0ba108ad31c38326295460c21e69c43fa8fbe515#0\"\n    ],\n    \"service\": [\n      {\n        \"id\": \"did:nostr:17e2889fba01021d048a13fd0ba108ad31c38326295460c21e69c43fa8fbe515#linked-domain\",\n        \"type\": \"LinkedDomains\",\n        \"serviceEndpoint\": \"https://sondreb.com\"\n      },\n      {\n        \"id\": \"did:nostr:17e2889fba01021d048a13fd0ba108ad31c38326295460c21e69c43fa8fbe515#1\",\n        \"type\": \"Relay\",\n        \"serviceEndpoint\": \"wss://relay.damus.io\"\n      },\n      {\n        \"id\": \"did:nostr:17e2889fba01021d048a13fd0ba108ad31c38326295460c21e69c43fa8fbe515#2\",\n        \"type\": \"Relay\",\n        \"serviceEndpoint\": \"wss://relay.primal.net\"\n      },\n      {\n        \"id\": \"did:nostr:17e2889fba01021d048a13fd0ba108ad31c38326295460c21e69c43fa8fbe515#3\",\n        \"type\": \"Relay\",\n        \"serviceEndpoint\": \"wss://purplepag.es\"\n      },\n      {\n        \"id\": \"did:nostr:17e2889fba01021d048a13fd0ba108ad31c38326295460c21e69c43fa8fbe515#4\",\n        \"type\": \"Relay\",\n        \"serviceEndpoint\": \"wss://nos.lol\"\n      }\n    ]\n  },\n  \"didResolutionMetadata\": {\n    \"contentType\": \"application/did+ld+json\",\n    \"retrieved\": \"2025-04-06T12:14:21.770Z\"\n  },\n  \"didDocumentMetadata\": {\n    \"created\": 1732224363,\n    \"updated\": 1732224363,\n    \"deactivated\": false,\n    \"profile\": {\n      \"about\": \"Developer of Blockcore Notes and Blockcore Wallet (Nostr browser extension).\\nVoluntaryism. Decentralize everything.\",\n      \"banner\": \"https://nostr.build/i/nostr.build_74ee63e85287e5b3351d757724e57d53d17b9f029bfad7d77dcb913b325727bb.png\",\n      \"display_name\": \"SondreB\",\n      \"lud16\": \"sondreb@npub.cash\",\n      \"name\": \"sondreb\",\n      \"nip05\": \"_@sondreb.com\",\n      \"picture\": \"https://m.primal.net/OJWl.jpg\",\n      \"website\": \"https://sondreb.com\",\n      \"displayName\": \"SondreB\",\n      \"pubkey\": \"17e2889fba01021d048a13fd0ba108ad31c38326295460c21e69c43fa8fbe515\",\n      \"npub\": \"npub1zl3g38a6qypp6py2z07shggg45cu8qex992xpss7d8zrl28mu52s4cjajh\",\n      \"created_at\": 1732224363\n    }\n  }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblock-core%2Fnostr-did-resolver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblock-core%2Fnostr-did-resolver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblock-core%2Fnostr-did-resolver/lists"}