Beta

Create a tenant

A new tenant starts with its own users, OAuth settings, audit history and logs. You are its first Tenant Admin.

Selective disclosure with SD-JWT

Northwind needs Riley's course and result but not their email address, and a signature covers exact bytes. This lesson shows how SD-JWT lets Cedar sign a credential from which Riley's wallet can reveal chosen claims, what leaving a claim out does and does not say, how a Key Binding JWT stops a copied presentation, and what still links presentations together.

Reveal a chosen claim without editing the signature

Riley's course credential from Cedar carries three claims: the course, their result, and their email address. Northwind's project prerequisite needs the first two. It has no use for their email, and Riley would rather not hand it to every organization that asks about their training.

The obvious fix does not work. If Riley's wallet deleted the email from a signed credential before sending it, the bytes would no longer match what Cedar signed, and Northwind's signature check would fail. As Digital signatures showed, a signature covers exact bytes. Cedar would need to sign something that commits to each claim without containing it, so that Riley can choose later which ones to open.

Selective Disclosure for JWTs (SD-JWT) does this with hashes. For each claim Riley may want to hide, Cedar builds a disclosure: a small JSON array holding a random value called a salt, the claim name, and the claim value, encoded as base64url. Cedar then hashes the encoded disclosure with SHA-256 and puts only that digest in the credential it signs. Here is the course claim at each step. The values are fictional but computed for real, so the digest can be checked with the commands from Encoding and hashing.

Disclosure, decoded
["2GLC42sKQveCfGfryNRN9w", "course", "cedar-basic"]

Disclosure, as sent (base64url of the JSON text above)
WyIyR0xDNDJzS1F2ZUNmR2ZyeU5STjl3IiwgImNvdXJzZSIsICJjZWRhci1iYXNpYyJd

Digest (base64url of SHA-256 over the ASCII characters of the disclosure as sent)
HO15b7DCnJyXa9P9oifSZALazMOWc32Xy9EvfhhYfrs

The other two claims get disclosures of their own, each with a fresh salt. Cedar collects the three digests into an _sd array, names the hash algorithm in _sd_alg, and signs the result as an ordinary JWT, the issuer-signed part of the credential. Its vct claim names the credential type, and cnf carries the public key of Riley's wallet, which matters later in this lesson.

Header
{
  "alg": "ES256",
  "typ": "dc+sd-jwt",
  "kid": "cedar-vc-2026"
}

Payload
{
  "iss": "https://credentials.cedar.example",
  "vct": "https://credentials.cedar.example/course-completion",
  "iat": 1790949600,
  "exp": 1854108000,
  "_sd": [
    "HO15b7DCnJyXa9P9oifSZALazMOWc32Xy9EvfhhYfrs",
    "S8hPwrZZfOnCH-WUVng4EFbsZtM0201EgX5TNps1InY",
    "nOTrYNS9nfFIx79U5zkdk-epAf3IIMl2EwpFYrFubdc"
  ],
  "_sd_alg": "sha-256",
  "cnf": {
    "jwk": {
      "kty": "EC",
      "crv": "P-256",
      "x": "HUHZ44gDzvw4dKiztjfbdX4GkPgE6eKHu3r3f1wgfa4",
      "y": "aA19bcDxYdJl4ALGshINuCEjHSA-O_Z9UQOI6uhDhRU"
    }
  }
}
Illustrative disclosures in Riley's credential and their digests
ClaimDisclosure, decodedDigest in _sd
course["2GLC42sKQveCfGfryNRN9w", "course", "cedar-basic"]HO15b7DCnJyXa9P9oifSZALazMOWc32Xy9EvfhhYfrs
result["iVGjNB1Y1MKQ_QDeJIWwnQ", "result", "passed"]S8hPwrZZfOnCH-WUVng4EFbsZtM0201EgX5TNps1InY
email["FT65bMhvvRrZi6cfjB9MXA", "email", "[email protected]"]nOTrYNS9nfFIx79U5zkdk-epAf3IIMl2EwpFYrFubdc

The salt is what keeps a hidden claim hidden. Without it, Northwind could hash the guess ["result", "failed"], compare it with the digests, and learn Riley's result without being shown it. A random salt that only the wallet knows makes that guessing useless.

Cedar hands Riley's wallet the signed JWT together with all three disclosures. When they present to Northwind, the wallet sends the signed JWT followed by only the disclosures they choose, separated by tildes: <issuer-signed JWT>~<course disclosure>~<result disclosure>~. Northwind first verifies Cedar's signature over the JWT. Then, for each disclosure, it repeats Cedar's step: hash the characters it received, and look for the result in the signed _sd array. A match means the claim is one Cedar signed, and Northwind adds it to the claims it will use.

Suppose someone edits the course disclosure to claim the advanced course, keeping the same salt:

Presented:   WyIyR0xDNDJzS1F2ZUNmR2ZyeU5STjl3IiwgImNvdXJzZSIsICJjZWRhci1hZHZhbmNlZCJd
Decodes to:  ["2GLC42sKQveCfGfryNRN9w", "course", "cedar-advanced"]
Recomputed:  U5bZ3Fh3oNXGb8jVK0QjyYqpyT-gzeLVZhvyfkGzPxk
In _sd?      no  ->  reject the presentation

Changing one word produced a completely different digest, and nothing in the signed array matches it. Producing a disclosure that hashes to one of Cedar's digests would mean breaking SHA-256, and adding a new digest would break Cedar's signature. A disclosure that matches nothing is not quietly ignored: the whole presentation is rejected.

Omission is not a new assertion

Riley sends the course and result disclosures and keeps the email back. Northwind still sees all three digests in the signed JWT, including one it cannot open. It is tempting to read the unopened digest as proof that one real claim was held back, but even that much is not guaranteed. SD-JWT lets an issuer add decoy digests: entries in _sd that match no disclosure at all, put there precisely so a verifier cannot count how many real claims exist or tell that anything was withheld. So an unopened digest means only that something might have been held back, and Northwind learns nothing about what. The same mechanism can hide array elements, not just whole claims, by placing a digest in the array in place of the value.

Illustrative reading of Riley's presentation to Northwind
ClaimIn this presentationWhat Northwind may conclude
courseDisclosed, digest matchesCedar signed cedar-basic
resultDisclosed, digest matchesCedar signed passed
emailNot disclosedNothing about the email: not that it is empty, missing, or any particular address

Hiding a claim gives Riley no new powers over the ones they show. They cannot change their result, because any edited disclosure fails the digest check. They cannot assert that the hidden email is false or blank, because an absent disclosure asserts nothing. And if Northwind's policy required a claim they chose not to send, the presentation simply does not meet the policy. Northwind refuses it, or asks again, rather than filling the gap with a guess.

Northwind's checks have to be the real ones. Decoding the JWT and reading the disclosures is inspection, useful for understanding a credential and worth nothing as verification. The verifier checks Cedar's signature with a key from Cedar's published metadata, confirms that Cedar is an accepted issuer for this credential type and that the credential is within its validity period, and processes every disclosure against the digests. It also rejects the odd cases a careless parser might accept: a digest that appears more than once, or a disclosed claim whose name is already used by a claim visible in the signed payload. A changed disclosure must fail even when its JSON looks perfectly plausible.

Holder binding is an independent policy

Everything so far can be copied. If Riley's presentation were captured from a log, anyone could send the same string to Northwind, and every digest would still match. The cnf claim is what stops this. Cedar put the public key of Riley's wallet in the signed JWT, so the wallet can prove it holds the matching private key.

It does so with a Key Binding JWT (KB-JWT), a small JWT the wallet signs at presentation time and appends after the last tilde. Its payload says who the presentation is for and which exchange it answers:

Presentation (shortened, line breaks added; the real value is one string)
eyJhbGciOiJFUzI1NiIsInR5cCI6ImRjK3NkLWp3dCIsImtpZCI6ImNlZGFyLXZjLTIwMjYifQ.eyJpc3Mi...KH2A
~WyIyR0xDNDJzS1F2ZUNmR2ZyeU5STjl3IiwgImNvdXJzZSIsICJjZWRhci1iYXNpYyJd
~WyJpVkdqTkIxWTFNS1FfUURlSklXd25RIiwgInJlc3VsdCIsICJwYXNzZWQiXQ
~eyJhbGciOiJFUzI1NiIsInR5cCI6ImtiK2p3dCJ9.eyJpYXQi...pAdDg

KB-JWT header
{
  "alg": "ES256",
  "typ": "kb+jwt"
}

KB-JWT payload
{
  "iat": 1792145700,
  "aud": "x509_san_dns:verifier.northwind.example",
  "nonce": "Zf_4b7lKBqU3rsSa",
  "sd_hash": "YzKgFDtlP1f7B_5DZ2AW5qBQJw81Yvx4JP9ry862Vpw"
}

The aud names Northwind's verifier, by an identifier taken from the DNS name in its certificate, and nonce is the random value Northwind generated for this request. The iat says when the wallet signed it, so Northwind can refuse proofs that are too old. The sd_hash is a SHA-256 digest, again in base64url, of everything before the KB-JWT: the issuer-signed JWT, the two chosen disclosures, and their tildes. That ties the proof to exactly this selection, so it cannot be cut off and attached to a different set of disclosures. Northwind checks the KB-JWT's signature against the key in cnf, recomputes sd_hash, and compares aud and nonce with the request it actually sent.

Whether the KB-JWT is required is Northwind's decision, made from its policy before the presentation arrives. Some uses do not need it. Northwind's project prerequisite does, because a course result anyone could replay would prove nothing about the person asking. That is why one tempting shortcut is a real fault: checking the KB-JWT carefully when it is present, and skipping the check when it is absent. A presentation without a KB-JWT simply ends at the last tilde, and anyone who copied Riley's presentation could strip the KB-JWT off and send what remains. With binding required, a missing KB-JWT is a refusal, not a quieter path through the verifier.

Minimize more than the visible fields

Hiding the email does not make Riley anonymous to Northwind, and it does not stop presentations being linked. Every presentation of this credential carries the same issuer signature, the same cnf key, and the same _sd digests. If Northwind and another organization compared what they received, those values would match exactly and show that the same credential, and so the same person, visited both. The disclosed values can identify them too, and so can when and from where their wallet connected. Some issuers reduce the signature and key overlap by giving the wallet several copies of a credential, each with its own salts and key, so each verifier can see a different one. Whether that happens depends on the issuer and wallet, not on the format alone.

Minimizing, then, starts with the request. Northwind asks for the course and the result because the prerequisite needs exactly those, and Riley's wallet can tell them plainly what is being asked and why. It continues in Northwind's own records. The verifier needs to remember that Riley's presentation met the prerequisite on 16 October and which check refused a failed one. It does not need the salts, the disclosures, or the raw presentation in its routine logs, where they would be one more copy of Riley's data to protect.

Check your understanding

Try these questions before moving on. If an answer isn't right, use the feedback and try again.

Riley presents the course and result disclosures and leaves out the email disclosure. What may Northwind conclude about Riley's email? 1 of 3

Choose one answer.

Northwind's policy requires holder binding. A presentation arrives with valid disclosures but no Key Binding JWT, ending at the last tilde. What should the verifier do? 2 of 3

Choose one answer.

Someone edits Riley's course disclosure to say cedar-advanced, keeping the same salt, and sends it with Cedar's signed JWT. What does Northwind's verifier find? 3 of 3

Choose one answer.

Try it in the Lab

We value your privacy

We use cookies and similar technologies to enhance your browsing experience, and analytics to understand our traffic. By clicking "Allow all", you consent to optional analytics. Cookie Policy

Learn identity