Skip to content

openwallet-foundation-labs/vc-api

Energy Web Foundation Logo Elia Group Logo

EWF and Elia Group Self-Sovereign-Identity (SSI) Wallet Components

CI

Introduction

This repository provides a VC API implementation.

Apps

VC-API

The vc-api app is a NestJs implementation of the W3C Credentials Community Group VC API Specification.

Libraries

DID Library

The DID generation logic is encapsulated in the did library. This potentially allows the logic to be shared between wallets of various form-factors (e.g. nodejs wallet, a web wallet, another nodejs framework, etc in the future).

Often DID generation requires the generation of a new public-private keypair. In order to rename agnostic to the key-generation and storage preferences of a particular wallet implementation, the did DID factories accept public keys in the standard format of JWK.

An abstracted process of creating a DID controlled by a asymmetric key-pair is therefore:

const key = generateKey(); // Generate a key pair and return the public key necessary to create the DID
const did = generateDID(key); // Code from ssi-did lib. Returns initial DID Document of DID, including Verification Methods

KMS Interface

Technology Decisions

Rationale for Spruce DIDKit

Spruce's DIDKit is used for DID generation and credential issuance & verification. The rational for DIDKit's use is that it:

  • Is written in Rust and so suitable for use in any mobile app development framework
  • Supports JSON-LD and JWT credential issuance and verification
  • Supports did:key, did:ethr, did:web
  • DIDKit (and its libraries) are open-source

Installation

This repository is a monorepo that uses Rush with the PNPM package manager.

PNPM is used for its speed and solution to NPM doppelgangers (as well as being the default option for rush). See comparison of NPM vs PNPM vs Yarn for Rush.

Requirements

PNPM is required. See installation instructions here: https://pnpm.js.org/installation/

Rush is required. See installation instructions here: https://rushjs.io/pages/intro/get_started/

Install

Use rush to install dependencies (not the package manager directly). In other words, do not run npm install or pnpm install. This is because Rush optimizes by installing all of the dependency packages in a central folder, and then uses symlinks to create the “node_modules” folder for each of the projects.

$ rush install

Build

Use rush to build.

$ rush build

Testing

To run tests across all apps and libraries in one command, a rush script has been added to ./common/config/rush/command-line.json

$ rush test

Contributing Guidelines

See contributing.md

Questions and Support

For questions and support please use the Github issues.

License

This project is licensed under the Apache 2.0 license - see the LICENSE file for details