@sphereon/ssi-sdk-factom-did-provider
TypeScript icon, indicating that this package has built-in type declarations

0.11.0 • Public • Published


Sphereon
Ssi-sdk-factom-did-provider (Typescript)

Lto-factom-provider is a Veramo plugin to create DIDs on Factom Protocol.

Constructor

During construction of the Factom DID provider you can set the defaultNetwork, universal registrar URL and the Veramo default Key Management System (KMS)

import { FactomDIDProvider } from '@sphereon/veramo-factom-did-provider'

const factomDIDProvider = new FactomDIDProvider({
  defaultKms: 'local',
  defaultNetwork: 'testnet',
  registrarUrl: 'https://your.universal.registrar.here',
})

createIdentifier

Creating a DID means you have to create public/private keypairs first both for the DID fragment itself as well as the management keys. The Factom DID Provider will store these keys using Veramo's Keymanager, so that you can use them later

const managementKeys = [
  { priority: 0, privateKeyMultibase: 'z08a58bad89...' },
  { priority: 1, privateKeyMultibase: 'z18a58bad89...' },
]
const didKeys = [{ priorityRequirement: 1, privateKeyMultibase: 'z234a...', purpose: [] }]
const tags = ['my', 'did', 'chain', 'name', 'here'] // Used to populate Factoms external Id values
const nonce = 'random value' // If left out, will be automatically created to make the DID chain unique

const identifier = await factomDIDProvider.createIdentifier(
  {
    options: {
      managementKeys,
      didKeys,
      tags,
      nonce,
    },
  },
  context
)

Installation

yarn add @sphereon/ssi-sdk-factom-did-provider

Build

yarn build

Readme

Keywords

Package Sidebar

Install

npm i @sphereon/ssi-sdk-factom-did-provider

Weekly Downloads

2

Version

0.11.0

License

Apache-2.0

Unpacked Size

40.1 kB

Total Files

19

Last publish

Collaborators

  • nklomp78
  • nklomp
  • spostma
  • bramtencate