Skip to main content

Module mesh_trust

Module mesh_trust 

Source
Expand description

Admin-anchored mesh post-quantum trust store construction (#157, Option A).

Builds the process-global kid-anchored KeyedPqTrustStore eagerly from the operator-configured mesh_peers (see crate::config::MeshPeerConfig). The store is admin-anchored and immutable after construction: only ML-DSA-65 keys an operator configured out-of-band are trusted, matching the KeyedPqTrustStore contract (“Entries MUST be established out-of-band”).

Each peer entry carries two inline Multikey (publicKeyMultibase) strings, copied from that peer’s published DID document:

  • #mesh → Ed25519 mesh signer key (multicodec ed25519-pub, 0xed01)
  • #mesh-pq → ML-DSA-65 mesh verifying key (multicodec ml-dsa-65-pub, 0x1211)

The Ed25519 key is the kid anchor; the ML-DSA-65 key is the trusted PQ key bound to it. Empty/absent mesh_peers yields an empty store — unchanged behavior (Hybrid fails closed for unknown peers).

Functions§

build_mesh_identity_roster
Build the per-host mesh identity roster from the admin-configured mesh_peers (#328): each peer’s Ed25519 signer pubkey → its per-host authorization subject (service:inference:host-<label>).
build_mesh_pq_trust_store
Build the kid-anchored ML-DSA-65 trust store from the admin-configured mesh_peers (#157, Option A — eager, admin-anchored, immutable).
encode_multikey
Encode raw key bytes as a Multikey publicKeyMultibase string (base58btc, multicodec-prefixed). Inverse of decode_multikey; used by tests and by operators generating peer entries.
seed_bootstrap_pq_bindings
Anchor the ML-DSA-65 keys carried by the node’s own bootstrap-pubkeys entries into store, keyed by the Ed25519 signer identity each entry already anchors in the classical trust store.