Skip to content

Track upstream registration of wg multiaddr protocol (0x01C7) #123

Description

@acul71

Context

This issue tracks upstream registration of the draft WireGuard (wg) multiaddr protocol introduced in PR #108.

Settled implementation semantics (py-multiaddr #108)

Property Value
Protocol name wg
Code 0x01C7 (decimal 455) — slot between noise (0x01C6) and shs (0x01C8)
Binary form Exactly 32 bytes — raw Curve25519 public key; fixed size 256 bits; no length prefix
String form Multibase base64url — u prefix (matches /certhash in go-/py-multiaddr)
Conversion from wg(8) multibase.encode('base64url', base64.b64decode(key))
Example /ip4/1.2.3.4/udp/51820/wg/urCzgw_sszhsg-SpR8V5IPmVnYPg2PliWW739_SWemwY

Open questions for upstream spec review:

  • Canonical-only u prefix vs accept-any-multibase-and-normalize on decode
  • Whether degenerate keys (e.g. all-zero) are a codec concern (suggest: no — length check only)

Upstream registration plan

Step 1: multicodec PR (do first)

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

Add one row to table.csv (sorted by code, between noise and shs):

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

Step 2: multiaddr spec PR (link multicodec PR)

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

  1. Add one row to protocols.csv (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 covering:

    • Binary: 32-byte fixed-size Curve25519 public key (no length prefix)
    • String: multibase base64url u<43> (44 chars total)
    • Rationale: / in standard base64 collides with multiaddr delimiter; multibase matches certhash precedent
    • Canonical composition: /ip{4,6}/<host>/udp/<port>/wg/<key>

Open this PR referencing the multicodec PR from step 1.

Step 3: Circle back to py-multiaddr

After upstream PRs land (or in parallel once numbers are reserved):

  • Update multiaddr/codecs/wg.py docstring to point at upstream PRs instead of "speculative draft"
  • Update PR Add wg (WireGuard) protocol support #108 description / tick multicodec TODO
  • Close this issue when both upstream rows are merged

Step 4: libp2p/specs (optional, later)

Only after multiformats registration: document how libp2p stacks use /…/wg/… for overlay/tunnel addressing (e.g. extend addressing/README.md). Not required for py-multiaddr merge.

Step 5: Cross-implementation follow-up (optional)

Propose the same protocol to go-multiaddr / js-multiaddr once spec rows land.

Checklist

  • Merge py-multiaddr PR Add wg (WireGuard) protocol support #108 (pending removal of gh/wg_spec_submission_plan.md)
  • Open multicodec PR for 0x01C7
  • Open multiaddr PR for protocol 455 / wg
  • Update py-multiaddr docs after upstream lands

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions