npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@terminal3/bbs_vc

v0.2.36

Published

This SDK enables the management of Decentralized Identifiers (DIDs) and Verifiable Credentials (VCs). It supports creating, verifying.

Readme

DID and Verifiable Credential SDK

This SDK enables the management of Decentralized Identifiers (DIDs) and Verifiable Credentials (VCs). It supports creating, verifying.

Supported signatures:

  • BBS+

Installation

To install the SDK, use yarn:

yarn install

Functions

The SDK exposes following functions:

  • bbsDidFromPublicKey: Creates a DID from a BBS+ public key.
  • blsG2PublicKeyFromPrivateKey: Retrieves the BBS+ public key from a BBS+ private key.
  • createBbsCredential: Creates a BBS+ credential with the specified parameters.
  • makeBBSPlusProof: Creates a BBS+ proof for a set of messages using the provided private key and public key. The function signs the messages using the BLS signature algorithm and constructs a proof object with the necessary metadata, including the type, proof purpose, verification method, creation date, and mandatory pointers.
  • makeBBSPlusW3cProof: Creates a BBS+ proof for a set of messages using the provided private key and public key. It exactly follows the W3C specification for VCs with BBS+ signatures. Which means RDF Canonicalization is used to create the messages, the mandatory messages and the proof config are hashed and included in the header of the BBS+ signature. The proof value contains additional cbor encoded metadata, like mandatory pointers...
  • blsSignMessages: Signs the provided messages using the BBS signature algorithm and returns the signature. There is currently a difference with the IETF BBS signature standard: the header message is included as message 0 in the signature.
  • getMessages: Extracts and processes messages from the given data based on specified mandatory fields. This is used for preparing messages for BBS+ signatures.
  • getGroupedMessages: Traverses a data object, extracting data as messages and grouping them into mandatory and non-mandatory categories based on specified paths. This function also ensures that all specified mandatory fields are covered in the data provided.

Usage

Below is an example on how to issue, verify, and optionally revoke a verifiable credential using the BBS+ signature scheme.

Example: Issue and Verify a Verifiable Credential

import { BbsDID, createBbsCredential, verifyBbsVc } from '@terminal3/bbc_vc';

// Issuer's private key and setup
const issuerPrivateKey = 'private_key_here';
const issuer = new BbsDID(privateKey);

// Holder's DID
const holderDid = 'did:example:b34ca6cd37bbf23';

// Creating a credential with BBS+ signature
const claims = { kyc: 'passed' };
const revocationRegistryAddress = '0x77Fb69B24e4C659CE03fB129c19Ad591374C349e';
const didRegistryAddress = '0x312C15922c22B60f5557bAa1A85F2CdA4891C39a';
const provider = new ethers.JsonRpcProvider(process.env.TEST_BLOCKCHAIN_URL);
const options = {
  revocationRegistryAddress,
  provider,
  didRegistryAddress,
} as VerificationOptions;
const credential = await createBbsCredential(
  bbsIssuer,
  userDid,
  cred_subject,
  ['KycCredential'], // type
  undefined, // valid from
  undefined, // valid until
  options,
);
console.log('Credential Issued:', credential);

// Verifying the credential
const verificationResult = await verifyBbsVC(credential);
console.log('Verification Result:', verificationResult);