Creation of SD-JWT Credentials

This guide will explain the step-by-step process for creating an SD-JWT Credential. The process includes hashing, creating disclosures, and adding decoy hashes.

SD-JWT Credential Issuance Process

  1. Credential Creation: The issuer begins by preparing the credential to be signed. This includes selecting a type, inserting the appropriate contexts, schemas, and claims.
  2. Choosing Disclosures: Next, the issuer decides which claims in the credential should be selectively disclosable by the holder. These selected claims then get hashed to conceal their original value.
  3. Claim Hashing: The chosen claims are transformed into disclosures by concatenating the claim name and value, then prefixing it with a salt. A salt prevents potential hackers from using dictionary attacks to guess plain-text values. The salted value is then converted to a base64 string as the disclosure representation. An example of a disclosure is: [ “dC12Y2xpYi9tYXN0ZXI”, “given_name”, “John” ]. Finally, the disclosures are hashed and included into the credential.
  4. Adding Decoy Hashes: To maintain the privacy of the actual number of claims a credential holds, decoy hashes ( dummy values) can be added to the credential. This ensures that potential observers cannot determine the number of claims based on the number of hashes.
  5. Signature & Transfer to Holder: Once completed, the credential is singed with the issuers key as JWT and is sent along with all disclosures to the holder. By having access to all disclosures the holder can view the entire content of the credential, and then decide which disclosures to send along with the SD-JWT-VC in any transaction with a verifier.
  6. Transfer Format: During transfers (issuance/verification), the SD-JWT-VC is sent together with concatenated disclosures, separated by the ~ sign. See example below.
eyJraWQiOiI5MmJlMTAzYjRkZmY0OGYxYmE5ODc4ZGQyNmZhZjcxZSIsImN0eSI6ImNyZWRlbnRpYW
wtY2xhaW1zLXNldCtqc29uIiwidHlwIjoidmMrc2Qtand0IiwiYWxnIjoiRWREU0EifQ.eyJjcmVkZ
W50aWFsU2NoZW1hIjp7ImlkIjoiaHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL3dhbHQ
taWQvd2FsdGlkLXNzaWtpdC12Y2xpYi9tYXN0ZXIvc3JjL3Rlc3QvcmVzb3VyY2VzL3NjaGVtYXMvV
mVyaWZpYWJsZUlkLmpzb24iLCJ0eXBlIjoiRnVsbEpzb25TY2hlbWFWYWxpZGF0b3IyMDIxIn0sImV
2aWR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DAgTGlsbGUiXX0sIl9zZF9hbGciOiJzaGEtMjU2IiwiaWQiOiJ
1cm46dXVpZDozYWRkOTRmNC0yOGVjLTQyYTEtODcwNC00ZTRhYTUxMDA2YjQiLCJ2YWxpZEZyb20iO
iIyMDIxLTA4LTMxVDAwOjAwOjAwWiIsInR5cGUiOlsiVmVyaWZpYWJsZUNyZWRlbnRpYWwiLCJWZXJ
pZmlhYmxlQXR0ZXN0YXRpb24iLCJWZXJpZmlhYmxlSWQiXSwiaXNzdWVkIjoiMjAyMS0wOC0zMVQwM
DowMDowMFoiLCJAY29udGV4dCI6WyJodHRwczovL3d3dy53My5vcmcvMjAxOC9jcmVkZW50aWFscy9
2MSJdLCJpc3N1ZXIiOiJkaWQ6ZWJzaToyQTlCWjlTVWU2QmF0YWNTcHZzMVY1Q2RqSHZMcFE3YkVza
TJKYjZMZEhLblF4YU4ifQ.5TZ1n6iDHtW3lnKA_7ofSQ-BWyvEr39LThGdIc1OMgUejG6JF6blGkTq
coaQABQJKq6pFgkhjrYcpDG8QcObDA~WyJXeS11VjJDa216SmJ4NGtjeTJQWjF3IiwiZGF0ZU9mQml
ydGgiLCIxOTkzLTA0LTA4Il0~WyJXeS11VjJDa216SmJ4NGtjeTJQWjF3IiwiZGF0ZU9mQmlydGgiL
CIxOTkzLTA0LTA4Il0

Issuance In Action

  • API - Issue an SD-JWT VC using our issuer API.
  • Kotlin/Java - Issue an SD-JWT VC using our verifiable-credentials lib in Kotlin/Java.