q-trust

Q-Trust Architecture

Overview

Q-Trust is a post-quantum cryptography (PQC) migration assurance platform that registers, plans, and audits cryptographic asset migrations on-chain. It combines Solidity smart contracts, a Fastify backend API, a Python SDK, a TLS/file inspector, and a GNN-based planner to guide organizations from legacy algorithms to NIST-approved PQC standards.

Contract Layer

All eleven contracts are Solidity 0.8.24, UUPS-proxy upgradeable via OpenZeppelin ERC1967Proxy, and use AccessControl role-based permissions. Admin operations route through QTrustGovernance (7-day timelock, DEFAULT_DELAY = 7 days). Gasless meta-transactions use EIP-712 typed signatures with nonce tracking.

Contract Description
AssetRegistry Registers CBOM hashes (SHA-256) with IPFS metadata URIs; supports EIP-712 gasless registration.
VendorRegistry Vendors (DigiCert, Thales, AWS) post PQC-readiness attestations per product/version/algorithm.
MigrationRegistry Records each migration step (from-algo → to-algo) with evidence hashes; validates asset existence against AssetRegistry.
AuditRegistry Third-party auditors post attestation results (Passed/Failed/Conditional); binds to on-chain migration count.
EvidenceRegistry Stores verifiable evidence records (hashes + metadata) referenced by audits and migrations for tamper-evident traceability.
QTrustGovernance Timelock-gated wrapper around the four core registries for pausing, retiring, role grants, and upgrades.
RevocationAnchor Anchors off-chain Merkle roots for privacy-preserving credential revocation checks.
PolicyCommitment Versioned on-chain policy hash anchors for reproducible trust assessments.
ComplianceAttestation Records regulatory/compliance attestations (jurisdiction, standard, status) bound to assets and vendors.
SchemaRegistry Registers JSON Schema documents for CBOM/credential formats with cross-domain equivalence mappings.
TrustAnchorRegistry Accreditation of credential issuers by governance multisig; verifiers reject non-accredited issuers.

Backend API

SDK

Inspector

Module dependencies (derived from actual imports):

graph TD
    cli[cli]
    mcp[mcp_server]
    scanner[scanner]
    subgraph probes["scanners / probes"]
        ast[ast_scanner]
        binary[binary_scanner]
        pcap[pcap_scanner]
        source[source_scanner]
        manifest[manifest_scanner]
        tlsp[tls_probe]
        pem[file_scanner]
    end
    risk[risk_engine]
    comp[compliance]
    conf[conformance]
    cdx[cyclonedx]
    sarif[sarif]
    ev[evidence]
    road[roadmap]
    rem[remediation]
    k8s[k8s_policy]
    models

    cli --> scanner
    cli --> risk
    cli --> comp
    cli --> conf
    cli --> cdx
    cli --> sarif
    cli --> ev
    cli --> road
    cli --> rem
    cli --> k8s

    mcp -.-> source
    mcp -.-> ast
    mcp -.-> scanner
    mcp -.-> pcap
    mcp -.-> binary
    mcp -.-> risk
    mcp -.-> comp
    mcp -.-> rem

    scanner --> pem
    ast --> source
    binary --> source
    pcap --> tlsp

    risk --> models
    comp --> models
    ast --> models
    binary --> models
    source --> models
    manifest --> models
    pem --> models
    cdx --> models
    sarif --> models
    cli --> models

Dataflow: cli drives scanner, which fans out to the format-specific probes (ast_scanner/binary_scanner reuse source_scanner’s skip rules; pcap_scanner reuses tls_probe’s codepoint tables); every probe emits models.AssetFinding. Those findings flow through risk_engine, compliance/conformance scoring into the output layers — cyclonedx (CBOM), sarif, evidence, roadmap, remediation, and k8s_policy. mcp_server wraps the same scan/risk/compliance surface as JSON-RPC tools for AI coding agents.

Planner

Frontend

Data Flow

Inspector scan → CBOM JSON (qtrust.cbom.v1)
  → SDK pins to IPFS, computes SHA-256 hash
    → AssetRegistry.registerCBOMSigned (EIP-712 gasless)
      → Planner reads CBOM, builds dependency graph
        → MigrationGNN outputs priority-ordered migration plan
          → MigrationRegistry.recordMigrationSigned per step
            → AuditRegistry.postAudit by third-party auditor
              → TrustAnchorRegistry / RevocationAnchor for credential lifecycle

Network

Security Model