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 base64url —
u 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
-
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)
-
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.
wgmultiaddr protocol: upstream spec submission planPlan for registering the
wg(WireGuard) protocol upstreamonce the
py-multiaddrimpl (PRmultiformats/py-multiaddr#108) is settled.
Settled impl semantics (post-review)
wg0x01c7(decimal455) — the unassigned slotbetween
noise(0x01c6) andshs(0x01c8) in themultiaddrtag range.key; fixed size
256bits, NO varint length prefix and nomultibase envelope on the wire (verified:
...c703varintcode + 32 raw bytes).
uprefix + 43unpadded chars (44 total), matching the
certhashconvention in py-/go-multiaddr.
wg(8)) can't appear inthe
/-delimited textual form; convert viamultibase.encode('base64url', base64.b64decode(k)).u...=) and non-umultibase prefixes arerejected by the py impl — spec text should state whether
canonical-only-
uis the contract or decoders shouldaccept any multibase and re-emit
u(open Q formaintainers).
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).
/ip4/1.2.3.4/udp/51820/wg/urCzgw_sszhsg-SpR8V5IPmVnYPg2PliWW739_SWemwYStep 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'scolumn alignment, sorted by code next to
noise/shs:(
make/npm testper their CONTRIBUTING docs).draftstatus entries forunclaimed codes are routinely accepted via small PRs.
PR Multiple issues on the code examples present in the README file. #108 as the first implementation, and the overlay-network
use case from issue General formatting #107.
Step 2: multiaddr spec PR (defines the protocol)
Repo: https://github.com/multiformats/multiaddr
Add a row to
protocols.csv(cols:code,\tsize,\tname,\tcomment), sorted by code afternoise(454):If requested by maintainers, add a short protocol
description to the README/spec covering:
size, no length prefix); multibase base64url
u<43>(string).
/in std base64 collides with the maddrdelimiter; multibase matches the
certhashprecedentacross implementations. Conversion from
wg(8)output:
multibase.encode('base64url', base64.b64decode(key))./ip{4,6}/<host>/udp/<port>/wg/<key>.uvsaccept-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:
multiaddr/codecs/wg.pymodule docstring + PR Multiple issues on the code examples present in the README file. #108body to point at the upstream PRs instead of calling the
code a speculative draft.
TODO checkbox in the PR Multiple issues on the code examples present in the README file. #108 description.
Follow-ups (optional)
go-multiaddr/js-multiaddronce the spec rows land, so the string/binaryforms stay interoperable across impls.