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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@trustvc/w3c-cli

v1.2.3

Published

CLI for TrustVC W3C

Downloads

497

Readme

TrustVC W3C CLI

w3c-cli is a command-line interface tool designed to demonstrate how to interact with Verifiable Credentials (VCs) and Decentralized Identifiers (DIDs) using functions from the following repositories:

This CLI provides a quick and straightforward way for users to:

  • Create key pairs
  • Generate well-known DIDs
  • Generate a signed Credential Status
  • Sign and verify VCs via the command line.

Table of Contents

Installation

  1. Install CLI:

[!NOTE] Remember to install the cli globally

npm install -g @trustvc/w3c-cli
  1. Run the CLI commands as needed:
w3c-cli <command>

How It Works

  • Generating Key Pairs: The CLI utilizes the generateKeyPair function from the w3c-issuer repository to generate key pairs, These key pairs are essential for creating DIDs and signing VCs.

  • Generating Well-Known DID: The CLI uses the issueDID function from the w3c-issuerrepository to generate a well-known DID. This allows users to self-host their DID as a unique identifier in decentralized systems.

  • Signing Verifiable Credentials: The CLI digitally signs a Verifiable Credential using the signCredential function from the w3c-vc repository, ensuring that the credential is tamper-evident and can be trusted by external verifiers.

  • Verifying Verifiable Credentials: The CLI verifies the authenticity of a signed Verifiable Credential using the verifyCredential function from the w3c-vc repository, checking the cryptographic proof to ensure the credential has not been altered and confirming the validity of the issuer's signature.

  • Generating a Signed Credential Status: The CLI creates a Bitstring StatusList from the w3c-credential-status repository and uses the createCredentialStatusPayload function to generate the pre-signed VC. It is then signed with the signCredential function from the w3c-vc repository, returning a signed Credential Status VC, which users can self-host.

  • Updating a Signed Credential Status: The CLI updates a signed Credential Status VC by downloading the hosted Credential Status VC. It then validates and parses the Bitstring StatusList, iteratively updating the StatusList, and signing the updated Credential Status using the signCredential function from the w3c-vc repository. Finally, it returns an updated signed Credential Status VC, which users can self-host.

Commands

The CLI provides several commands to help users interact with DIDs and Verifiable Credentials:

w3c-cli key-pair

This command generates a DID key pair, importing functions from the w3c-issuer repository. The generated key pairs are used to create DIDs and sign VCs.

w3c-cli did

This command generates a well-known DID using functionality from the w3c-issuer repository, allowing users to self-host their own DID.

w3c-cli sign

The sign command digitally signs a Verifiable Credential, leveraging the w3c-vc repository to create cryptographic proofs for the credentials, ensuring that the data remains tamper-evident and can be verified by any party.

w3c-cli verify

This command verifies the authenticity of a signed Verifiable Credential using the cryptographic proofs generated by the w3c-vc repository. It ensures that the credential has not been altered and confirms the validity of the issuer’s signature.

w3c-cli credential-status create

This command creates a signed Credential Status VC using the Bitstring StatusList.

w3c-cli credential-status update

This command updates any existing Credential Status VC and resign the Credential Status after it has been updated.

Directory Structure

Each command file is located in the src/commands directory and imports relevant functions from the w3c-issuer, w3c-vc and w3c-credential-status repositories.

├── src
│   └── commands
│       ├── credentialStatus
│       |   ├── create.ts
│       |   └── update.ts
│       ├── credential-status.ts
│       ├── did.ts
│       ├── key-pair.ts
│       ├── sign.ts
│       └── verify.ts
├── package.json
└── README.md