npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

did-document

v0.6.2

Published

Decentralized Identity (DID) Document

Downloads

25

Readme

did-document

Decentralized Identity (DID) Document

DID documents contain a set of data that describes a DID, including mechanisms, such as public keys and pseudonymous biometrics, that an entity can use to authenticate itself as the DID. A DID Document may also contain other attributes or claims describing the entity. These documents are graph-based data structures that are typically expressed using JSON-LD, but may be expressed using other compatible graph-based data formats.

Table of Contents

Status

This project is in active development.

Stability

Stability: 1 - Experimental. These features are still under active development and subject to non-backwards compatible changes, or even removal, in any future version. Use of the feature is not recommended in production environments. Experimental features are not subject to the Node.js Semantic Versioning model.

Installation

$ npm install arablocks/did-document

Usage

const { DIDDocument } = require('did-document')
const did = 'did:ara:701012c34fc3c883c4b61dfae06568483c5ae6c81020767ee536a9ba6300792b'

// create a new DID document
const ddo = new DIDDocument({ id: did })

// Add a publicKey to an existing DID document
ddo.addPublicKey({
  id: `${did}#owner`,
  publicKeyHex: "ec84465527bea0f8c54ce6c42c0d7549a7163336655a8bcaf731f07eb2997c73",
  publicKeyBase58: "GvGCfZpuJapzxoo3rgyaYR39XReFxaWpZZUvoaq1o8qg",
  publicKeyBase64: "OyERlUnvqD4xUzmxCwNdUmnFjM2ZVqLyvcx8H6ymXxz"
})

// Add an authentication mechanism
ddo.addAuthentication({
  publicKey: `${did}#owner`,
  type: "Ed25519SignatureAuthentication2018"
})

// Add a service endpoint to the DDO
ddo.addService({
  id: `${did}#arasite`,
  type: 'ara-site.Service',
  serviceEndpoint: 'http://www.ara.one',
  description: 'This is our project site'
})

API

doc = new DIDDocument(opts, context)

doc.context

The generic DID context to which the DID document refers to

doc.id

The Decentralized Identity to which the document belongs to

doc.publicKey

A lists public keys whose corresponding private keys are controlled by the entity identified by the DID identifier

doc.authentication

A list of mechanisms by which an entity can cryptographically prove that they are associated with a DID and DID Description

doc.service

Service endpoints represent any type of service that the DID entity wishes to advertise, including decentralized identity management services for further discovery, authentication, authorization, or interaction

doc.addPublicKey(publicKey)

Add a public key entity to the DID document

doc.addAuthentication(authentication)

Add an authentication mechanism to the did document

doc.addService(service)

Add a service endpoint to the did document

doc.toJSON()

Convert a DID document to JSON format

References