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-ipns/kit

v1.0.0

Published

The IPNS DID Kit is a JavaScript library designed to facilitate the creation, management, and utilization of decentralized identities (DIDs) based on IPNS (InterPlanetary Name System). This library enables users to create and maintain DIDs that are compat

Downloads

3

Readme

IPNS DID Kit

The IPNS DID Kit is a JavaScript library designed to facilitate the creation, management, and utilization of decentralized identities (DIDs) based on IPNS (InterPlanetary Name System). This library enables users to create and maintain DIDs that are compatible with IPFS (InterPlanetary File System) pinning platforms and supports DNSLink, enhancing web compatibility and DNS-based resolution.

Features

  • DID Creation and Management: Generate and manage DID documents with support for multiple cryptographic proof methods, including secp256k1.
  • Persistence on IPNS and IPFS: Persist DID documents on IPNS and IPFS to ensure decentralized and reliable storage.
  • Compatibility with DNSLink: Integrate with DNSLink to facilitate DNS-based resolution of DIDs, linking DIDs with human-readable domain names.
  • Audit and Version Control: Track changes and revisions to DID documents, providing a method for auditing document history.
  • Dynamic Service Endpoint Management: Modify and manage service endpoints associated with a DID, allowing the DID to interact with various decentralized services.
  • Cryptographic Functionality: Generate random keys, sign messages, verify signatures, and more, all using built-in cryptographic functions.

Installation

To install the library, you can use npm/yarn:

npm install @did-ipns/kit
yarn install @did-ipns/kit

Usage

Initialization

import IpnsDidKit from '@did-ipns/kit';
import { createHeliaHTTP } from "@helia/http";
import { trustlessGateway } from "@helia/block-brokers";
import { delegatedHTTPRouting } from "@helia/routers";

const helia = await createHeliaHTTP({
    blockBrokers: [
        trustlessGateway({
            gateways: ["http://127.0.0.1:8080"],
        }),
    ],
    routers: [delegatedHTTPRouting("http://127.0.0.1:8080/routing/v1")],
});
const ipnsDidKit = new IpnsDidKit(helia);

Creating a New DID Document

const privateKey = ipnsDidKit.generateRandomKey();
const didDocument = ipnsDidKit.create('your-unique-id', privateKey);

Signing and Verifying Messages

const signature = ipnsDidKit.sign('your-did-id', privateKey, 'message-to-sign');
const isValid = ipnsDidKit.verifySignature('your-did-id', publicKey, signature, 'message-to-sign');

Managing Service Endpoints

didDocument = ipnsDidKit.modifyServiceEndpoint(didDocument, 'serviceId', 'type', 'newEndpoint');

Contributing

Contributions are welcome! Please fork the repository and submit pull requests with your enhancements.

License

This project is licensed under the MIT License - see the LICENSE file for details.

More Information

For more details on IPNS, IPFS, and DIDs, please refer to their respective official documentation. This will help you understand the broader context in which this library operates.

This README provides a basic overview of the library's capabilities and usage. For more advanced features and detailed documentation, please refer to the source code or further documentation provided with the library.# ipns-did-kit