@arcblock/vc

Javascript lib to work with ArcBlock Verifiable Credentials

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
@arcblock/vc
1.17.1918 days ago3 years agoMinified + gzip package size for @arcblock/vc in KB

Readme

Verifiable Credentials
styled with prettier docs Gitter
Javascript library to manipulate Verifiable Credentials (VC) to DID Protocol

Usage

yarn add @arcblock/vc

const VC = require('@arcblock/vc');

const issuer = fromRandom();
const owner = fromRandom();
const vc = create({
  type: 'EmailVerificationCredential',
  issuer: {
    wallet: issuer,
    name: 'DID.KYC.Email',
  },
  subject: {
    id: owner.address,
    key: 'value',
    method: 'SHA3',
  },
});

console.log(vc);

const result = VC.verify({ vc, ownerDid: owner.address, trustedIssuers: issuer.address });
console.log(result); // true

Documentation

For full documentation, checkout https://asset-chain.netlify.com