Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
peaq-did-resolver
Advanced tools
This package provides methods to resolve a Decentralized Identifier (DID) from the peaq
blockchain.
It supports the proposed Decentralized Identifiers spec from the W3C Credentials Community Group.
It requires the DID Resolver library, which is the primary interface for resolving DIDs.
TBD
A minimal DID Document might contain the following information:
{
"@context": [
"https://www.w3.org/ns/did/v1"
],
"id": "did:peaq:5E1WsjiPHvPW5LdhL4h53TTc58YLGDpLeLi6jW8E6ypLeRtB",
"controller": "did:peaq:5E1WsjiPHvPW5LdhL4h53TTc58YLGDpLeLi6jW8E6ypLeRtB",
"authentication": [
"did:peaq:5E1WsjiPHvPW5LdhL4h53TTc58YLGDpLeLi6jW8E6ypLeRtB#keys-1"
],
"verificationMethod": [
{
"id": "did:peaq:5E1WsjiPHvPW5LdhL4h53TTc58YLGDpLeLi6jW8E6ypLeRtB#keys-1",
"type": "Ed25519VerificationKey2020",
"controller": "did:peaq:5E1WsjiPHvPW5LdhL4h53TTc58YLGDpLeLi6jW8E6ypLeRtB",
"publicKeyMultibase": "z6Mkke5f4w4df5vLnW92jbxYy4Z3cayFD9XuegRS1TCnAB3x"
}
],
"service": []
}
The resolver presents a simple resolver()
function that returns a ES6 Promise returning the DID document.
import { Resolver } from 'did-resolver'
import { getResolver } from 'peaq-did-resolver'
// getResolver() accepts a DID Resolver server url
const peaqResolver = getResolver("wss://wsspc1-qa.agung.peaq.network")
const didResolver = new Resolver({
...peaqResolver
//...you can flatten multiple resolver methods into the Resolver
})
didResolver.resolve("did:peaq:5E1WsjiPHvPW5LdhL4h53TTc58YLGDpLeLi6jW8E6ypLeRtB").then(doc => console.log(doc))
// You can also use ES7 async/await syntax
;(async () => {
const doc = await didResolver.resolve("did:peaq:5E1WsjiPHvPW5LdhL4h53TTc58YLGDpLeLi6jW8E6ypLeRtB")
console.log(doc)
})();
FAQs
Resolve DID documents for the peaq network
We found that peaq-did-resolver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.