# ipns-did-resolver

> Resolve DID documents using the IPNS method

Latest version **0.1.1** (published 2022-08-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install ipns-did-resolver
pnpm add ipns-did-resolver
yarn add ipns-did-resolver
bun add ipns-did-resolver
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2022-08-28 |
| First published | 2022-08-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Upkeep |
| Maintainers | misterupkeep |
| Keywords | DID, IPSP, IPFS, DID resolver |

## Links

- npm: https://www.npmjs.com/package/ipns-did-resolver
- npm.io page: https://npm.io/package/ipns-did-resolver

## Dependencies (10)

- [did-doc](https://npm.io/package/did-doc.md) ^1.0.0
- [uint8arrays](https://npm.io/package/uint8arrays.md) ^3.1.0
- [@ipld/dag-pb](https://npm.io/package/@ipld/dag-pb.md) ^2.1.17
- [did-resolver](https://npm.io/package/did-resolver.md) ^4.0.0
- [multiformats](https://npm.io/package/multiformats.md) ^9.7.1
- [@ipld/dag-cbor](https://npm.io/package/@ipld/dag-cbor.md) ^7.0.2
- [@ipld/dag-json](https://npm.io/package/@ipld/dag-json.md) ^8.0.10
- [ipfs-core-types](https://npm.io/package/ipfs-core-types.md) ^0.11.1
- [ipfs-uniform-resolve](https://npm.io/package/ipfs-uniform-resolve.md) ^1.0.0
- [multiformat-multicodec](https://npm.io/package/multiformat-multicodec.md) ^1.0.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2022-08-28

## README

# ipns-did-resolver

**NOTE:** The IPNS-DID spec is unstable.

A resolver library for the IPNS method, to be used with the
[`did-resolver`](https://www.npmjs.com/package/did-resolver) library.

IPNS method resolution works with both IPNS (Peer ID hash) CIDs and DNSLink
domains. Paths will be resolved across both UnixFS blocks and other IPLD blocks,
using
[`ipfs-uniform-resolve`](https://www.npmjs.com/package/ipfs-uniform-resolve).

Fragments and queries are currently ignored and will resolve the entire document
instead.

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

## Usage

```ts
import { Resolver } from "did-resolver";
import * as IPNSMethod from "ipns-did-resolver";

import * as IPFS from 'ipfs-core'

const ipfs = await IPFS.create()

const ipns = IPNSMethod.getResolver(
  ipfs.block,
  ipfs.name
);
const resolver = new Resolver({ ipns });

await resolver.resolve("did:ipns:did.ipfs.io");
```

## API

The library exports a function `getResolver(block, name, multidecoder?)`. The
first two parameters are the Block and Name APIs of the IPFS API.

`multidecoder` is a either a `Multidecoder` instance, or a `{decoders, hashers}`
object, to let you provide whatever decoder/hasher you need.

Learn more about `Multidecoder`
[here](https://www.npmjs.com/package/multiformat-multicodec).

---
_Source: https://npm.io/package/ipns-did-resolver · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
