{"id":32951314,"url":"https://github.com/hashgraph/did-sdk-js","last_synced_at":"2026-05-24T13:30:51.854Z","repository":{"id":37963654,"uuid":"378975431","full_name":"hashgraph/did-sdk-js","owner":"hashgraph","description":"Javascript SDK for managing DID Documents \u0026 Verifiable Credentials","archived":false,"fork":false,"pushed_at":"2026-03-06T16:42:10.000Z","size":191,"stargazers_count":41,"open_issues_count":32,"forks_count":21,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-04-06T18:08:01.538Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashgraph.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-06-21T15:19:40.000Z","updated_at":"2026-01-05T23:15:19.000Z","dependencies_parsed_at":"2024-08-16T03:22:10.620Z","dependency_job_id":"fc55b4fd-6bc9-4647-b5f2-397a261ad86f","html_url":"https://github.com/hashgraph/did-sdk-js","commit_stats":{"total_commits":7,"total_committers":4,"mean_commits":1.75,"dds":0.4285714285714286,"last_synced_commit":"21ef7af0171e1eecccb1db2b68fcdb2e956e501d"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hashgraph/did-sdk-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashgraph%2Fdid-sdk-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashgraph%2Fdid-sdk-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashgraph%2Fdid-sdk-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashgraph%2Fdid-sdk-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashgraph","download_url":"https://codeload.github.com/hashgraph/did-sdk-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashgraph%2Fdid-sdk-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33436554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-24T13:13:05.286Z","status":"ssl_error","status_checked_at":"2026-05-24T13:13:03.728Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["hacktoberfest"],"created_at":"2025-11-12T21:00:33.814Z","updated_at":"2026-05-24T13:30:51.849Z","avatar_url":"https://github.com/hashgraph.png","language":"TypeScript","funding_links":[],"categories":["**Open Source Developer Assets**"],"sub_categories":["**Software Development Kits (SDKs)**"],"readme":"# did-sdk-js\nSupport for the Hedera Hashgraph DID Method and Verifiable Credentials on the Hedera JavaScript/TypeScript SDK.\n\nThis repository contains the Javascript SDK for managing [DID Documents][did-core] \u0026 [Verifiable Credentials][vc-data-model] registry using the Hedera Consensus Service.\n\ndid-sdk-js based on [did-sdk-java](https://github.com/hashgraph/did-sdk-java), so both of them contain similar methods and classes.\n\n## Overview\n\nIdentity networks are set of artifacts on Hedera Consensus Service that allow applications to share common channels to publish and resolve DID documents, issue verifiable credentials and control their validity status. These artifacts include:\n\n- address book - a file on Hedera File Service that provides information about HCS topics and appnet servers,\n- DID topic - an HCS topic intended for publishing DID documents,\n- and VC topic - an HCS topic playing a role of verifiable credentials registry.\n\nThis SDK is designed to simplify :\n\n- creation of identity networks within appnets, that is: creation and initialization of the artifacts mentioned above,\n- generation of decentralized identifiers for [Hedera DID Method][did-method-spec] and creation of their basic DID documents,\n- creation (publishing), update, deletion and resolution of DID documents in appnet identity networks,\n- issuance, revocation and status verification of [Verifiable Credentials][vc-data-model].\n\nThe SDK does not impose any particular way of how the DID or verifiable credential documents are constructed. Each appnet creators can choose their best way of creating those documents and as long as these are valid JSON-LD files adhering to W3C standards, they will be handled by the SDK.\n\n## Usage\n```\nnpm install --save @hashgraph/did-sdk-js\n```\n\n## Example:\n\n### Identity Network\n```\nconst client = ... // Client\n\nconst identityNetwork = new HcsIdentityNetworkBuilder()\n  .setNetwork(\"testnet\")\n  .setAppnetName(\"MyIdentityAppnet\")\n  .addAppnetDidServer(\"https://appnet-did-server-url:port/path-to-did-api\")\n  .setPublicKey(publicKey)\n  .setMaxTransactionFee(new Hbar(2))\n  .setDidTopicMemo(\"MyIdentityAppnet DID topic\")\n  .setVCTopicMemo(\"MyIdentityAppnet VC topic\")\n  .execute(client);\n```\n\n### DID Generation\nFrom already instantiated network:\n```\nconst identityNetwork = ...; //HcsIdentityNetwork\n// From a given DID root key:\nconst didRootKey = ...; //PrivateKey\nconst hcsDid = identityNetwork.generateDid(didRootKey.publicKey, false);\n```\nor:\n```\n// Without having a DID root key - it will be generated automatically:\n// Here we decided to add DID topic ID parameter `tid` to the DID.\nconst hcsDidWithDidRootKey = identityNetwork.generateDid(true);\nconst didRootKeyPrivateKey = hcsDidWithDidRootKey.getPrivateDidRootKey().get();\n```\nor by directly constructing HcsDid object:\n```\nconst didRootKey = HcsDid.generateDidRootKey();\nconst addressBookFileId = FileId.fromString(\"\u003chedera.address-book-file.id\u003e\");\n\nconst hcsDid = new HcsDid(HederaNetwork.TESTNET, didRootKey.publicKey, addressBookFileId);\n```\nExisting Hedera DID strings can be parsed into HcsDid object by calling fromString method:\n```\nconst didString = \"did:hedera:testnet:7c38oC4ytrYDGCqsaZ1AXt7ZPQ8etzfwaxoKjfJNzfoc;hedera:testnet:fid=0.0.1\";\nconst did = HcsDid.fromString(didString);\n```\n\n### Transaction\n```\nconst client = ...; //Client\nconst identityNetwork = ...; //HcsIdentityNetwork\n\nconst didRootKey = ...; //PrivateKey\nconst hcsDid = ...; //HcsDid\n\nconst didDocument = hcsDid.generateDidDocument().toJson();\n\n// Build and execute transaction\nawait identityNetwork.createDidTransaction(DidMethodOperation.CREATE)\n  // Provide DID document as JSON string\n  .setDidDocument(didDocument)\n  // Sign it with DID root key\n  .signMessage(doc =\u003e didRootKey.sign(doc))\n  // Configure ConsensusMessageSubmitTransaction, build it and sign if required by DID topic\n  .buildAndSignTransaction(tx =\u003e tx.setMaxTransactionFee(new Hbar(2)))\n  // Define callback function when consensus was reached and DID document came back from mirror node\n  .onMessageConfirmed(msg =\u003e {\n    //DID document published!\n  })\n  // Execute transaction\n  .execute(client);\n```\n\n[did-method-spec]: https://github.com/hashgraph/did-method\n[did-core]: https://www.w3.org/TR/did-core/\n[vc-data-model]: https://www.w3.org/TR/vc-data-model/\n\n## Development\n```\ngit clone git@github.com:hashgraph/did-sdk-js.git\n```\n\nFirst you need install dependencies and build project\n```\nnpm install\n```\nRun build in dev mode (with sourcemap generation and following changes)\n```\nnpm run build:dev\n```\n\n## Tests\nFor run tests you need to create and fill ```test/variables.js``` file before. There is ```test/variables.js.sample``` file as example.\n\nUpdate the following environment variables with your `testnet` account details\n\n* OPERATOR_ID=0.0.xxxx\n* OPERATOR_KEY=302...\n\nYou may also edit the following to use a different network (ensure your OPERATOR_ID and OPERATOR_KEY are valid)\n\n* NETWORK=testnet (can be `testnet`, `previewnet` or `mainnet`)\n* MIRROR_PROVIDER=hedera (can be `hedera` or `kabuto` (note `kabuto` not available on `previewnet`))\n\nRun tests\n```\nnpm run test\n```\n\n## References\n- \u003chttps://github.com/hashgraph/did-method\u003e\n- \u003chttps://github.com/hashgraph/hedera-sdk-js\u003e\n- \u003chttps://docs.hedera.com/hedera-api/\u003e\n- \u003chttps://www.hedera.com/\u003e\n- \u003chttps://www.w3.org/TR/did-core/\u003e\n- \u003chttps://www.w3.org/TR/vc-data-model/\u003e\n\n## License Information\n\nLicensed under _license placeholder_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashgraph%2Fdid-sdk-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashgraph%2Fdid-sdk-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashgraph%2Fdid-sdk-js/lists"}