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

mndid

v0.0.6

Published

lifeID did encoder/decoder

Downloads

9

Readme

Multi-Network Decentralized Identifier

The lifeID platform uses pairwise decentralized identifiers ("DIDs") for people and organizations to identify themselves to one another. This repository is a suite of tools allowing anyone to create, encode, decode DIDs for any blockchain.

A lifeID DID looks like this:

"did:life:Lo3gVgN4WnXe6CnVn1zFSXGK4wL6eMJ7W1"

There are three parts to a lifeID did:

  1. The DID prefix did: This indicates that you are presenting a standardized DID according to the specification outlined by the World Wide Web Consortium ("W3C").

  2. The DID method. life: This signals to everyone that you are presenting a DID for use on the lifeID platform.

  3. The Base58 encoded DID string. Lo3gVgN4WnXe6CnVn1zFSXGK4wL6eMJ7W1 Base58 encoding is a way to store large integers as alphanumeric text, similar to Base64 but doesn't have the 0 O i or l because they might look ambiguous when printed or written down. MNDID library has functions to encode and decode base58 DIDs.

When decoded, a DID string includes the following parts:

  • The version number. Currently this is a single one byte version number it will start at 1 and can be updated in the future.

  • The network ID. This part of the DID describes which blockchain stores its public key. It is 4 bytes long.

  • The type of identity. What is the DID identifying? There are three possible values. 1 for an individual, 2 for any other kind of legal entity such as a corporation or non-profit organization, and 3 for a physical items or property.

  • The public key. Different blockchains use different encryption schemes, but they all require a cryptographic keys to prove ownership. It 65 bytes long.

  • The checksum. A SHA3-256 digest of the version number, network ID and public key. The checksum provides a way to quickly verify whether the DID is correct or has been changed in any way.

An example decoded DID:

didExample

API

This library provides the following functions for working with DIDs

createDID(didObject)

This function takes a valid DID object and returns an encoded DID wrapped in a promise

input: didObject

An object with the following fields. All are required.

  didObject: {
    method: string,
    network: string,
    version: string,
    key: string
    }

return value : Promise(did: string)

decodeDID(did)

This function takes a valid DID string and returns a DID object wrapped in a promise.

did

A string that is a validly formatted DID.

return value : Promise(didObject: object)

validateDID(did)

This function takes a valid DID string and returns a promise. The promise will resove to true if and only if the DID is correctly formed.

did

A string that is a validly formatted DID.

return value : Promise(boolean)

lifeidlogo