A Claim is a JSON used to describe the subject's properties. It can be perceived as a VC that hasn't been signed by the attester yet, and thus it is also named RawCredential
Claimcontains the following 6 fields:
CType: The unique identifier of the Credential Type, which is a hexadecimal string starting with '0x';credentialSubject: The main part of the RawCredential, which is the core and most private content of a Credential, containing the user's private data, in the format of Record<string, NativeType>, e.g., {"Name": "Alice", "Age": 20};credentialSubjectNonceMap: nonceMap contains the UUID which is used to do hashing-with-salt operation, ensuring the uniqueness and robustness of Credential and ensuring that Credential can not be attacked by Brute-force attack;credentialSubjectHashes: the hexadecimal hashing result after adding salt to the user data, each user data will correspond to a hashing result;
"Name": "Alice" hashing result after adding salt is '0xabcd', "Age": 20 hashing result after adding salt is '0xefgh'. So, when building the Merkle Tree, there will be 2 leaves with the values '0xabcd' and '0xefgh'.holder: The DID URL of Holder(Claimer), prefixed with did:zk:;hasher: Array of HashType, used to mark the hash method used in the process of generating VC:
Here's the Claim structure:
export interface RawCredential {
CType: HexString;
credentialSubject: CredentialSubject;
credentialSubjectNonceMap: Record<HexString, HexString>;
credentialSubjectHashes: HexString[];
holder: DidUrl;
hasher: [HashType, HashType];
}
A Claim (RawCredential) features the following methods for efficient Claim management:
For a detailed explanation, please refer to our SDK Guideline