Skip to content

IDProva launches April 7 — Registry packages coming at launch. Build from source now.

Cryptography

IDProva employs a hybrid signature scheme combining Ed25519 (classical) with ML-DSA-65 (post-quantum, FIPS 204). An attacker must break both algorithms to forge a signature.

Rationale: NIST standardised ML-DSA (formerly CRYSTALS-Dilithium) in FIPS 204. While ML-DSA is believed quantum-resistant, it has less cryptanalytic history than Ed25519. The hybrid approach provides defense in depth.

Given a message M and key pairs (sk_ed, pk_ed) for Ed25519 and (sk_ml, pk_ml) for ML-DSA-65:

HybridSign(M, sk_ed, sk_ml):
1. sig_ed = Ed25519_Sign(sk_ed, M)
2. sig_ml = MLDSA65_Sign(sk_ml, M)
3. sig_hybrid = CBOR_Encode({
"ed25519": sig_ed, // 64 bytes
"mldsa65": sig_ml, // 3309 bytes
"version": 1
})
4. return sig_hybrid
HybridVerify(M, sig_hybrid, pk_ed, pk_ml):
1. components = CBOR_Decode(sig_hybrid)
2. valid_ed = Ed25519_Verify(pk_ed, M, components.ed25519)
3. valid_ml = MLDSA65_Verify(pk_ml, M, components.mldsa65)
4. return valid_ed AND valid_ml

Both signatures MUST be valid for the hybrid verification to succeed. A verifier MUST NOT accept a message where only one component is valid.

For environments where post-quantum cryptography is not yet available:

  • The DID Document SHOULD still include an ML-DSA-65 key if available.
  • Signatures use standard Ed25519 (64 bytes).
  • The verifier MUST note the reduced security level in its trust assessment.
  • Implementations operating in classical-only mode MUST NOT claim trust levels above L2.
AlgorithmPublic KeySignatureSecurity Level
Ed2551932 bytes64 bytes~128-bit classical
ML-DSA-651,952 bytes3,309 bytesNIST Level 3 (quantum)
Hybrid1,984 bytes~3,400 bytes (CBOR)128-bit classical + NIST Level 3 quantum

BLAKE3 is the primary hash function:

  • Action Receipt hash chains
  • Config attestation hashes (default)
  • Content-addressed storage

SHA-256 is the interoperability hash function:

  • Systems that cannot support BLAKE3 MAY use SHA-256.
  • When communicating hash values to external systems (e.g., blockchain anchors), SHA-256 SHOULD be used.

Hashes are represented as algorithm:hex-digest:

blake3:a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890
sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855

All public keys in DID Documents are encoded using Multibase (base58btc) as specified in the W3C Data Integrity specification.

Format: z prefix (base58btc) followed by multicodec-prefixed public key bytes.

AlgorithmMulticodecPrefix Bytes
Ed25519 public key0xed0xed 0x01
ML-DSA-65 public key0x0d650x0d 0x65

Ed25519:

Raw public key: [32 bytes]
With multicodec: 0xed 0x01 [32 bytes] = [34 bytes]
Base58btc encoded: z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK

ML-DSA-65:

Raw public key: [1952 bytes]
With multicodec: 0x0d 0x65 [1952 bytes] = [1954 bytes]
Base58btc encoded: z2Drjgb4TxNYuSiDBqd7pJAn5MfgF1YfNfsaHH3gZXQxqR7kW...

Implementations MUST generate keys using a cryptographically secure random number generator (CSPRNG):

  • Ed25519: Keys MUST be generated per RFC 8032, Section 5.1.5.
  • ML-DSA-65: Keys MUST be generated per FIPS 204, Section 6.

Private keys MUST be stored securely. Recommended approaches (in order of preference):

  1. Hardware Security Module (HSM) — FIPS 140-2 Level 2+ certified.
  2. Trusted Platform Module (TPM) — For device-bound agents.
  3. Operating System Keychain — macOS Keychain, Windows DPAPI, Linux Secret Service.
  4. Encrypted File — AES-256-GCM encrypted file with key derived from a strong passphrase via Argon2id.

Private keys MUST NOT be:

  • Stored in plain text
  • Included in DID Documents
  • Transmitted over the network
  • Logged or included in error messages

Key rotation is performed via DID Document updates. Implementations SHOULD rotate keys:

  • At least every 90 days for Ed25519 keys.
  • At least every 180 days for ML-DSA-65 keys.
  • Immediately upon suspected compromise.

During rotation, both old and new keys coexist in the DID Document. DATs issued by the old key remain valid until their expiry. New DATs MUST be signed by the new key.

Individual keys can be revoked by removing them from the DID Document via an update operation. Verifiers MUST re-resolve the DID Document when validating signatures to check for key revocation.

Implementations SHOULD cache DID Documents with a maximum TTL of 5 minutes to balance performance and revocation responsiveness.


IDProva is designed for cryptographic agility while maintaining a strong default.

All implementations MUST support:

AlgorithmPurpose
Ed25519 (RFC 8032)Classical signatures
ML-DSA-65 (FIPS 204)Post-quantum signatures
BLAKE3Content hashing
SHA-256Interoperability hashing

Implementations MAY support:

AlgorithmPurpose
Ed448Higher-security classical signatures
ML-DSA-87Higher-security post-quantum signatures
BLAKE2b-256Alternative hash

When two agents interact, they MUST use the highest-security overlapping algorithm set. If both support ML-DSA-87, they SHOULD prefer it over ML-DSA-65. Negotiation details are in the Protocol Bindings specification.

Algorithms are deprecated through a three-phase process:

  1. Advisory — Algorithm flagged as weakening; implementations SHOULD begin migration.
  2. Warning — Verifiers SHOULD reject the algorithm; grace period announced.
  3. Removal — Algorithm removed from the specification; implementations MUST NOT use it.

PhaseTimelineAction
Phase 0 (Current)2026Hybrid Ed25519 + ML-DSA-65; classical-only fallback permitted
Phase 12027Classical-only mode deprecated (advisory); all new identities MUST include PQC keys
Phase 22028Classical-only mode deprecated (warning); verifiers SHOULD reject classical-only signatures
Phase 32029+Evaluate ML-DSA-87 as default PQC algorithm; assess ML-KEM for key exchange