/ssi-sdk

Self Sovereign Identity SDK based on Veramo

Primary LanguageTypeScriptApache License 2.0Apache-2.0


Sphereon
SSI SDK (Typescript)


Warning: These packages still is in very early development. Breaking changes without notice will happen at this point!


SSI SDK

This is an SSI SDK based on the great work done by Veramo. The SDK is a mono-repository with multiple packages (see lerna below). It contains plugins that extend the Veramo framework:

SSI SDK Core

The core package contains types and methods shared by the other plugins

MS Authenticator

The core package for microsoft authentication using msal library.

Factom DID Provider

The Factom Protocol DID Provider can create DIDs using the Factom Protocol.

LTO Network DID Provider

The LTO Network DID Provider can create DIDs, as well as add and manage verification methods using LTO Network.

Mnemonic Seed

The Mnemonic Seed and Key Derivation handles generation and secure storage of Mnemonics, as well as the creation of a seed out of the mnemonic and the derivation of keys.

Microsoft Request API

Azure Active Directory (Azure AD) Verifiable Credentials allows you to issue a credential. The Microsoft Verifiable Credential Issuer handles issuing a verifiable credential using issuer authentication info and issuer configuration.

VC API Issuer

The W3C VC (HTTP) API Issuer issues Verifiable Credentials using a W3C VC API spec based API (currently only supporting a v0.1 spec).

VC API Verifier

The W3C VC (HTTP) API Verifier is a verifies Verifiable Credentials using a W3C VC API spec based API (currently only supporting a v0.1 spec).

JSON-LD Local VC/VP Handler

The JSON-LD VC/VP Handler handles issuance and verification of JSON-LD based Verifiable Credentials and Verifiable Presentations

OpenID Connect

The Self-Issued OpenID Connect and OpenID Connect for Verifiable Presentations plugin allows an OP to authenticate against a Relying Party using Self-Issued OpenID Connect and optionally OpenID Connect for Verifiable Presentations, with the help of our Presentation-Exchange library.

WACI PEx QR React

The waci-pex-qr-react is a generates a QR Code for the WACI Presentation Exchange specification in React or React-Native environments.

DID resolution


Note: DID resolution is not part of this SDK. We do provide a Universal DID client you can use in Veramo, simply by using the below code when setting up the Agent:

Using the Universal resolver for all DID methods:

export const agent = createAgent<IDIDManager & CredentialIssuerLD & IKeyManager & IDataStore & IDataStoreORM & IResolver>({
  plugins: [
    // Other plugins
    new DIDResolverPlugin({
      resolver: new UniResolver({ resolveURL: 'https://dev.uniresolver.io/1.0/identifiers' })
    })
  ]
})

Using the Universal resolver for specific DID methods and DID-key:

export const agent = createAgent<IDIDManager & CredentialIssuerLD & IKeyManager & IDataStore & IDataStoreORM & IResolver>({
  plugins: [
    // Other plugins
    new DIDResolverPlugin({
      resolver: new Resolver({
        ...getDidKeyResolver(),
        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),
        ...getUniResolver('factom', { resolveUrl: 'https://dev.uniresolver.io/1.0/identifiers' }),
      }),
    }),
  ]
})

Building and testing

Lerna

The SSI-SDK makes use of Lerna for managing multiple packages. Lerna is a tool that optimizes the workflow around managing multi-package repositories with git and npm / yarn.

Build

The below command builds all packages for you using lerna

yarn build

Test

The test command runs:

  • jest
  • coverage

You can also run only a single section of these tests, using for example yarn test:watch.

yarn test

Utility scripts

There are other utility scripts that help with development.

  • yarn prettier - runs prettier to fix code style.

Publish

There are scripts that can publish the following versions:

  • latest
  • next
  • unstable
yarn publish:[version]