Catalog npm
Back to packageRELEASE DETAILS

1.0.1

npm

3id-resolver

Resolve 3ID documents

Published2 Jul 2020
Direct dependencies17
Transitive dependenciesNot calculated

README

Current package documentation

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 spec from the W3C Credentials Community Group.

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:

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 for more general usage information on DID resolvers.

Result:

{
  '@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

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 17

Native requirements
17 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
did-jwt
Environment
{
  "local_name": "did-jwt",
  "alias": false,
  "peer_metadata": null
}
^4.2.0runtime
base64url
Environment
{
  "local_name": "base64url",
  "alias": false,
  "peer_metadata": null
}
^3.0.1runtime
did-resolver
Environment
{
  "local_name": "did-resolver",
  "alias": false,
  "peer_metadata": null
}
^1.1.0runtime
@babel/runtime
Environment
{
  "local_name": "@babel/runtime",
  "alias": false,
  "peer_metadata": null
}
^7.1.2runtime
ipfs-did-document
Environment
{
  "local_name": "ipfs-did-document",
  "alias": false,
  "peer_metadata": null
}
^1.2.3runtime
ipfs
Environment
{
  "local_name": "ipfs",
  "alias": false,
  "peer_metadata": null
}
^0.44.0development
jest
Environment
{
  "local_name": "jest",
  "alias": false,
  "peer_metadata": null
}
^22.4.0development
standard
Environment
{
  "local_name": "standard",
  "alias": false,
  "peer_metadata": null
}
^11.0.0development
@babel/cli
Environment
{
  "local_name": "@babel/cli",
  "alias": false,
  "peer_metadata": null
}
^7.1.2development
babel-core
Environment
{
  "local_name": "babel-core",
  "alias": false,
  "peer_metadata": null
}
7.0.0-bridge.0development
@babel/core
Environment
{
  "local_name": "@babel/core",
  "alias": false,
  "peer_metadata": null
}
^7.1.2development
@babel/preset-env
Environment
{
  "local_name": "@babel/preset-env",
  "alias": false,
  "peer_metadata": null
}
^7.1.0development
@babel/preset-react
Environment
{
  "local_name": "@babel/preset-react",
  "alias": false,
  "peer_metadata": null
}
^7.0.0development
regenerator-runtime
Environment
{
  "local_name": "regenerator-runtime",
  "alias": false,
  "peer_metadata": null
}
^0.11.1development
@babel/plugin-transform-runtime
Environment
{
  "local_name": "@babel/plugin-transform-runtime",
  "alias": false,
  "peer_metadata": null
}
^7.1.0development
@babel/plugin-transform-modules-commonjs
Environment
{
  "local_name": "@babel/plugin-transform-modules-commonjs",
  "alias": false,
  "peer_metadata": null
}
^7.2.0development
@babel/plugin-proposal-object-rest-spread
Environment
{
  "local_name": "@babel/plugin-proposal-object-rest-spread",
  "alias": false,
  "peer_metadata": null
}
^7.0.0development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "13427b64732aa6d7b754fc9b2c14576e6ad21cc4",
  "tarball": "https://registry.npmjs.org/3id-resolver/-/3id-resolver-1.0.1.tgz",
  "fileCount": 6,
  "integrity": "sha512-eVB8Fpe91ihozHBevFeI7qTZXyJTykVOyJZHUtFmfX+JNQ4gCuQWCzP14VPmb2DYGcw8pjQ+reGyNL+z23euIA==",
  "signatures": [
    {
      "sig": "MEUCIHGkdZUFP8i/JfJNsy5OIZYw0Fpje0/gBttjUMcA/xPEAiEAyyFy+UrBkpOLSppWsm0IY3p44uA3KIXBnmabQy6A2bE=",
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
    }
  ],
  "unpackedSize": 20726,
  "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/h2FCRA9TVsSAnZWagAAv2YP/3aAoqGF4tm8nIMSL0QI\n/VxOcfYESLMhBNSj8fxdj/nbPQDPLlH2wQ1PCDNuSNKzQ2FTfuygKhC3yRbN\n8FJwekTxrZk/50EV8sEU7qAJwsYHTseBAFoKc0xhfpxPJZ5q9kRa7vbo/fOr\n0VFxQsG+9fCRa34nxCX5CQlu0QUWijapUfrDQUOL7TABVubaIRu0Rly/r294\ntn99drH3bN1W2rSFBIfWK12xiqs1Cm8eBw7UylWEiwR7RkDa4X7DK8Jb1uKE\n209q40ajVQYgVINGFJ000YVnOSmEqjtRwBQBNG9hD6Oqz1OXbJaLrlbF9bVL\nbIprB68T1WcVM40/SgtO7VLB8fKE44OWlodgn/wEGYvTLPDIP5i/tcxU//+F\nuBjyojUU7LCtwZmzr1Zwx+wpzeS5+sf7BM67t1yM+AgBYdwZcKdrXWKSWmEd\nTjVKxH++xlBID+taawoIIBAjPlpuCNU3CizXeZruqV0yZgxB3BKYX/uqTJCS\nqkK5p+IooTTaZVh4zZ3GWPjE80P74PGik7KgQ7h79EgBuQR66gfN2uWsEMfu\n1MoWeuMK4c5hncqT3lY/6hKePw52IgTexTRuyXdGCSTe7CVwxUIBLlWFRJ+J\nyYJh6EJrHeWeff3Rpi6U8OjN4hzbaHDStjM6b+ExUg2vPQMx8RcW34QHMOe+\nfxZE\r\n=VPtA\r\n-----END PGP SIGNATURE-----\r\n"
}

Repository

PENDING
uport-project/muport-did-resolver

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:46 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:085acaade2529d3aaae9f9a7b75bcd74294ef12fef6d255d51c1fdc9c85ee1e1

Other collected versions

1.0.023 Apr0.0.61 Aug0.0.529 May0.0.5-beta.129 May0.0.416 May0.0.316 MayView all collected versions →