A VC contains a "Proof", which is essentially a claim that has been signed by the attester using the AssertionMethod.

Basic Construction

VerifiableCredential is an extension of RawCredential with the following 7 new structures in addition to the basic RawCredential:

Generating a Verifiable Credential requires a 2-step process:

  1. First, a VerifiableCredentialBuilder needs to be generated;
  2. Second, Attester calls the build method in VerifiableCredentialBuilder with its DID as parameter to generate a VerifiableCredential with Attester's signature (including attester's Proof)
export class VerifiableCredentialBuilder {
  public '@context'?: string[];
  public version?: VerifiableCredentialVersion;
  public issuanceDate?: number;
  public expirationDate?: number | null;
  public raw: Raw;
  public digestHashType?: HashType;
 ...
 }

export interface VerifiableCredential extends RawCredential {
  '@context': string[];
  version: VerifiableCredentialVersion;
  issuanceDate: number;
  expirationDate?: number;
  issuer: DidUrl;
  digest: HexString;
  proof: Proof[];
}

Key Methods

A Verifiable Credential contains the following methods for building VCs from claims and managing VCs. For more details, please refer to our SDK Guideline.