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

lit-vc-sdk

v0.0.5

Published

### Installation: `yarn add lit-vc-sdk`

Downloads

6

Readme

Lit Verifiable Credentials SDK

Installation:

yarn add lit-vc-sdk

npm install lit-vc-sdk

Usage

The lit-vc-sdk uses Ceramic to store conditions. By default, the SDK connects to the Ceramic Clay Testnet. This can be changed by adding CERAMIC_NETWORK="<your desired network address>" to the .env

Planned functions and status (Sept 2022)

Issuer Functions

| Function | Description | Status | |----------------------------------------------|-----------------------------------------------------------|----------| | issueCredential | issue and sign a verifiable credential (VC) to a receiver | beta | | revokeCredential | revoke previously issues credential | not done |

Receiver/User Functions

| Function | Description | Status | |--------------------------------------------------------|-----------------------------------------------------------|----------| | verifyCredential | verify an issued credential | beta | | generatePresentation | generate a verifiable presentation (VP) for a selected VC | beta | | acceptCredential | accept a credential issued to a the user | not done | | burnCredential | remove a previously issued credential | not done | | requestCredential | request a credential from an issuer | not done | | transferCredential | transfer a credential to another PKP | not done |

Verifier Functions

| Function | Description | Status | |----------------------------------------------------|-------------------------------------|----------| | verifyPresentation | verify an issued VP | beta | | requestDecryption | request decryption rights over a VP | not done |

Functions


issueCredential

issues a verifiable credential to a receiver

issueCredential(credential: Credential, proof: Proof, recipient: string): Promise<IssueCredentialResponse>

Parameters

credential (Credential): credential object

receiver (string): PKP Public key of VC receiving party

Returns

Promise<string>: A promise containing the Ceramic stream ID of the stored VC


verifyCredential

verifies a previously issued credential

verifyCredential(vcId: string, issuer: string): Promise<any>

Parameters

vcId(string): the Ceramic stream ID of the credential to verify

issuer(string): the PKP public key of the VC owner

Returns

Promise<VerifyCredentialResponse>: A promise containing an object that includes a boolean verified property, as well as the verified credential obj.


generatePresentation

generates a VP for a given VC

generatePresentation(presentation: Presentation, credential: Credential[], issuer: string): Promise<any>

Parameters

presentation (Presentation): the presentation object

credential (Credential[]): an array of the credentials to include in the VP

issuer (string): the PKP public key of the party issuing the VP

Returns

Promise<GeneratePresentationResponse>: A promise containing the Ceramic stream ID of the stored VP


verifyPresentation

verifies a previously issued presentation and the contained credentials

verifyPresentation(vcId: string, issuer: string): Promise<VerifyPresentationResponse>

Parameters

vcId(string): the Ceramic stream ID of the presentation to verify

issuer(string): the PKP public key of the VC owner

Returns

Promise<VerifyPresentationResponse>: A promise containing an object that includes a boolean verified property, as well as the verified presentation obj.


Types


Credential

interface Credential {
  "@context": string[],
  id: string,
  type: string[],
  issuer: string,
  issuanceDate: string,
  credentialSubject: CredentialSubject,
  proof?: Proof
}

Presentation

interface Presentation {
  "@context": string[],
  type: string,
  proof?: Proof,
  issuer?: string
  verifiableCredential?: Credential[]
}

Proof

interface Proof {
  type: string,
  created: string,
  proofPurpose: string,
  verificationMethod: string,
  jws: string
}

VerifyCredentialResponse

interface VerifyCredentialResponse {
  recoveredCredential: Credential
  verified: boolean
}

GeneratePresentationResponse

interface GeneratePresentationResponse {
  docId: string,
  presentation: Presentation
}

VerifyPresentationResponse

interface VerifyPresentationResponse {
  recoveredPresentation: Presentation
  verified: boolean
}