Which hash algorithm applies when an SD-JWT has no _sd_alg claim?

Default _sd_alg of sha-256 when not present at the top levelRFC 9901 §4.1.1MUSTRoles: issuer, holder, verifier

Requirement as recorded in the ProtocolSoup registry

If the _sd_alg claim is not present at the top level, a default value of sha-256 MUST be used.

Read §4.1.1 in RFC 9901

Self-test verdict

PassCommit 00bac3fEvaluated

This is ProtocolSoup's result against its own implementation at the commit shown. It is not a certification of ProtocolSoup or of any other product.

Captured from production

Captured Commit 00bac3f

Captured from the deployed ProtocolSoup at the commit shown. Every request and response is shown exactly as sent and received.

Passing exchange

Not captured: The issuer writes _sd_alg into the payload it signs for every SD-JWT VC, and removing the claim breaks that signature, so no presentation the verifier allows relies on the default.

Failing exchange

Rejected, as requiredConformance client

The conformance client removes _sd_alg from the payload of an SD-JWT VC the issuer issued to it and replaces each _sd digest with the sha-384 digest of the same Disclosure. This changes signed content, so the issuer's signature no longer verifies either. It presents the result with a Key Binding JWT in a direct_post response to /oid4vp/response. A verifier that applies the sha-256 default finds none of the Disclosures referenced by a digest, and must report that in the result at /oid4vp/result.

Requests from ProtocolSoup’s conformance client, which sends malformed messages on purpose. The hosted wallet never sends these.

  1. 1.GET https://protocolsoup.com/oid4vp/request/nmW8Hio7DsNYm0XahBiTt-eq200 OK

    TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2

    Request

    GET /oid4vp/request/nmW8Hio7DsNYm0XahBiTt-eq HTTP/2.0
    Accept: application/oauth-authz-req+jwt
    Host: protocolsoup.com
    User-Agent: ProtocolSoup-Conformance-Client/1
    
    

    Response

    HTTP/2.0 200 OK
    Cf-Cache-Status: DYNAMIC
    Cf-Ray: a65bb1fb5a593cdb-MSP
    Content-Length: 1650
    Content-Type: application/oauth-authz-req+jwt
    Date: Sun, 06 Dec 2026 13:39:11 GMT
    Fly-Request-Id: 01M95S8Y94CC4D85YZSBS9V23S-ord
    Nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
    Referrer-Policy: strict-origin-when-cross-origin
    Report-To: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=sd4dcZW5yfMv0khFpIryEpQAHo6NWcKw3rK7EdENsyIOaZH8Ktt40MNy0OUj%2BPvSw2vp43SeJV0u0R7MdI6uLB5uLMeee2EiUTBJZ9%2Fk2jqJF72ULydlnAfvVRbyURve8w0%3D"}]}
    Server: cloudflare
    Speculation-Rules: "/cdn-cgi/speculation"
    Vary: Origin
    Via: 1.1 fly.io, 1.1 fly.io
    X-Content-Type-Options: nosniff
    X-Frame-Options: DENY
    X-Xss-Protection: 1; mode=block
    
    eyJhbGciOiJSUzI1NiIsImtpZCI6InJzYS05YTJlNThlYzVjNjk3NGJmIiwidHlwIjoib2F1dGgtYXV0aHotcmVxK2p3dCJ9.eyJhdWQiOiJodHRwczovL3NlbGYtaXNzdWVkLm1lL3YyIiwiY2xpZW50X2lkIjoicmVkaXJlY3RfdXJpOmh0dHBzOi8vcHJvdG9jb2xzb3VwLmNvbS9vaWQ0dnAvcmVzcG9uc2UiLCJjbGllbnRfbWV0YWRhdGEiOnsidnBfZm9ybWF0c19zdXBwb3J0ZWQiOnsiZGMrc2Qtand0Ijp7ImtiLWp3dF9hbGdfdmFsdWVzIjpbIkVTMjU2Il0sInNkLWp3dF9hbGdfdmFsdWVzIjpbIkVTMjU2Il19LCJqd3RfdmNfanNvbiI6eyJhbGdfdmFsdWVzIjpbIkVTMjU2IiwiUlMyNTYiLCJFZERTQSJdfSwibGRwX3ZjIjp7InByb29mX3R5cGVfdmFsdWVzIjpbIkRhdGFJbnRlZ3JpdHlQcm9vZiIsIkVkMjU1MTlTaWduYXR1cmUyMDIwIl19LCJtc29fbWRvYyI6eyJkZXZpY2VhdXRoX2FsZ192YWx1ZXMiOlstN10sImlzc3VlcmF1dGhfYWxnX3ZhbHVlcyI6Wy03XX19fSwiZGNxbF9xdWVyeSI6eyJjcmVkZW50aWFscyI6W3siZm9ybWF0IjoiZGMrc2Qtand0IiwiaWQiOiJkZWdyZWUiLCJtZXRhIjp7InZjdF92YWx1ZXMiOlsiaHR0cHM6Ly9wcm90b2NvbHNvdXAuY29tL2NyZWRlbnRpYWxzL3VuaXZlcnNpdHlfZGVncmVlIl19fV19LCJleHAiOjE3OTY1NjQ2NTAsImlhdCI6MTc5NjU2NDM1MCwiaXNzIjoicmVkaXJlY3RfdXJpOmh0dHBzOi8vcHJvdG9jb2xzb3VwLmNvbS9vaWQ0dnAvcmVzcG9uc2UiLCJqdGkiOiJubVc4SGlvN0RzTlltMFhhaEJpVHQtZXEiLCJub25jZSI6IndPMXBsMVprX1h0aVpjZ2VuYXJaMGtpd0lxWjYzTXpPNkc2aUJYMENOVHMiLCJyZXNwb25zZV9tb2RlIjoiZGlyZWN0X3Bvc3QiLCJyZXNwb25zZV90eXBlIjoidnBfdG9rZW4iLCJyZXNwb25zZV91cmkiOiJodHRwczovL3Byb3RvY29sc291cC5jb20vb2lkNHZwL3Jlc3BvbnNlIiwic3RhdGUiOiJEX2tFU1h5cGRGZy1VbEpRV2NHRTVNbWsifQ.nTRpIjkMbota2IGV2e_Np8kG9orLZyEKxpfL3YDEq-S9H9i6cd4IDTab999L9LxdnGhvvdSClZ_AvMiegW01Br706IZ-qNDpHjNWr3LibBFc8cCzcSg_VwERQJHrJhCO2QfPgPdyMtkRg0z_JdhUkxJKk0y17-GFKfbVpO77sft1Lz931Ma8XF3ueykZsW1YvEUW6B-RYUmZkhyBvyClQ4rJKDplrH6wUJFc0Lmx3AjOXtFUlOhRxFoS6QdIwSOFF-2orANP3PUSh2LocPx_URxZ7iHTUeVYgB-mLQTBpRyVOBpkuu0YqKZT1zUwKyig4NJMaxxHUtCssgljZRjSHQ
  2. 2.POST https://protocolsoup.com/oid4vp/response200 OK

    TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2

    Request

    POST /oid4vp/response HTTP/2.0
    Content-Length: 3084
    Content-Type: application/x-www-form-urlencoded
    Host: protocolsoup.com
    User-Agent: ProtocolSoup-Conformance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wibmJmIjoxNzk2NTE1MjAwLCJzdWIiOiJhbGljZSIsInZjdCI6Imh0dHBzOi8vcHJvdG9jb2xzb3VwLmNvbS9jcmVkZW50aWFscy91bml2ZXJzaXR5X2RlZ3JlZSJ9.0Dow7gI6ByD3h23SSrvo05kr9Z1RLDgj0PSupO0-ncXhD_yrbmA3VHQVp_A2E9ORf--CSuABg9P51VlmwobG8Q~WyJNbzRoYmdGQVhSNWcweS1tX1VXam1nIiwiZGVncmVlIiwiQmFjaGVsb3Igb2YgRW5naW5lZXJpbmciXQ~WyJJQnNNZzcycGJLWXBKTk9yczAyYjBRIiwiZGVwYXJ0bWVudCIsIkVuZ2luZWVyaW5nIl0~WyI5R1dxX3pqNnkwVTk4MlF0bUxLTGdBIiwiZmFtaWx5X25hbWUiLCJKb2huc29uIl0~WyJCNEJRd1ppS1dUUS1rdE0yOHE0NGhBIiwiZ2l2ZW5fbmFtZSIsIkFsaWNlIl0~WyJ0ZWVrMFkwNy12dG1OUG1EYzk0VmVRIiwiZ3JhZHVhdGlvbl95ZWFyIiwyMDE4XQ~eyJhbGciOiJFUzI1NiIsInR5cCI6ImtiK2p3dCJ9.eyJhdWQiOiJyZWRpcmVjdF91cmk6aHR0cHM6Ly9wcm90b2NvbHNvdXAuY29tL29pZDR2cC9yZXNwb25zZSIsImlhdCI6MTc5NjU2NDM1MSwibm9uY2UiOiJ3TzFwbDFaa19YdGlaY2dlbmFyWjBraXdJcVo2M016TzZHNmlCWDBDTlRzIiwic2RfaGFzaCI6IndiWUcyekxWQXdWTDVoSlNTUTUtZkYxVzg2WXlwQzRiTXc4XzlDWEhRRkEifQ.AYRLnTKYlfmmHZ8ExDsShcD7PEE5pW0v1HdagMZHS6JcAd6Kcz6UtgVvPW4JSCPg-hFviHPcrs0kRGiRtWYbVQ%22%5D%7D

    Response

    HTTP/2.0 200 OK
    Cache-Control: no-store
    Cf-Cache-Status: DYNAMIC
    Cf-Ray: a65bb20198a53cdb-MSP
    Content-Type: application/json
    Date: Sun, 06 Dec 2026 13:39:12 GMT
    Fly-Request-Id: 01M95S8Z8C4V8SM96GKMHNQ1P2-ord
    Nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
    Pragma: no-cache
    Referrer-Policy: strict-origin-when-cross-origin
    Report-To: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=KsTj2faBdMX4fc4vOPeFSzdKvmvAmoGDpaYnUV%2BKYO4oyxqNitvt3GFpPU4gOdnFtabVHZ4xhplPNSWjK86PbdIo5kA9fiTso0uXAhwgIGxXk1vjg3q9tNX5%2BgHqAm7YSQo%3D"}]}
    Server: cloudflare
    Server-Timing: cfCacheStatus;desc="DYNAMIC"
    Server-Timing: cfEdge;dur=3,cfOrigin;dur=218
    Vary: Origin
    Vary: accept-encoding
    Via: 1.1 fly.io, 1.1 fly.io
    X-Content-Type-Options: nosniff
    X-Frame-Options: DENY
    X-Xss-Protection: 1; mode=block
    
    {}
    
  3. 3.GET https://protocolsoup.com/oid4vp/result/nmW8Hio7DsNYm0XahBiTt-eq200 OK

    TLS: TLS 1.3 · TLS_AES_128_GCM_SHA256 · h2

    Request

    GET /oid4vp/result/nmW8Hio7DsNYm0XahBiTt-eq HTTP/2.0
    Host: protocolsoup.com
    User-Agent: ProtocolSoup-Conformance-Client/1
    
    

    Response

    HTTP/2.0 200 OK
    Cache-Control: no-store
    Cf-Cache-Status: DYNAMIC
    Cf-Ray: a65bb207ded43cdb-MSP
    Content-Type: application/json
    Date: Sun, 06 Dec 2026 13:39:13 GMT
    Fly-Request-Id: 01M95S907NVNJW0AV2KXJA49XQ-ord
    Nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
    Pragma: no-cache
    Referrer-Policy: strict-origin-when-cross-origin
    Report-To: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=0hgO0oomhoqd7wtm%2BD%2B8GyN7oVAjMtJTZoArlwIilmu6JXlXuh51OBHC1EGaAu4e8qlDwSHspguzWsKk9Nf8VazFFh5pzQ1e84dfFrchIWF7BvDq%2BgPUNqUMMYaIMOFG8mM%3D"}]}
    Server: cloudflare
    Server-Timing: cfCacheStatus;desc="DYNAMIC"
    Server-Timing: cfEdge;dur=4,cfOrigin;dur=211
    Speculation-Rules: "/cdn-cgi/speculation"
    Vary: Origin
    Vary: accept-encoding
    Via: 1.1 fly.io, 1.1 fly.io
    X-Content-Type-Options: nosniff
    X-Frame-Options: DENY
    X-Xss-Protection: 1; mode=block
    
    {"request_id":"nmW8Hio7DsNYm0XahBiTt-eq","result":{"nonce_validated":true,"audience_validated":true,"expiry_validated":true,"holder_binding_verified":false,"credential_evidence":{"subject":"alice","format":"dc+sd-jwt","vct":"https://protocolsoup.com/credentials/university_degree","issuer":"https://protocolsoup.com/oid4vci"},"credential_evidence_set":[{"subject":"alice","format":"dc+sd-jwt","vct":"https://protocolsoup.com/credentials/university_degree","issuer":"https://protocolsoup.com/oid4vci"}],"policy":{"allowed":false,"code":"disclosure_invalid","message":"Presentation denied: disclosure digest for claim \"department\" is not referenced by the issuer payload","reasons":["disclosure digest for claim \"department\" is not referenced by the issuer payload","presented dc+sd-jwt credential parse failed: process sd-jwt disclosures: disclosure digest for claim \"degree\" is not referenced by the issuer payload"],"reason_codes":["disclosure_invalid","credential_malformed"],"evaluated_at":"2026-12-06T13:39:12.373568891Z"}},"status":"completed"}
    

Tests

Implementation

Explainer

What this requires

The _sd_alg claim names the hash algorithm the Issuer used to compute Disclosure digests. RFC 9901 Section 4.1.1 states: "If the _sd_alg claim is not present at the top level, a default value of sha-256 MUST be used." An Issuer may omit the claim, and a Holder or Verifier that finds no top-level _sd_alg hashes each Disclosure with SHA-256.

The same section adds: "To promote interoperability, implementations MUST support the sha-256 hash algorithm." The default is also the algorithm for sd_hash in the KB-JWT, which Section 4.3.1 defines as "the _sd_alg element in the Issuer-signed JWT or the default value".

Why it exists

Digests are only comparable when both sides hash with the same function. Without a fixed default, a payload that omits _sd_alg leaves the Verifier to guess, and a wrong guess makes every honest Disclosure look uncommitted. Pinning the default to sha-256, which every implementation must support, removes the guess.

What non-compliance looks like

A verifier that treats a missing _sd_alg as an error rejects valid SD-JWTs from Issuers that rely on the default. One that falls back to some other algorithm computes digests that never match, and reports every presented Disclosure as not referenced by the Issuer-signed JWT.

How ProtocolSoup tests it

sdJWTHashAlgorithm returns sha-256 when the payload has no _sd_alg. When the claim is present it must be a non-empty string without surrounding whitespace, and any value other than sha-256 is rejected as "unsupported _sd_alg". SDJWTDisclosureDigest always hashes with SHA-256, which is consistent because that is the only accepted value. The ProtocolSoup Issuer always writes "_sd_alg": "sha-256" explicitly.

TestSDJWTDisclosureDigestsExtractsNestedCommitments asserts that SDJWTDisclosureDigests returns the two digests from a nested _sd array, and TestSDJWTDisclosureDigestsRejectsUnsupportedAlgorithm asserts that "_sd_alg": "sha-512" is rejected. The first sets "_sd_alg": "sha-256" explicitly, so neither listed test exercises the default for a payload with no _sd_alg. Other tests in the same file, such as TestProcessSDJWTDisclosuresRejectsPermanentClaimCollision, do process payloads without _sd_alg whose digests match only under SHA-256, which is indirect evidence.

Messages that carry it

Related requirements

All RFC 9901 requirements · OID4VCI protocol page