Open
#64
feat: quantum-resistant provenance trust layer
0
Anchors
—
Blast radius
—
Churn 30d
0
Proposals
Goal
Implement a production-ready post-quantum-ready trust layer for MuseHub provenance without changing existing SHA-256 commit IDs, snapshot IDs, object IDs, manifest hashes, token hashes, or provenance references.
Current standards baseline
- NIST FIPS 203, 204, and 205 are final standards: ML-KEM for key establishment, ML-DSA for digital signatures, and SLH-DSA for stateless hash-based signatures.
- Current high-security guidance favors crypto agility, SHA-384/SHA-512 or SHA3-family strong digests, AES-256 where encryption is involved, and ML-KEM/ML-DSA high-security parameter sets for sensitive long-horizon systems.
- IETF TLS work is active for hybrid TLS 1.3 key agreement using ECDHE + ML-KEM groups including X25519MLKEM768, SecP256r1MLKEM768, and SecP384r1MLKEM1024.
- Product language must say quantum-resistant, post-quantum-ready, or post-quantum signature verified only when verified. Do not use quantum-proof.
Proposed branch
Create and push feat/quantum-resistant-provenance once staging Muse fetch/push is stable. Local branch creation was not completed because muse clone https://staging.musehub.ai/gabriel/musehub currently disconnects during /fetch/mpack after remote HEAD discovery.
Scope
Add crypto-agility metadata to MuseHub trust and provenance records.
- Preserve existing SHA-256 identifiers for compatibility.
- Add digest algorithm, digest value, signature algorithm, key id, signature value, verification status, verification timestamp, and policy version.
- Support at least SHA-512 or SHA3-512 for new trust anchors.
Add a Quantum-Resistant Provenance policy model.
- Trust levels:
unsigned,sha256-integrity-only,strong-digest-attested,hybrid-signed,post-quantum-signed. - Never return
post-quantum-signedunless the post-quantum signature verifies cryptographically.
- Trust levels:
Add a post-quantum signature abstraction.
- Define signer and verifier interfaces behind a provider boundary.
- Start with deterministic test provider for reproducible tests.
- Add ML-DSA and SLH-DSA provider path with explicit policy labeling.
- Do not use experimental PQ libraries for production-sensitive verification unless the policy state clearly labels the provider as non-production.
Add verification APIs and UI trust badges.
- Expose verified trust state through REST and MCP surfaces.
- Render badges: Integrity verified, Strong digest verified, Post-quantum signature verified.
- Badges must be based on verification results, not claimed metadata.
Add migration and backfill.
- Existing SHA-256 records remain valid.
- Compute strong digests beside existing IDs.
- Backfill must be idempotent, auditable, and restart-safe.
Support Knowtation plugin provenance.
- Ensure Knowtation commit/provenance metadata can consume the same trust model once the local plugin is ready to push.
- Keep plugin-facing fields algorithm-explicit and policy-versioned.
Required tests
- Unit: digest calculation, canonicalization, signature policy mapping.
- Integration: provenance record creation and verification.
- End to end: commit/provenance record displays the correct trust badge.
- Stress: bulk verification/backfill over many records.
- Data integrity: SHA-256 IDs remain unchanged and strong digest metadata is stable.
- Performance: digest/signature verification bounds are measured.
- Security: tampered payloads, replayed signatures, downgraded algorithms, malformed keys, and invalid policy states are rejected.
Security requirements
- No hardcoded secrets or private keys.
- No silent downgrade from post-quantum to classical trust.
- No badge based only on claimed metadata.
- Verification result must be derived from actual cryptographic verification.
- All new trust records must include algorithm identifiers and policy version.
- Avoid misleading marketing language in code, docs, and UI.
Deliverables
- MuseHub crypto-agility/provenance schema.
- Verification service.
- REST and MCP exposure.
- UI trust badges.
- Migration/backfill path.
- Complete tests across unit, integration, end-to-end, stress, data-integrity, performance, and security tiers.
Activity1
What's already in place
The codebase has a solid crypto-agility skeleton that directly addresses several items in this ticket. Here's what exists today vs. what the ticket asks for.
musehub/crypto/keys.py
KeyAlgorithmenum already defines bothED25519andML_DSA_65 = "ml-dsa-65"(FIPS 204 / formerly CRYSTALS-Dilithium-3)PUBLIC_KEY_SIZESandSIGNATURE_SIZESdicts carry the correct raw byte sizes for both (Ed25519: 32/64, ML-DSA-65: 1952/3309)ALGORITHM_DESCRIPTIONSexplicitly labels Ed25519 as "not quantum-safe" and ML-DSA-65 as "NIST post-quantum standard, quantum-safe"IMPLEMENTED_ALGORITHMS: frozensetcurrently contains onlyED25519; ML-DSA-65 is defined but commented out — enabling it is a one-line change once the library dep is availableverify_signaturedispatches on the algorithm enum with a hardAlgorithmNotImplementedErrorguard — no silent downgrade is possible_verify_ml_dsa_65stub exists with the exactliboqs-python/ PyCA upgrade path documented inlineDEFAULT_ALGORITHMis a named constant, so switching to ML-DSA-65 is a single assignmentWhat this means for the ticket
Scope items 1–3 in the ticket (crypto-agility metadata, post-quantum abstraction, provider boundary) are largely pre-wired at the key-verification layer. The missing pieces are:
unsigned → sha256-integrity-only → strong-digest-attested → hybrid-signed → post-quantum-signed)cryptographyPyCA adding FIPS 204 support or pulling inliboqs-pythonwith its native build dep)The doc at
musehub/docs/reference/msign.mdalready describes the quantum migration path accurately. No changes needed there.Recommendation: The ticket scope is correct and complete. The existing skeleton reduces risk significantly — the algorithm dispatch layer is already crypto-agile, there is no hardcoded Ed25519 assumption in
verify_signature, and theAlgorithmNotImplementedErrorguard ensures no silent downgrade. The main work is the policy/provenance schema, the REST/MCP surface, the badges, and the eventual library dep once ML-DSA arrives in a stable Python package.