# muport-did-resolver

> Resolve µPort DID documents

Latest version **1.0.3** (published 2020-07-02) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2020-07-02 |
| First published | 2018-03-04 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 48.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | 3Box team |
| Maintainers | oed, zachferland |

## Links

- npm: https://www.npmjs.com/package/muport-did-resolver
- Repository: https://github.com/uport-project/muport-did-resolver
- Homepage: https://github.com/uport-project/muport-did-resolver#readme
- Issues: https://github.com/uport-project/muport-did-resolver/issues
- npm.io page: https://npm.io/package/muport-did-resolver

## Dependencies (3)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.0
- [did-resolver](https://npm.io/package/did-resolver.md) ^1.1.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.1.2

## Recent versions

- 1.0.3 (latest) — 2020-07-02
- 0.3.0-alpha.6 (next) — 2019-06-05
- 1.0.2 — 2020-05-28
- 1.0.1 — 2020-04-24
- 1.0.0 — 2020-04-24
- 0.3.1 — 2019-08-07
- 0.3.0 — 2019-06-05
- 0.3.0-alpha.5 — 2019-06-04
- 0.3.0-alpha.4 — 2019-06-04
- 0.3.0-alpha.3 — 2019-04-11
- 0.3.0-alpha.2 — 2019-02-02
- 0.3.0-alpha.1 — 2019-02-02
- 0.2.0 — 2018-08-15
- 0.2.0-beta-4 — 2018-08-15
- 0.2.0-beta-3 — 2018-06-29
- … 26 more at https://npm.io/package/muport-did-resolver/versions

## README

# µPort DID Resolver

[![Greenkeeper badge](https://badges.greenkeeper.io/3box/muport-did-resolver.svg)](https://greenkeeper.io/)

This library is intended to resolve µPort DID documents. µPort is a thin identity protocol that uses ipfs and ethereum to publish and rotate the cryptographic keys used by an identity. Currently it only supports creating and resolving identities, but not updating them.

It supports the proposed [Decentralized Identifiers](https://w3c-ccg.github.io/did-spec/) spec from the [W3C Credentials Community Group](https://w3c-ccg.github.io).

It requires the `did-resolver` library, which is the primary interface for resolving DIDs.

## Resolving a DID document

A µPort resolver is created by passing an IPFS instance to the `getResolver()` function. To use the resolver returned, it must be passed to a `did-resolver` instance during instantiation, for example:

```js
import { Resolver } from 'did-resolver'
import { getResolver } from 'muport-did-resolver'

const muportResolver = getResolver(ipfs)
const resolver = new Resolver(muportResolver)

resolver.resolve('did:muport:QmRhjfL4HLdB8LovGf1o43NJ8QnbfqmpdnTuBvZTewnuBV').then(doc => console.log)

// You can also use ES7 async/await syntax
const doc = await resolver.resolve('did:muport:QmRhjfL4HLdB8LovGf1o43NJ8QnbfqmpdnTuBvZTewnuBV')
```

See the [did-resolver docs](https://github.com/decentralized-identity/did-resolver) for more general usage information on DID resolvers.

Result:
```js
{ '@context': 'https://w3id.org/did/v1',
  id: 'did:muport:QmRhjfL4HLdB8LovGf1o43NJ8QnbfqmpdnTuBvZTewnuBV',
  publicKey:
   [ { id: 'did:muport:QmRhjfL4HLdB8LovGf1o43NJ8QnbfqmpdnTuBvZTewnuBV#signingKey',
       type: 'Secp256k1VerificationKey2018',
       owner: 'did:muport:QmRhjfL4HLdB8LovGf1o43NJ8QnbfqmpdnTuBvZTewnuBV',
       publicKeyHex: '02756bca1edf0d0e263851b95e7963b4721d82c2e84c9d7f8a380f899dff8f721c' },
     { id: 'did:muport:QmRhjfL4HLdB8LovGf1o43NJ8QnbfqmpdnTuBvZTewnuBV#managementKey',
       type: 'Secp256k1VerificationKey2018',
       owner: 'did:muport:QmRhjfL4HLdB8LovGf1o43NJ8QnbfqmpdnTuBvZTewnuBV',
       publicKeyHex: '0214ca1c21dfa6bb2550a8559e83817ebd82cfbb8dbda56757f4c0517dde9c52ff' },
     { id: 'did:muport:QmRhjfL4HLdB8LovGf1o43NJ8QnbfqmpdnTuBvZTewnuBV#encryptionKey',
       type: 'Curve25519EncryptionPublicKey',
       owner: 'did:muport:QmRhjfL4HLdB8LovGf1o43NJ8QnbfqmpdnTuBvZTewnuBV',
       publicKeyBase64: 'uYGr6nD/c/2hQ3hNFrWUWAdlNoelPqduYyyafrALf2U=' } ],
  authentication:
   [ { type: 'Secp256k1SignatureAuthentication2018',
       publicKey: 'did:muport:QmRhjfL4HLdB8LovGf1o43NJ8QnbfqmpdnTuBvZTewnuBV#signingKey' } ],
  muportData: { nym: 'lala', symEncryptedData: {} } }
```

## Maintainers
[@oed](https://github.com/oed)

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