Skip to content

Credential Formats

BaseID supports three credential formats, each suited to different use cases and regulatory requirements.

FeatureW3C VC (JWT)SD-JWT VCISO mDL (mdoc)
EncodingJSON / JWTJSON / JWTCBOR
Selective DisclosureNo (full reveal)Yes (per-claim)Yes (per-element)
SizeMediumMediumSmall (binary)
eIDAS 2.0SupportedMandatedMandated
Cratebaseid-vcbaseid-sd-jwtbaseid-mdl
StandardW3C VC Data Model 2.0IETF SD-JWT VCISO/IEC 18013-5

The most widely adopted format. Credentials are JSON objects signed as JWTs. Simple to implement and broadly interoperable.

use baseid_vc::{sign_credential_jwt, verify_credential_jwt};

Best for: general-purpose credentials, interoperability with existing systems.

Extends JWT-VC with selective disclosure. The holder can reveal only specific claims to a verifier, preserving privacy.

use baseid_sd_jwt::{SdJwtIssuer, SdJwtHolder, SdJwtVerifier};

Best for: privacy-sensitive credentials, eIDAS 2.0 compliance, government-issued identity.

Binary CBOR-based format designed for mobile driving licences. Compact, efficient, and supports both online and offline verification.

use baseid_mdl::{MdlIssuer, MdlVerifier};

Best for: driving licences, government ID, offline verification, constrained environments.

  • Start with JWT-VC if you need broad compatibility
  • Use SD-JWT when privacy and selective disclosure matter
  • Use mDL for driving licences or when binary efficiency is required
  • For eIDAS 2.0 compliance, you will need both SD-JWT and mDL