Skip to content

Rename iroh-node-id header to Peer-Id #6

Description

@momics

[ISS-006] Rename iroh-node-id header to Peer-Id

Summary

Incoming requests include an iroh-node-id header containing the caller's verified Ed25519 public key (base32). The name is project-specific and should be replaced with Peer-Id — a shorter, ecosystem-aligned name without vendor prefix.

Decision

Chosen name: Peer-Id

  • No X- prefix — RFC 6648 deprecated the X- convention for custom headers. Since this header is part of the iroh-http protocol spec (not application-specific), it should not use a prefix.
  • "Id" not "Key" — in this protocol, peer ID and public key are the same thing (the base32-encoded Ed25519 public key). Most developers will use it for identity/access control (if peerId === allowed), not cryptographic operations. The PublicKey class and docs already make the crypto aspect clear.
  • Alternatives considered: Peer-Key (ambiguous — sounds like an API key), Peer-Public-Key (verbose for a header typed often).

Evidence

  • Observed during live testing: the header iroh-node-id appeared on incoming requests
  • Aligns with libp2p ecosystem terminology ("peer" is the standard term)
  • X- headers deprecated per RFC 6648

Impact

Low — cosmetic/naming issue. But setting a good header name early matters because changing it later is a breaking protocol change.

Remediation

  1. Rename iroh-node-idpeer-id in Rust core (server.rs: strip, inject, and header name)
  2. Update compliance tests (cases.json: test IDs, paths, header references)
  3. Update smoke/e2e tests (Deno smoke.test.ts, Node e2e.mjs)
  4. Update all docs (protocol.md, default-headers.md, recipes, guidelines, specification.md)
  5. Update examples (Tauri main.ts)
  6. Document in protocol spec that Peer-Id value is the base32 Ed25519 public key and is cryptographically verified

Acceptance criteria

  1. Header name is documented in protocol spec
  2. Name is consistent across all adapters
  3. If renamed, old name continues to work for one version (deprecation period)

Regression test

  • Layer: N/A
  • Test: N/A
  • Verified failing before fix: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priorityprotocolWire format or protocol spec

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions