JSPM

@did-ipns/resolver

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q24891F
  • License ISC

Resolve DID documents using the IPNS method

Package Exports

  • @did-ipns/resolver

Readme

ipns-did-resolver

A resolver library for the IPNS method, to be used with the did-resolver library.

IPNS method resolution works with both IPNS (Peer ID hash) CIDs and DNSLink domains. Paths will be resolved as UnixFS blocks.

Note: The default DID path is .well-known/did.json which is similar to did:web.

Documents that resolve but have an ID that doesn't match the DID used to resolve it will throw an error.

Usage

import { Resolver } from "did-resolver";
import { getResolver } from "@did-ipns/resolver";

import { createHeliaHTTP } from '@helia/http'

const helia = await createHeliaHTTP()

const ipnsResolver = getResolver(
    helia
);
const resolver = new Resolver(ipnsResolver);

const result = await resolver.resolve("did:ipns:did.ipfs.io");

console.log(result);

API

The library exports a function getResolver(helia). The first parameter is an instance of Helia.