🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

pkh-did-resolver

Package Overview
Dependencies
Maintainers
10
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pkh-did-resolver

did:pkh method resolver

2.0.0
latest
Source
npm
Version published
Weekly downloads
2.8K
56.61%
Maintainers
10
Weekly downloads
 
Created
Source

PKH DID Method Resolver

MIT license npm npm

This package contains did:pkh method resolver implementation. Please refer to the specification for details about how this DID method works.

Usage

This package is used as a plugin to the did-resolver library, which is the primary interface for resolving DIDs.

Installation

$ npm install pkh-did-resolver

Resolving a PKH DID

import { Resolver } from 'did-resolver'
import { getResolver } from 'pkh-did-resolver'

const pkhResolver = getResolver()
const resolver = new Resolver(pkhResolver)

const didResolutionResult = await resolver.resolve('did:pkh:eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb')

Result:

{
  "didDocument": {
    "assertionMethod": [
      "did:pkh:eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb#blockchainAccountId",
    ],
    "authentication": [
      "did:pkh:eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb#blockchainAccountId",
    ],
    "id": "did:pkh:eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
    "verificationMethod": [{
      "blockchainAccountId": "eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
      "controller": "did:pkh:eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
      "id": "did:pkh:eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb#blockchainAccountId",
      "type": "EcdsaSecp256k1RecoveryMethod2020",
    }],
  },
  "didDocumentMetadata": {},
  "didResolutionMetadata": {
    "contentType": "application/did+json",
  },
}

Additional Usage Notes

See the dids developer site for more details about how to use this package.

Contributing

We are happy to accept small and large contributions

License

Apache-2.0 OR MIT

Keywords

ceramic

FAQs

Package last updated on 04 Jan 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts