Skip to content

wg multiaddr protocol: upstream spec submission plan #483

Description

@goodboy

wg multiaddr protocol: upstream spec submission plan

Plan for registering the wg (WireGuard) protocol upstream
once the py-multiaddr impl (PR
multiformats/py-multiaddr#108) is settled.

Settled impl semantics (post-review)

  • protocol name: wg
  • code: 0x01c7 (decimal 455) — the unassigned slot
    between noise (0x01c6) and shs (0x01c8) in the
    multiaddr tag range.
  • binary form: exactly 32 bytes — a raw Curve25519 public
    key; fixed size 256 bits, NO varint length prefix and no
    multibase envelope on the wire (verified: ...c703 varint
    code + 32 raw bytes).
  • string form: multibase base64urlu prefix + 43
    unpadded chars (44 total), matching the certhash
    convention in py-/go-multiaddr.
    • standard base64 (as printed by wg(8)) can't appear in
      the /-delimited textual form; convert via
      multibase.encode('base64url', base64.b64decode(k)).
    • padded (u...=) and non-u multibase prefixes are
      rejected by the py impl — spec text should state whether
      canonical-only-u is the contract or decoders should
      accept any multibase and re-emit u (open Q for
      maintainers).
    • key semantics: impl length-checks only; spec should say
      whether degenerate keys (e.g. all-zero low-order point)
      are the codec's concern (suggest: no — semantics stay
      out of the codec, like other maddr protocols).
  • example:
    /ip4/1.2.3.4/udp/51820/wg/urCzgw_sszhsg-SpR8V5IPmVnYPg2PliWW739_SWemwY

Step 1: multicodec PR (reserves the code)

Repo: https://github.com/multiformats/multicodec

Add one row to table.csv (cols:
name, tag, code, status, description), keeping the file's
column alignment, sorted by code next to noise/shs:

wg,                             multiaddr,      0x01c7,         draft,      WireGuard tunnel endpoint - 32-byte Curve25519 public key

Step 2: multiaddr spec PR (defines the protocol)

Repo: https://github.com/multiformats/multiaddr

  1. Add a row to protocols.csv (cols:
    code,\tsize,\tname,\tcomment), sorted by code after
    noise (454):

    455,	256,	wg,	WireGuard tunnel endpoint (Curve25519 public key)
  2. If requested by maintainers, add a short protocol
    description to the README/spec covering:

    • value = 32-byte Curve25519 public key (binary, fixed
      size, no length prefix); multibase base64url u<43>
      (string).
    • rationale: / in std base64 collides with the maddr
      delimiter; multibase matches the certhash precedent
      across implementations. Conversion from wg(8)
      output: multibase.encode('base64url', base64.b64decode(key)).
    • canonical composition: /ip{4,6}/<host>/udp/<port>/wg/<key>.
    • open Qs to settle in review: canonical-only-u vs
      accept-any-multibase decode; degenerate-key semantics
      (see gh/pr108_review_followups.md).

Open this PR referencing the multicodec PR from step 1 so
both land with the same code.

Step 3: circle back to py-multiaddr

After (or alongside) the upstream PRs:

Follow-ups (optional)

  • propose the same protocol to go-multiaddr /
    js-multiaddr once the spec rows land, so the string/binary
    forms stay interoperable across impls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions