Skip to main content

Module service_entry

Module service_entry 

Source
Expand description

DID-document transport service-entry codec.

The canonical encoder/decoder for the typed transport entries a node publishes in its DID document, shared by the producer (the did:web document builder) and the consumer (the DID resolver that feeds crate::dial::dial).

§Layering (settled design)

Peer identity is established at the application layer — the response SignedEnvelope is verified against the node’s published keys (the #mesh verification method / JWKS). The transport entries here carry reach info + channel mechanics, not the identity root. An iroh nodeId is an endpoint address and must not manufacture identity or key authority (#1031).

§Wire shape

serviceEndpoint is a DIDComm-style map (W3C DID Core §5.4 permits a map). Binary values use multibase (z = base58btc) over a multiformats prefix, matching the doc’s Multikey publicKeyMultibase encoding (#280; ed25519 VMs were formerly Ed25519VerificationKey2020):

// type: "IrohTransport"
{ "nodeId": "z<multicodec ed25519-pub || key>", "relays": ["https://…"], "accept": ["hyprstream-rpc/1","moql"] }
// type: "QuicTransport"
{ "uri": "https://host:port", "webpki": false,
  "certHashes": ["z<multihash sha2-256 || digest>"], "accept": [...] }

certHashes is a multibase-encoded multihash (self-describing algorithm, sha2-256 = 0x12), a set so cert rotation can overlap. Whole-cert pins are the browser-compatible projection of the identity key — see #185 / #200.

Structs§

BrowserQuicReach
Browser projection of the primary live QUIC reach.
DecodedEntry
A decoded transport entry containing only dialable reach information.

Functions§

decode_browser_quic_reach
Validate a live QuicTransport service entry and project its certificate pin into the singular browser registration shape.
decode_service_entry
Decode one DID-doc transport service entry ({type, serviceEndpoint}) into a dialable DecodedEntry. Unknown types error so the caller can skip them.
encode_iroh
Encode an IrohTransport serviceEndpoint map for a peer identified by node_id (its Ed25519 EndpointId), reachable via relays.
encode_quic
Encode a QuicTransport serviceEndpoint map.