Credential Formats
BaseID supports three credential formats, each suited to different use cases and regulatory requirements.
Format Comparison
Section titled “Format Comparison”| Feature | W3C VC (JWT) | SD-JWT VC | ISO mDL (mdoc) |
|---|---|---|---|
| Encoding | JSON / JWT | JSON / JWT | CBOR |
| Selective Disclosure | No (full reveal) | Yes (per-claim) | Yes (per-element) |
| Size | Medium | Medium | Small (binary) |
| eIDAS 2.0 | Supported | Mandated | Mandated |
| Crate | baseid-vc | baseid-sd-jwt | baseid-mdl |
| Standard | W3C VC Data Model 2.0 | IETF SD-JWT VC | ISO/IEC 18013-5 |
W3C Verifiable Credentials (JWT-VC)
Section titled “W3C Verifiable Credentials (JWT-VC)”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.
SD-JWT Verifiable Credentials
Section titled “SD-JWT Verifiable Credentials”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.
ISO mDL (mdoc)
Section titled “ISO mDL (mdoc)”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.
Choosing a Format
Section titled “Choosing a Format”- 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