Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@digitalbazaar/vc-status-list

digitalbazaar16.7kBSD-3-Clause8.0.1

Verifiable Credentials Status List

vc, verifiable credential, status list, bitstring, StatusList2021, VerifiableCredential

readme

@digitalbazaar/vc-status-list


NOTE: Status List 2021 is being replaced by Bitstring Status List. Please see @digitalbazaar/vc-bitstring-status-list for our current implementation and Bitstring Status List v1.0 for the latest specification.


Verifiable Credential Status List 2021

Creating a StatusList2021Credential

const sl = require("@digitalbazaar/vc-status-list");
const jsigs = require("jsonld-signatures");
const {Ed25519KeyPair} = require("crypto-ld");
const vc = require("vc-js");
const documentLoader = require("./path-to/document-loader.js");

const key = new Ed25519KeyPair({
  "id": "did:key:z6MknUVLM84Eo5mQswCqP7f6oNER84rmVKkCvypob8UtBC8K#z6MknUVLM84Eo5mQswCqP7f6oNER84rmVKkCvypob8UtBC8K",
  "controller": "did:key:z6MknUVLM84Eo5mQswCqP7f6oNER84rmVKkCvypob8UtBC8K",
  "type": "Ed25519VerificationKey2018",
  "privateKeyBase58": "CoZphRAfAVPqx9f54MRUBtmjD4uY6KPxQQKsE3frUbZ269tBD4AdTQAVbXHHgpewh4BunoXK8dotcUJ6JXhZPsh",
  "publicKeyBase58": "92EHksooTYGwmSN8hYhFxGgRJVav5SVrExuskrWsFyLw"
});
const suite = new Ed25519Signature2018({
  key,
  date: "2019-12-11T03:50:55Z",
});
const id = "https://example.com/credentials/status/3";
const list = await sl.createList({length: 100000});
const encodedList = await list.encode();
const slCredential = {
  "@context": ["https://www.w3.org/2018/credentials/v1", "https://w3id.org/vc/status-list/v1"],
  id,
  issuer: "did:key:z6MknUVLM84Eo5mQswCqP7f6oNER84rmVKkCvypob8UtBC8K",
  issuanceDate: "2021-03-10T04:24:12.164Z",
  type: ["VerifiableCredential", "StatusList2021Credential"],
  credentialSubject: {
    id: `${id}#list`,
    type: "StatusList2021",
    encodedList,
  },
};
let verifiableCredential = await vc.issue({
  credential: {...slCredential},
  suite,
  documentLoader,
});

Created a Credential which uses a StatusList2021

// see imports above
const credential = {
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://www.w3.org/2018/credentials/examples/v1",
    "https://w3id.org/vc/status-list/v1",
  ],
  id: "https://example.com/credentials/3732",
  type: ["VerifiableCredential", "UniversityDegreeCredential"],
  issuer: "did:web:did.actor:alice",
  issuanceDate: "2021-03-10T04:24:12.164Z",
  credentialStatus: {
    id: "https://example.com/credentials/status/3#94567",
    type: "StatusList2021Entry",
    statusListIndex: "94567",
    statusListCredential:
      "https://did.actor/alice/credentials/status/3",
  },
  credentialSubject: {
    id: "did:web:did.actor:bob",
    degree: {
      type: "BachelorDegree",
      name: "Bachelor of Science and Arts",
    },
  },
};
let verifiableCredential = await vc.issue({
  credential: {...credential},
  suite,
  documentLoader,
});

changelog

@digitalbazaar/vc-status-list ChangeLog

8.0.1 - 2025-03-07

Changed

  • Update dependencies.
    • @digitalbazaar/credentials-context@3.2.0.
    • @digitalbazaar/vc@7.1.1.

8.0.0 - 2024-08-02

Changed

  • BREAKING: Require Node.js >=18.
  • Update dependencies.
    • @digitalbazaar/bitstring@3.1.0
    • @digitalbazaar/credentials-context@3.1.0
    • @digitalbazaar/vc@7.0.0
    • @digitalbazaar/vc-status-list-context@3.1.1
  • Update test and development dependencies.

7.1.0 - 2023-11-20

Added

  • Include results in credential status check output.

7.0.0 - 2023-01-08

Changed

  • BREAKING: Use little-endian bit order in bitstrings. Previous versions used little-endian order internally for the bytes used to represent the bitstring, but big-endian order for the bits. This makes the endianness consistently little endian. Any legacy status lists that depended on the old order will be incompatible with this version.

Removed

  • BREAKING: Remove support for node 14. Node 16+ required.

6.0.0 - 2022-10-25

Changed

  • BREAKING: Use @digitalbazaar/vc@5 to get better safe mode protections.

5.0.0 - 2022-06-16

Changed

  • BREAKING: Convert to module (ESM).
  • BREAKING: Require Node.js >=14.
  • Update dependencies.
  • Lint module.

4.0.0 - 2022-06-04

Added

  • BREAKING: Add required param statusPurpose to createCredential().
  • Check if statusPurpose in credential matches the statusPurpose of status list credential. If they don't match, an error will be thrown.

3.1.0 - 2022-05-30

Added

  • Export StatusList utility class.

3.0.0 - 2022-04-15

Changed

  • BREAKING: Use @digitalbazaar/vc-status-list-context v3.0. Rename RevocationList2021 and RevocationList2021Status to StatusList2021 and StatusList2021Entry respectively and remove SuspensionList2021Status.
  • _getStatuses now returns an array of statuses with type "StatusList2021Entry" or an empty array if there are no matching types.

2.1.0 - 2022-03-12

Added

  • New API getCredentialStatus gets a status by type from a VC.

Changed

  • VCs can have multiple statuses.
  • Use @digitalbazaar/vc-status-list-context. This is not a breaking change -- the context is the same just a package relocation.

2.0.0 - 2022-02-19

Changed

  • BREAKING: Renamed package to @digitalbazaar/vc-status-list.

1.0.0 - 2022-02-09

Changed

  • See git history for changes previous to this release.