Skip to content
wavexVPNPublic

About

WAVEX: source-available VPN protocol with post-quantum key exchange, and a gateway anyone can run. Open Networking. Private by Design.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

WAVEX

Open Networking. Private by Design.

A source-available VPN protocol built by WAVEINNO: free to run for yourself and your organization, and open source (Apache-2.0) four years after each release; see Licence. Status: pre-1.0 and not yet independently audited; see Status and roadmap.

WAVEX is small, fast, quiet to the internet, and post-quantum from the first packet.

It takes the design that made WireGuard the reference for modern VPNs (one round trip, a fixed set of proven primitives, no negotiation, stateless to strangers) and adds what WireGuard leaves out: a post-quantum key exchange (ML-KEM-768, FIPS 203) combined with X25519, so traffic recorded today stays private even against a future quantum computer. A server runs it as an ordinary Linux service in user space. Anyone can run one on their own VPS, dedicated server or data centre with one command, and providers can drive it from their own control plane.

Handshake   Noise_IKpsk2_25519_ChaChaPoly_BLAKE2s  +  ML-KEM-768        (1 round trip)
Data        ChaCha20-Poly1305, 32 bytes overhead per packet              (same as WireGuard)
Transport   UDP, port 51900 plus any extra ports (e.g. 443), tunnel MTU 1420
Keys        rotated every 2 minutes; a session is dead after 3
Core size   ~650 lines of Go protocol code, plus the server and client programs

The WAVEX family

Component What it is In this repo Status
WAVEX Protocol The wire protocol: handshake, data packets, timers this README, wire format v1
WAVEX Core The protocol engine, a Go package core/ v1
WAVEX Gateway The server: runs on any Linux machine gateway/ (wavex-gateway) v1
WAVEX CLI The wavex command: connect from Linux servers, routers and for testing cli/ v1
WAVEX Connect Client apps: Windows, macOS, Linux, Android, iOS wavexVPN/wavex-connect planned
WAVEX SDK WAVEX inside other applications wavexVPN/wavex-sdk Go today (Core); bindings planned
WAVEX Network Gateways run by WAVEINNO and other providers — planned

Where it is going, and in what order: ROADMAP.md.

Run your own server

On Debian or Ubuntu, add the WAVEX apt repository once, then install and set the server up:

curl -fsSL https://wavexvpn.github.io/wavex/wavex.asc | sudo gpg --dearmor -o /usr/share/keyrings/wavex.gpg
echo "deb [signed-by=/usr/share/keyrings/wavex.gpg] https://wavexvpn.github.io/wavex/apt stable main"   | sudo tee /etc/apt/sources.list.d/wavex.list
sudo apt update && sudo apt install wavex-gateway        # amd64 and arm64; the client is: apt install wavex
sudo wavex-gateway setup                                  # or: setup -endpoint vpn.example.com -port 443

On Fedora, RHEL, Rocky, Alma or Amazon Linux (dnf or yum):

sudo curl -fsSL -o /etc/yum.repos.d/wavex.repo https://wavexvpn.github.io/wavex/rpm/wavex.repo
sudo dnf install wavex-gateway                            # or: yum install wavex-gateway; the client is: wavex
sudo wavex-gateway setup

The packages and the repository are signed with the WAVEX packages key (fingerprint C9B6 CFA8 0AC4 3526 A327 3831 C8C5 29A2 C946 EB9A); apt upgrade / dnf upgrade bring new releases. The .deb files are also attached to each release.

On any other Linux with systemd, one line does both:

curl -fsSL https://raw.githubusercontent.com/wavexVPN/wavex/main/install.sh | sudo sh

With Docker (the image configures itself from the environment; the volume keeps the key and devices):

docker run -d --name wavex --restart unless-stopped \
  --cap-add NET_ADMIN --device /dev/net/tun --sysctl net.ipv4.ip_forward=1 \
  -p 51900:51900/udp -v wavex:/etc/wavex -e WAVEX_ENDPOINT=vpn.example.com \
  ghcr.io/wavexvpn/wavex-gateway
docker exec wavex wavex-gateway add phone -o - > phone.wavex

The container also reads WAVEX_PORT, WAVEX_DNS, WAVEX_ALLOW_LAN=1, WAVEX_IPV6=on, WAVEX_RATE (Mbit/s per device), WAVEX_METRICS (e.g. :9101) and WAVEX_TELEMETRY=off (telemetry).

setup creates the node key, starts the service, sets up NAT to the internet and opens the UDP port (51900; open it in your cloud firewall too). Devices get the internet, not your network: they can't reach each other, the private networks behind the server (unless setup -allow-lan) or the cloud metadata service.

IPv6 inside the tunnel is on when the server has IPv6 internet (setup -ipv6 auto, the default; on or off to choose). Setup picks a random private /64 for the server once and keeps it, and each device's IPv6 address follows from its IPv4 one (10.69.0.2 is …::a45:2). Without IPv6 on the server, a device on -route-all blocks IPv6 while connected, so its traffic can't leave around the tunnel.

sudo wavex-gateway add phone          # allow a device named "phone" (any name: laptop, office-pc…); writes phone.wavex
sudo wavex up -config phone.wavex -route-all     # on the device (Linux), with wavex from the same release
sudo wavex-gateway list               # devices allowed;  remove NAME revokes one at once
sudo wavex-gateway status             # the server at a glance;  users, monitor, logs: see below

The name is yours to pick, one per device. phone.wavex holds the device's private key: move it to the device and delete it from the server. A device can also make its own key (wavex genkey) and you add only its public key: wavex-gateway add phone -key PUBLICKEY. On Linux devices, sudo apt install wavex or sudo dnf install wavex (from the repository above) installs the wavex command.

sudo apt remove wavex-gateway stops the server and removes its firewall rules but keeps the node key and devices; apt purge deletes those too (dnf remove keeps them). Without the package: sudo wavex-gateway uninstall [-purge].


Contents

  1. Why WAVEX
  2. How a connection works
  3. The handshake
  4. Data packets
  5. Timers
  6. Staying up under attack
  7. Security properties
  8. Threat model: what WAVEX does not do
  9. Comparison
  10. On a server
  11. Performance
  12. How it is verified
  13. Status and roadmap
  14. Running it by hand
  15. Wire format reference

Why WAVEX

Goal How WAVEX meets it
Nothing to configure wrong One cipher suite, fixed. No negotiation, so there is no downgrade attack and no weak option to pick.
No home-made cryptography Every primitive is standard and widely analysed: the Noise framework, X25519, ChaCha20-Poly1305, BLAKE2s, HKDF-SHA256 and ML-KEM-768. Only the composition is ours, and it follows published patterns.
Safe against "record now, decrypt later" Every session key depends on both X25519 and ML-KEM-768. Breaking the session means breaking both.
Invisible to scanners A server answers only a correctly authenticated handshake. Probes, port scans and junk get no reply at all.
Fast One round trip to connect, 32 bytes of overhead per packet, multi-core server, in-place decryption.
Roams Change from Wi-Fi to mobile data and the tunnel follows you, without a new handshake.
Small enough to audit The protocol core is a few hundred lines. A reviewer can read all of it in an afternoon.

How a connection works

Each side has a long-term X25519 key pair: every server (node) has one, and so does every device. The server has a list of the device keys that may connect and the tunnel IP each one gets (wavex-gateway add writes it, or a provider's control plane does). A device knows the server's public key before it connects (it is in the device's .wavex file), which is what makes a one-round-trip, mutually authenticated handshake possible.

sequenceDiagram
    participant C as Device
    participant S as Node
    C->>S: 1. Handshake init (my identity, encrypted; my ML-KEM key; timestamp)
    Note over S: check mac1 (cheap) → decrypt → is this device allowed? → newer timestamp?
    S->>C: 2. Handshake response (ML-KEM ciphertext; my ephemeral key; your tunnel IP)
    Note over C: both sides now hold the same fresh keys
    C->>S: 3. Keepalive under the new keys (key confirmation)
    Note over S: switch to the new keys only now
    C-->>S: encrypted IP packets
    S-->>C: encrypted IP packets
    Note over C,S: every 2 minutes the device repeats steps 1–3 in the background
Loading

There is no connection state on the server until a known device completes step 1 correctly, and no keys are used until the device proves in step 3 that it has them.

The handshake

The two key exchanges

WAVEX runs a Noise IK handshake with a pre-shared key in position 2 (IKpsk2), the same pattern WireGuard uses. The difference is where that pre-shared key comes from:

  1. Message 1. The device generates a fresh ML-KEM-768 key pair and sends the public (encapsulation) key inside the encrypted payload of Noise message 1, together with a 12-byte timestamp. Its long-term identity is encrypted too, so a passive observer learns nothing about who is connecting.

  2. Message 2. The node encapsulates to that ML-KEM key, which yields a 32-byte shared secret and a 1,088-byte ciphertext. It derives the Noise PSK from the secret:

    psk = HKDF-SHA256(ikm = ML-KEM shared secret, info = "wavex v1 mlkem psk", length = 32)
    

    It sends the ciphertext in the clear (a KEM ciphertext reveals nothing), followed by Noise message 2, which carries the device's tunnel IPv4 address and the DNS servers it must use (encrypted, so they can't be tampered with).

  3. The device decapsulates, derives the same PSK, and completes Noise. Both sides now hold two transport keys, one for each direction.

Noise mixes every X25519 result (es, ss, ee, se) and the PSK into one chaining key, so the transport keys depend on all of them. An attacker who can break X25519 (for example with a quantum computer) still needs the ML-KEM secret, and one who breaks ML-KEM still needs the X25519 secrets.

Freshness and replay

  • Replayed init messages. The timestamp in message 1 (TAI64N style: seconds and nanoseconds) must be newer than the last accepted one from the same device, or the node drops it. It is recorded only after the whole handshake succeeded, two copies racing on two cores can't both win, and the node keeps these timestamps on disk (/var/lib/wavex), so a handshake recorded before a restart can't be replayed after it.
  • Clocks. A timestamp more than 3 minutes ahead of the node's clock is refused. A device whose clock was once wrong can't leave a future timestamp behind that would lock it out after its clock is corrected. A clock that runs behind is fine: only the order of one device's own handshakes matters.
  • Lost responses. If message 2 is lost, nothing breaks: the node keeps using the current keys until it hears the device's first packet under the new ones (key confirmation, as in WireGuard).
  • Forward secrecy. Both sides use fresh ephemeral X25519 keys and a fresh ML-KEM key pair in every handshake, and handshakes repeat every 2 minutes. A stolen long-term key does not decrypt past sessions.

Identity hiding

The device's long-term public key travels encrypted in message 1, encrypted to the node's key. The node's identity is never sent at all: the device already knows it. A network observer sees two random-looking messages.

Data packets

 0      1      4             8                       16
+------+------+-------------+-----------------------+----------------------------------+
| type | 0 0 0| receiver idx| counter (64-bit LE)   | ChaCha20-Poly1305(IP packet) + tag |
|  3   |      |   (u32 LE)  |                       |                                  |
+------+------+-------------+-----------------------+----------------------------------+
         \_____________ 16-byte header, authenticated as associated data ___________/
  • One packet, one AEAD. Each IP packet is sealed with ChaCha20-Poly1305 under the direction's key. The 64-bit counter is the nonce, and the whole header is authenticated, so a changed index or counter fails the tag.
  • Nonces never repeat. The counter is taken under a lock, so even with one worker per CPU core no two packets share a nonce. The counter stops at 2⁶⁰, long after a rekey would have happened.
  • Out of order is fine, replays are not. A 2,048-packet sliding window (the RFC 6479 bitmap used by WireGuard and IPsec) accepts each counter once. The window moves only after a packet authenticates, so forged packets can't push it.
  • Keepalives are packets with an empty payload.
  • No spoofing inside the tunnel. The node forwards a decrypted packet only if its source address is the tunnel IP that device was given.
  • Devices can't reach each other. The node drops packets from one device to another device's tunnel address (and the node firewall blocks customer-to-customer traffic on every protocol), so a VPN never puts strangers on one LAN where they could scan each other's devices.
  • Keepalives are answered, so a device can tell a quiet tunnel from a dead one.

Timers

Timer Value Meaning
Rekey 2 min The device starts a new handshake in the background.
Reject 3 min A session older than this is dead in both directions; a stalled peer can't keep old keys alive.
Keepalive 25 s Sent when idle, so NAT and firewall mappings stay open; the node answers each one.
Dead session 10 s No answer for this long to anything the device sent: it reconnects (after a node restart, devices are back in about 13 s).
Cookie secret 2 min How often the node changes the secret behind its cookies (below).
Peer sync 60 s + 10 s The agent fetches the allowed devices every minute; the server re-reads the list every 10 s.

Staying up under attack

WAVEX uses WireGuard's denial-of-service design, in three layers:

  1. mac1 — every handshake message ends with a keyed BLAKE2s MAC of itself, keyed by a hash of the receiver's public key. The node checks it before doing any public-key work. Anyone who doesn't know the node's public key (scanners, junk, replays aimed at the wrong node) costs about 3 µs and gets silence.
  2. Cookies (mac2) — above 200 handshakes per second the node asks for a second MAC, keyed by a cookie it sends in a 64-byte encrypted reply bound to the sender's IP address and port. A flood from spoofed addresses never receives the cookie, so it never gets further. The reply is smaller than the request, so the node can't be used to amplify an attack.
  3. Rate limit, only while busy — once cookies are required, a token bucket per (now proven) source address: 200 handshakes at once, then 100 per second, in a table capped at 65,536 addresses. It's generous on purpose: one public address can be a whole mobile network's carrier-grade NAT, with thousands of customers behind it. (A stricter 1-per-second limit, applied all the time, let only 46 of 2,000 devices behind one address connect.)
  4. A separate handshake pool — handshakes (~2 ms of public-key work) run in their own workers behind a bounded queue, so a burst of devices connecting never stalls the traffic of devices already connected; past the queue they're shed and the device retries, as for any lost packet.

Security properties

Property Mechanism
Confidentiality and integrity ChaCha20-Poly1305 on every packet; the header is authenticated too
Mutual authentication Noise IK: the device knows the node's key in advance; the node accepts only devices on its list
Post-quantum confidentiality Hybrid X25519 + ML-KEM-768 through the Noise PSK
Forward secrecy Ephemeral keys per handshake; rekey every 2 min; sessions dead after 3 min
Identity hiding The device's identity is encrypted; the node's is never sent
Handshake replay protection Monotonic per-device timestamp, recorded after success
Data replay protection 2,048-packet sliding window, updated only after authentication
Downgrade resistance There is nothing to negotiate
Silent to the internet No answer to anything that fails mac1 or authentication
Address spoofing inside the tunnel Source must be the device's tunnel IP
Client isolation No device-to-device traffic, in WAVEX and in the node firewall
Robust to packet loss Key confirmation: new keys are used only once both sides have them
Revocation wavex-gateway remove cuts the device's sessions at once; a changed device list is applied within 10 s

Threat model: what WAVEX does not do

Being precise about the limits is part of being secure:

  • Traffic analysis. Packet sizes and timing are visible, as with WireGuard. WAVEX does not pad or shape traffic.
  • Recognisable on the wire. A deep-packet-inspection system can identify WAVEX's packet layout, so a network that blocks VPNs can block it. Stealth transports (below) are on the roadmap.
  • The endpoints. A compromised device or node sees the traffic it handles. Encryption ends there by design.
  • Applying DNS, blocking IPv6 and the kill switch are the client's job. The node pushes its DNS servers and, when it has IPv6, the device's IPv6 address in the handshake, but the client must apply them, block IPv6 when the node offers none, and offer a kill switch. Every WAVEX Connect app must do all three; the Linux command-line client does the first two with -route-all (DNS through systemd-resolved) and has no kill switch yet.
  • Key erasure in memory. Session keys are dropped the moment a session ends and never live longer than 3 minutes, but Go cannot guarantee that the memory holding them is overwritten at once (the garbage collector reuses it later). An attacker who can read the server's memory sees the keys of current sessions anyway.

Comparison

WAVEX v1 WireGuard OpenVPN IKEv2/IPsec
Post-quantum key exchange Yes, by default (ML-KEM-768) No (optional PSK only) No Optional extensions
Handshake round trips 1 1 Several (TLS) 2+
Cipher negotiation None (fixed) None (fixed) Many options Many options
DNS pushed by the server Yes, in the encrypted handshake No (static config) Yes Yes
Several ports at once (e.g. UDP 443) Yes No One per instance No
Forgets your real IP when you leave Yes, 3 min after the session ends No (kept until restart) On disconnect On disconnect
Silent to scanners Yes Yes Only with tls-crypt No
Built-in DoS cookies Yes Yes No Yes (IKE cookies)
Roaming without a new handshake Yes Yes Partly With MOBIKE
Data overhead per packet 32 bytes 32 bytes ~40+ bytes ~50+ bytes
Init packet size 1,332 bytes (or 700-byte fragments on networks that drop large packets) 148 bytes Varies Varies
Runs in User space (Go) Kernel or user space User space Kernel
Code to audit ~650 lines core ~4,000 lines (kernel) ~70,000+ lines Large
Independent audit Not yet Yes, formally verified Yes Yes
Stealth / anti-censorship Not yet No Over TCP/443 No

On a server

  • /etc/wavex/peers.json lists the devices allowed to connect: {"peers":[{"name":"phone","public_key":"…","ip":"10.69.0.2"}]}. wavex-gateway add and remove edit it and apply the change at once; a provider's control plane can write it instead. The server also re-reads it every 10 seconds, and a device that is removed or moved loses its session immediately.
  • The service runs sandboxed by systemd: no new privileges, only the network capabilities it needs, a read-only system, its own runtime directory (systemd-analyze security 5.8, from 9.6 without the sandbox).
  • No traffic logs. The server logs that it started and how many devices are authorized. It does not log client addresses, tunnel IPs, destinations or traffic. It publishes only a count of live sessions for the node's heartbeat.
  • Private keys are written with mode 0600.
  • Anonymous telemetry, on by default and easy to switch off: see below.

Telemetry

So the project can see how WAVEX is used, a gateway sends one small, anonymous ping to https://telemetry.wavevpn.me/v1/ping a few minutes after it starts and then once a day. This is all it sends:

Field Example Meaning
id 4f1c2a9e-… A random id made on first start (/var/lib/wavex/install-id). Not derived from any key.
version, os, arch v0.2.0, Ubuntu 24.04, amd64 What runs
devices, connected 12, 3 How many devices are authorized, and connected right now
uptime_h 5 Hours since the server started
container, ipv6 false, true Whether it runs in a container, and with IPv6

Never addresses (of the server or of devices), keys, device names, destinations or traffic. The receiving end keeps the country the ping came from, not the address. It is never retried more often, and a failed ping changes nothing.

Switch it off with any one of:

sudo wavex-gateway setup -telemetry off     # kept across later setups (on turns it back on)
wavex-gateway run -telemetry=false …        # when you run it by hand
docker run -e WAVEX_TELEMETRY=off …         # the container; WAVEX_TELEMETRY=off works for any of them

Managing a server: the wavex-gateway command

wavex-gateway is also the operator's command, talking to the running service over a root-only control socket in /run/wavex:

wavex-gateway setup [flags]          make this machine a WAVEX server; run again to change a setting, the
                                     others stay: -endpoint HOST -port N -dns LIST -allow-lan -ipv6 auto|on|off
                                     -rate MBIT (speed limit per device) -metrics ADDR (Prometheus, e.g. 127.0.0.1:9101)
wavex-gateway add NAME [-rate MBIT]  allow a device (its own speed limit; 0 = none)
wavex-gateway remove NAME | list     revoke a device at once | the devices allowed, with their limits
wavex-gateway firewall up | down     the NAT and forwarding rules (systemd runs this as wavex-nat)
wavex-gateway uninstall [-purge]                 stop and remove the server (-purge: the key and devices too)
wavex-gateway status                 the service, the node and its traffic at a glance
wavex-gateway users                  connected devices: tunnel IP, real address, since, last seen, traffic
wavex-gateway monitor                live view, refreshed every second, busiest devices first (Ctrl+C to leave)
wavex-gateway logs [-f] [-n 100]     the service log (journald)
wavex-gateway start | stop | restart the systemd service
wavex-gateway debug on [-for 60m]    log server events and every handshake for a while, then back to normal
wavex-gateway debug off | debug      switch debug logging off, or show what is logged now

Logging is off by default. Two switches decide what the server writes: server events (peer list changes, sessions ending) and handshakes (one line per handshake with the device key, tunnel IP, real address and how long it took). They come from /etc/wavex/logging.json ({"server":true,"handshakes":false}), or from wavex-gateway debug on, which turns both on for a limited time (at most 24 hours, kept across restarts and reboots) and then switches itself off. wavex-gateway users shows devices' real addresses live, from memory; nothing is written unless a switch is on.

Scale: 2,000 devices on one node

Measured with tools/loadtest (two containers on one laptop, node limited to 6 CPUs): 2,000 devices behind one IP address connect at the same moment, then each pings the node every second for 30 seconds.

Result
Devices connected 2,000 of 2,000, in 13.4 s, none failed (1,445 cookies answered under load)
Node CPU while all 2,000 connect 7.9% of the node (47% of one core, for 17 s)
Node CPU, 2,000 devices pinging every second 6.2% of the node
Pings 58,000 sent, 58,000 answered, 0 lost; p50 2.6 ms, p99 44 ms
Node memory 16 MB heap, 21 goroutines

What keeps it flat as devices grow: lock-free lookups on every packet (no global lock shared by all cores); O(1) removal of a device (no scan over every session); handshakes in their own pool; rekeys spread out with up to 20 s of random jitter, so devices that connected together don't rekey together every 2 minutes; and a garbage collector tuned for a server (less frequent, with a memory ceiling).

Performance

The data path seals into a reused buffer and decrypts in place. The server opens one SO_REUSEPORT UDP socket and one multi-queue TUN queue per CPU core (-workers, default all cores), with 7 MB socket buffers, and reads up to 64 datagrams per system call (recvmmsg); the client does the same for downloads.

Measured on one laptop (i7-8565U, Docker Desktop VM), two containers, iperf3 for 8 seconds:

Throughput
No VPN 14,206 Mbit/s
WireGuard (kernel module) 381 Mbit/s
WAVEX, first version 237 Mbit/s
WAVEX now 293 Mbit/s (77% of kernel WireGuard, in user space)

Cryptography is not the bottleneck: sealing and opening a full 1,420-byte packet takes 3.2 µs on one core (go test -bench . ./core). Receiving is batched (64 datagrams per recvmmsg); sending is still one system call per packet, and batching it with UDP GSO is the main remaining step to kernel speed.

How it is verified

  • Unit tests (go test ./...): handshake and data in both directions, tampering, replay and reordering, rejection of unknown and stale peers, the replay window at its edges, mac1, cookies and mac2, and the in-place decryption paths.
  • Fuzzing (Go native fuzzing): every parser that reads bytes from the network, including the server handshake (with mac1 recomputed so random input reaches the Noise and ML-KEM code), data packets, and the client's handling of responses and cookie replies. No input may panic. Run one with go test -run=^$ -fuzz=FuzzServerHandshake -fuzztime=10m.
  • End to end: two containers, a full handshake, pings through the tunnel; an unauthorized key gets no answer.
  • Service sandbox: tested under systemd (starts, configures the TUN device, writes its stats).

Status and roadmap

WAVEX v1 is complete as a protocol and runs in production-like tests (2,000 devices on one server, above). It has not yet had an independent security audit. The primitives are standard, but the composition is new, and new compositions deserve outside eyes before they carry anyone's traffic. The plan, phase by phase, is in ROADMAP.md; how to report a vulnerability is in SECURITY.md.

Licence

WAVEX v0.2.0 and later are under the Business Source License 1.1 (LICENSE):

  • Free to read, change and run, for yourself, your household, your organization's own staff and devices, and for anyone free of charge.
  • A commercial licence from WAVEINNO is needed to sell a VPN or network-access service built on WAVEX, or to put WAVEX inside a product you sell. Ask at waveinno.com.
  • Each version becomes Apache-2.0 on its Change Date, four years after its release (v0.2.0: 2030-12-02).
  • v0.1.0 stays Apache-2.0, as it was released.

The names WAVEX and WAVEX Connect and the logo are trademarks of WAVEINNO: see TRADEMARKS.md. Contributions are welcome under the contributor agreement.

Running it by hand

wavex-gateway genkey -key /etc/wavex/server.key     # prints the node public key
wavex-gateway run -peers /etc/wavex/peers.json      # {"peers":[{"public_key":"…","ip":"10.69.0.2"}]}
wavex genkey -key client.key                   # register this public key as a device
wavex up -key client.key -server node:51900 -server-key <node public key> [-route-all]

wavex is the Linux command-line client, for servers, routers and testing. The apps for Windows, macOS, Linux, Android and iOS are WAVEX Connect.

Wire format reference

All integers are little-endian. Every message starts with four bytes: its type, the protocol version (1) and two zero bytes. A receiver drops a message with any other version or non-zero reserved bytes, so a future version is rejected cleanly rather than misread.

Message Direction Layout Size
Init (1) device → node type ‖ 1 ‖ 00 ‖ sender(4) ‖ Noise(e, es, s, ss){ timestamp(12) ‖ ML-KEM key(1184) ‖ options } ‖ mac1(16) ‖ mac2(16) 1,332 B
Response (2) node → device type ‖ 1 ‖ 00 ‖ sender(4) ‖ receiver(4) ‖ ML-KEM ciphertext(1088) ‖ Noise(e, ee, se, psk){ options } ‖ mac1 ‖ mac2 1,186 B + 6 per IPv4 DNS server
Cookie (4) node → device type ‖ 1 ‖ 00 ‖ receiver(4) ‖ nonce(24) ‖ XChaCha20-Poly1305(cookie(16)), AD = the init's mac1 64 B
Data (3) both type ‖ 1 ‖ 00 ‖ receiver(4) ‖ counter(8) ‖ ChaCha20-Poly1305(IP packet), header as AD packet + 32 B
Fragment (5) both type ‖ 1 ‖ 00 ‖ message id(4) ‖ index(1) ‖ count(1) ‖ chunk: an init or response split for networks that drop large datagrams at most 700 B
Constant Value
Noise protocol name Noise_IKpsk2_25519_ChaChaPoly_BLAKE2s
Prologue WAVEX v1
PSK derivation HKDF-SHA256(ikm = ML-KEM secret, salt = SHA-256(encapsulation key ‖ ciphertext), info = "wavex v1 mlkem psk"), 32 bytes
Options type(1) ‖ length(1) ‖ value, at most 512 bytes; unknown types are skipped. 1 = tunnel IPv4 (4), 2 = tunnel IPv6 (16), 3 = DNS server (4 or 16, at most 4), 16 = small replies (init, empty: send the response in fragments), 17 = device info (init: OS and client as text, at most 64 bytes, shown to the operator)
Small handshakes after two unanswered full-size inits, a device sends its init in fragments of at most 700 bytes and asks for the response the same way; the node reassembles at most 4,096 handshakes at once, each for at most 2 s
Clock tolerance an init timestamp may be at most 3 minutes ahead of the node's clock
mac1 key BLAKE2s("mac1----" ‖ receiver public key)
MACs keyed BLAKE2s-128
Replay window 2,048 packets
Maximum counter 2⁶⁰
Tunnel MTU 1420
Cookie threshold 200 handshakes per second
Per-address limit 10 handshakes, then 1 per second; 65,536 addresses tracked

About

WAVEX: source-available VPN protocol with post-quantum key exchange, and a gateway anyone can run. Open Networking. Private by Design.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages