Skip to main content

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 blockPurpose
Credential QueryRequests a specific credential by format, metadata, and claims. The fundamental unit of a DCQL query.
trusted_authoritiesRestricts 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.
claimsSpecifies which individual claims within a credential are requested, enabling selective disclosure.
claim_setsDefines acceptable combinations of claims, allowing preferred claims with fallback alternatives.
credential_setsGroups multiple credential queries with logical rules (AND/OR), supporting mandatory and optional sets.
multipleWhen set to true, allows several instances of the same credential type to be returned in a single flow.
valuesConstrains 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, format and meta. The id holds letters, digits, _ and - only.
  • The format sets the meta key: vct_values for dc+sd-jwt, doctype_value for mso_mdoc, and type_values for jwt_vc_json.
  • An mso_mdoc claim path holds exactly two strings: the namespace and the data element.
  • A jwt_vc_json claim path starts with a member of the credential, so a subject claim starts with credentialSubject.
  • claims and trusted_authorities must not be empty if you send them, and claim_sets requires claims.

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 with PRES_META_MISMATCH.
  • Add trusted_authorities (etsi_tl with the URL of a trust anchor of kind ETSI TL or ETSI LOTE of your organisation that contains the PID providers, or aki with the key identifier of a PID provider's CA), so that the wallet offers only matching PIDs. The API rejects an etsi_tl value that is not the URL of an ETSI list trust anchor of your organisation, and an aki value is only a filter. As trusted_authorities do not set the Require switch, enforce the trust of the PID provider (PID Rulebook, section 6) with credentialQueryOptions.<id>.requiresTrustedCredentialSigner and acceptedCredentialSigners in 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 the reason.code not_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.

ExampleDCQL featureScenario
Trusted Authoritiestrusted_authoritiesRequest a University Degree credential only from issuers on an ETSI trusted list.
Claim Sets (Selective Disclosure)claim_setsVerify age from the EU age verification attestation, preferring the age_over_16 claim and falling back to age_over_18.
Credential Sets (Alternatives)credential_setsAccept any one of a Passport, PID, or Photo ID for proof of identity.
Combined Credential SetsMultiple required credential_setsRequire a Photo ID plus a Proof of Address (Utility Bill or Bank Statement).
Mandatory and Optional SetsMandatory + optional credential_setsRequire PID and student proof, with optional address proof for an additional discount.
Multiple Credential Instancesmultiple: trueRequest several recent Bank Statement credentials in a single verification flow.
Values ConstraintvaluesAccept a PID credential only if the postal code matches an allowed list.