DCQL (Digital Credential Query Language)
The Digital Credential Query Language (DCQL, pronounced "dak-l") is a JSON-based query language introduced in the OpenID for Verifiable Presentations (OpenID4VP) 1.0 specification. It enables verifiers to express precise requirements for the credentials they need from a holder's wallet.
A DCQL query is a JSON object with two top-level properties:
credentials(required): An array of Credential Query objects, each describing a specific credential the verifier is interested in.credential_sets(optional): An array defining logical groupings and requirements across the requested credentials.
For the full specification, business context, and real-world payment examples, see our concepts article on DCQL in the EUDI Wallet ecosystem.
Building Blocks
DCQL provides a small set of composable building blocks that cover a wide range of verification scenarios:
| Building block | Purpose |
|---|---|
| Credential Query | Requests a specific credential by format, metadata, and claims. The fundamental unit of a DCQL query. |
trusted_authorities | Restricts the credentials to issuers on an ETSI list that is a trust anchor of your organisation (kind ETSI TL or ETSI LOTE; etsi_tl), or under a CA with a given authority key identifier (aki). It does not depend on the Require switch of the query, and an aki is only a filter, not a proof of trust. |
claims | Specifies which individual claims within a credential are requested, enabling selective disclosure. |
claim_sets | Defines acceptable combinations of claims, allowing preferred claims with fallback alternatives. |
credential_sets | Groups multiple credential queries with logical rules (AND/OR), supporting mandatory and optional sets. |
multiple | When set to true, allows several instances of the same credential type to be returned in a single flow. |
values | Constrains accepted claim values to a predefined allowed list. |
Rules of the iGrant.io API
Store the DCQL query in a presentation definition (POST /v4/config/ows/verifier/presentation-definitions) with version set to version_01. The API validates the query when you save it:
- Every Credential Query needs
id,formatandmeta. Theidholds letters, digits,_and-only. - The
formatsets themetakey:vct_valuesfordc+sd-jwt,doctype_valueformso_mdoc, andtype_valuesforjwt_vc_json. - An
mso_mdocclaim path holds exactly two strings: the namespace and the data element. - A
jwt_vc_jsonclaim path starts with a member of the credential, so a subject claim starts withcredentialSubject. claimsandtrusted_authoritiesmust not be empty if you send them, andclaim_setsrequiresclaims.
See Create presentation definition for the full list.
The verification record keeps only the claims that the query requests. If a wallet discloses a claim that the query did not request, the presentation is still verified, but the claim is not stored in the record (presentation, vpToken and the webhook event). A Credential Query without claims requests no selectively disclosable claims (OpenID4VP 1.0 section 6.4.1). When the verifier rejects a presentation, each entry of presentationValidity contains the reason as an error with a code, for example PRES_META_MISMATCH (the credential type is not in meta) or PRES_TRUSTED_AUTHORITY_MISMATCH (no entry of trusted_authorities matches the issuer).
Requesting a PID
A PID (Person Identification Data) in SD-JWT VC format has the base type urn:eudi:pid:1 or a domestic type of a Member State, for example urn:eudi:pid:se:1 (PID Rulebook, section 4.2). The verifier compares the vct of the presented PID with meta.vct_values exactly. Configure a PID query as follows:
- List each PID type that you accept in
vct_values: the base type and each domestic type. If a wallet presents a domestic PID for a query that lists only the base type, the verifier rejects it withPRES_META_MISMATCH. - Add
trusted_authorities(etsi_tlwith the URL of a trust anchor of kind ETSI TL or ETSI LOTE of your organisation that contains the PID providers, orakiwith the key identifier of a PID provider's CA), so that the wallet offers only matching PIDs. The API rejects anetsi_tlvalue that is not the URL of an ETSI list trust anchor of your organisation, and anakivalue is only a filter. Astrusted_authoritiesdo not set the Require switch, enforce the trust of the PID provider (PID Rulebook, section 6) withcredentialQueryOptions.<id>.requiresTrustedCredentialSignerandacceptedCredentialSignersin the presentation definition; the list is required when the switch is on. Without these settings, no check runs,presentationValidity[].<id>.credentialSignerTrustedListCheck(the<id>of the Credential Query) has thereason.codenot_required, and the verifier accepts a PID from a provider that it does not trust.
{
"credentials": [
{
"id": "pid",
"format": "dc+sd-jwt",
"meta": { "vct_values": ["urn:eudi:pid:1", "urn:eudi:pid:se:1"] },
"trusted_authorities": [
{ "type": "etsi_tl", "values": ["https://pid-providers.example/trusted-list.xml"] }
],
"claims": [
{ "path": ["family_name"] },
{ "path": ["given_name"] },
{ "path": ["birthdate"] }
]
}
]
}
Developer Workflow Examples
Each example below demonstrates a specific DCQL building block through a complete developer workflow with runnable API calls. The examples ask the holder wallet for credentials that it already holds, so first issue the ones you need on Issue the Test Credentials. You can also try these scenarios live in the iGrant.io DCQL demos and watch walkthroughs on the iGrant.io YouTube channel.
| Example | DCQL feature | Scenario |
|---|---|---|
| Trusted Authorities | trusted_authorities | Request a University Degree credential only from issuers on an ETSI trusted list. |
| Claim Sets (Selective Disclosure) | claim_sets | Verify age from the EU age verification attestation, preferring the age_over_16 claim and falling back to age_over_18. |
| Credential Sets (Alternatives) | credential_sets | Accept any one of a Passport, PID, or Photo ID for proof of identity. |
| Combined Credential Sets | Multiple required credential_sets | Require a Photo ID plus a Proof of Address (Utility Bill or Bank Statement). |
| Mandatory and Optional Sets | Mandatory + optional credential_sets | Require PID and student proof, with optional address proof for an additional discount. |
| Multiple Credential Instances | multiple: true | Request several recent Bank Statement credentials in a single verification flow. |
| Values Constraint | values | Accept a PID credential only if the postal code matches an allowed list. |
Related
- OpenID4VP credential verification shows where a DCQL query fits in the full verifier flow.
- OpenID4VCI credential issuance covers how the credentials that DCQL queries are first issued.