Skip to main content

Module did_web

Module did_web 

Source
Expand description

did:web → dialable TransportConfig resolution (#279).

The mesh’s only live crate::resolver::Resolver is the crate::registry::EndpointRegistry (service-name → local endpoint). This module adds the federated reach path: a DidWebResolver that turns a did:web identifier into one-or-more dialable TransportConfigs by fetching the subject’s DID document and decoding its typed transport service entries.

§Layering

§Scope (#279)

Transport reach only. Peer identity anchoring (#mesh ML-DSA, the PQ trust store) is #157/#154/#137 (already landed) and is NOT done here. did:key resolution is #281 (a later ticket); only did:web here.

Structs§

ChainedResolver
Composes a primary resolver with a fallback: tries primary first, and on error falls back to fallback.
DidWebResolver
A Resolver that turns a did:web identifier into a dialable TransportConfig.
HttpDidDocFetcher
Native HTTPS DID-document fetcher with a TTL cache.

Constants§

MULTICODEC_ML_DSA_65_PUB
Multicodec ml-dsa-65-pub unsigned-varint prefix (0x1211 → bytes 0x91 0x24).

Traits§

DidDocFetcher
Fetches a DID document (parsed JSON) for a resolved HTTPS URL.

Functions§

decode_ed25519_multikey
Decode a Multikey publicKeyMultibase string into raw Ed25519 key bytes.
decode_multikey
Decode a Multikey publicKeyMultibase string into raw key bytes, verifying the base58btc multibase prefix (z) and the expected multicodec header.
did_key_to_ed25519
Decode a did:key (Ed25519) identifier into its raw 32-byte Ed25519 key.
did_web_to_url
Derive the HTTPS DID-document URL for a did:web identifier, per the did:web spec (https://w3c-ccg.github.io/did-method-web/#read-resolve).
ed25519_to_did_key
Encode a raw 32-byte Ed25519 public key as a did:key (Ed25519) identifier (did:key:z6Mk…).
install_chained
Install a DidWebResolver as the global resolver, chained in front of the existing global resolver (typically the registry) so local service-name lookups still resolve.
is_did_key
Whether did is a did:key identifier (the self-certifying interop arm).
jwks_ed25519_keys
Extract every Ed25519 public key from a JWKS document (RFC 7517), decoded to raw 32-byte keys (#137 stage 2, JWKS fallback path).
mesh_kem_recipient
Extract the #mesh-kem hybrid-KEM recipient public from a DID document’s keyAgreement relationship (#1137 remote-node bootstrap).
preferred_transport
The single most-preferred transport TransportConfig from a DID document, optionally constrained to a SocketKind.
transport_entries
Decode all typed transport service entries from a DID document into dialable DecodedEntrys, in preference order.
verification_method_ed25519_keys
Extract every Ed25519 public key published in a DID document’s verificationMethod array, decoded to raw 32-byte keys (#137 stage 2).
verification_method_ml_dsa_65_keys
Extract every ML-DSA-65 verifying key published in a DID document’s verificationMethod array (#579 multi-alg VM extraction).