ascertify-sdk
TypeScript icon, indicating that this package has built-in type declarations

0.0.15 • Public • Published

ascertify-sdk

Ascertify SDK is a javascript library to create W3C standard compliant Decentralized Identifiers (DIDs) and issue Verifiable Credentials (VCs) on Algorand ecosystem.

Prerequisites

This library leverages additional libraries including algosdk, and jose. To find out more, check out dependencies

Installing prerequisites

npm install algosdk
npm install jose

Installation

npm install ascertify-sdk

Quick Start

import {exportJWK, generateKeyPair} from 'jose';

const MNEMONIC = /* put your Algorand account mnemonic here and ensure its funded */

const ACCOUNT = algosdk.mnemonicToSecretKey(MNEMONIC);
const address = ACCOUNT.addr;

const sdk = new AscertifyID();

const { publicKey } = await generateKeyPair('ES256');
const pubKey = await exportJWK(publicKey);
const controller = ACCOUNT.addr;
const alsoKnownAs = 'https://ascertify.co';
const verificationMethod = {
    id: `did:ascertify:${ACCOUNT.addr}#keys-1`,
    type: 'JsonWebKey2020',
    controller: `did:ascertify:${ACCOUNT.addr}`,
    publicKeyJwk: {
        ...pubKey
    }
}
let did = await ascertify_sdk.createDID({address: address, controller:controller, alsoKnownAs: alsoKnownAs, verificationMethod: verificationMethod});

License

ascertify-sdk is licensed under an LGPL-2.1 license. See the LICENSE file for details.

Readme

Keywords

Package Sidebar

Install

npm i ascertify-sdk

Weekly Downloads

0

Version

0.0.15

License

ISC

Unpacked Size

151 kB

Total Files

54

Last publish

Collaborators

  • lmedury