# 3id-resolver

> Resolve 3ID documents

Latest version **1.0.1** (published 2020-07-02) · MIT license · 0 weekly downloads

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

## Install

```sh
npm install 3id-resolver
pnpm add 3id-resolver
yarn add 3id-resolver
bun add 3id-resolver
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-07-02 |
| First published | 2019-05-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 20.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | 3box |
| Maintainers | oed, zachferland |

## Links

- npm: https://www.npmjs.com/package/3id-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/3id-resolver

## Dependencies (5)

- [did-jwt](https://npm.io/package/did-jwt.md) ^4.2.0
- [base64url](https://npm.io/package/base64url.md) ^3.0.1
- [did-resolver](https://npm.io/package/did-resolver.md) ^1.1.0
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.1.2
- [ipfs-did-document](https://npm.io/package/ipfs-did-document.md) ^1.2.3

## Recent versions

- 1.0.1 (latest) — 2020-07-02
- 0.0.5-beta.1 (next) — 2019-05-29
- 1.0.0 — 2020-04-23
- 0.0.6 — 2019-08-01
- 0.0.5 — 2019-05-29
- 0.0.4 — 2019-05-16
- 0.0.3 — 2019-05-16
- 0.0.2 — 2019-05-16
- 0.0.1 — 2019-05-16

## README

# 3ID Resolver

This library is intended to resolve 3ID DID documents. 3ID is a thin identity protocol that uses ipfs and ethereum to publish and rotate the cryptographic keys used by an identity.

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 3ID 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 '3id-resolver'

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

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

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

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:3:zdpuAt4qH8ur3vHpVrP1xb7rtJuyVUVbRiGatkkVcJZRgAXDf',
  publicKeys: [ {
    id: 'did:3:zdpuAt4qH8ur3vHpVrP1xb7rtJuyVUVbRiGatkkVcJZRgAXDf#signingKey',
    type: 'Secp256k1VerificationKey2018',
    publicKeyHex: '03fdd57adec3d438ea237fe46b33ee1e016eda6b585c3e27ea66686c2ea5358479'
  }, {
    id: 'did:3:zdpuAt4qH8ur3vHpVrP1xb7rtJuyVUVbRiGatkkVcJZRgAXDf#encryptionKey',
    type: 'Curve25519EncryptionPublicKey',
    publicKeyBase64: 'fake encryptionKey'
  }, {
    id: 'did:3:zdpuAt4qH8ur3vHpVrP1xb7rtJuyVUVbRiGatkkVcJZRgAXDf#managementKey',
    type: 'Secp256k1VerificationKey2018',
    ethereumAddress: 'fake eth addr'
  }],
  authentication: [{
    type: 'Secp256k1SignatureAuthentication2018',
    publicKey: 'did:3:zdpuAt4qH8ur3vHpVrP1xb7rtJuyVUVbRiGatkkVcJZRgAXDf#signingKey'
  }]
}
```

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

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