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
-
Add one row to protocols.csv (sorted by code, after noise / 454):
455, 256, wg, WireGuard tunnel endpoint (Curve25519 public key)
-
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):
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
Context
This issue tracks upstream registration of the draft WireGuard (
wg) multiaddr protocol introduced in PR #108.'wg'?) #107, PR Addwg(WireGuard) protocol support #108, goodboy/tractor#483 (author's expanded plan).Settled implementation semantics (py-multiaddr #108)
wg0x01C7(decimal455) — slot betweennoise(0x01C6) andshs(0x01C8)uprefix (matches/certhashin go-/py-multiaddr)wg(8)multibase.encode('base64url', base64.b64decode(key))/ip4/1.2.3.4/udp/51820/wg/urCzgw_sszhsg-SpR8V5IPmVnYPg2PliWW739_SWemwYOpen questions for upstream spec review:
uprefix vs accept-any-multibase-and-normalize on decodeUpstream registration plan
Step 1: multicodec PR (do first)
Repo: https://github.com/multiformats/multicodec
Add one row to
table.csv(sorted by code, betweennoiseandshs):make/npm testper CONTRIBUTING).wg(WireGuard) protocol support #108 as first implementation, overlay use case from Add wireguard support (with key'wg'?) #107.Step 2: multiaddr spec PR (link multicodec PR)
Repo: https://github.com/multiformats/multiaddr
Add one row to
protocols.csv(sorted by code, afternoise/ 454):If requested by maintainers, add a short protocol description covering:
u<43>(44 chars total)/in standard base64 collides with multiaddr delimiter; multibase matchescerthashprecedent/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):
multiaddr/codecs/wg.pydocstring to point at upstream PRs instead of "speculative draft"wg(WireGuard) protocol support #108 description / tick multicodec TODOStep 4: libp2p/specs (optional, later)
Only after multiformats registration: document how libp2p stacks use
/…/wg/…for overlay/tunnel addressing (e.g. extendaddressing/README.md). Not required for py-multiaddr merge.Step 5: Cross-implementation follow-up (optional)
Propose the same protocol to
go-multiaddr/js-multiaddronce spec rows land.Checklist
wg(WireGuard) protocol support #108 (pending removal ofgh/wg_spec_submission_plan.md)0x01C7455/wg