Query Language
When the Verifier creates an authorization request, it must describe exactly which credentials it will accept and which fields it needs from them. You express those requirements using one of two standard query forms — a DCQL (Digital Credentials Query Language) query or a DIF Presentation Exchange v2 definition — supplied inline in the request body. The wallet uses your query to select matching credentials and, for SD-JWT credentials, to disclose only the requested claims.
Key Concepts
Query forms: Credential requirements are expressed as either a
dcqlQueryobject or apresentationDefinitionobject. Both are standard formats, so wallets that follow the OpenID4VP specification understand them without any vendor-specific extensions.Where the query lives: The query is not stored or referenced by ID — it is sent inline in the body of
POST /verifiers/:verifierId/authorization-requests(and its/qr-codevariant). Each request carries its own query.One form per request: Supply exactly one of
dcqlQueryorpresentationDefinition. If you omit both, the request is rejected with400 Bad Requestand the messageEither dcqlQuery or presentationDefinition must be provided.Sending both passes the service's own input validation but fails downstream for everyversionvalue, surfacing as a500.Paths and filters (Presentation Exchange): Inside a Presentation Exchange input descriptor,
constraints.fieldsuse JSONPath expressions inpathto locate a value in the credential, and an optional JSON Schema (Draft 7)filterto validate it (for exampletype,enum,pattern, orcontains).Selective disclosure: For SD-JWT VC credentials, the claims your query asks for are the claims the wallet selectively discloses. Fields the credential supports but the query does not request stay hidden, so the holder shares only what the Verifier needs.
DCQL Example
DCQL is a compact, credential-centric query format. The following query requests an EmployeeBadge SD-JWT VC and asks the wallet to disclose only the employee_id and department claims:
{
"responseMode": "direct_post.jwt",
"version": "v1",
"dcqlQuery": {
"credentials": [
{
"id": "employee_badge",
"format": "dc+sd-jwt",
"meta": {
"vct_values": ["https://issuer.example.com/vct/employee-badge"]
},
"claims": [
{ "path": ["employee_id"] },
{ "path": ["department"] }
]
}
]
}
}formatis the requested credential format (for exampledc+sd-jwtfor SD-JWT VC).meta.vct_valuesrestricts the request to credentials with a matchingvct(verifiable credential type).Each entry in
claimsnames a claim with apath, and those are the claims the wallet discloses.
Presentation Exchange Example
A DIF Presentation Exchange v2 definition is more verbose but lets you attach JSON Schema filters to individual fields. presentationDefinition requires version v1.draft21 or v1.draft24 (the default v1 supports only dcqlQuery). The following definition requests a credential whose type array contains EmploymentCredential and whose subject is identified by a did:web identifier:
pathholds one or more JSONPath expressions; the first one that resolves is used.filteris a JSON Schema (Draft 7) the extracted value must satisfy. Use a method-agnostic pattern (for example^did:.*$) when you do not need to constrain the DID method.
Response
A successful request returns the authorization request URI and the verification session you can poll or stream for results:
Pick whichever form fits your stack — both let you constrain credential types, claims, and field values.
Last updated