← All posts

Why we picked WireGuard over a custom protocol (and what we gave up)

When we started building HostAnywhere, the protocol question came up early. Many mesh networking products built in the last few years use WireGuard. A few — most notably ZeroTier — use a custom protocol. Both choices have real trade-offs.

We picked WireGuard. This post is about why, and — equally important — what we gave up.

What WireGuard is, in one paragraph

WireGuard is a minimal, modern VPN protocol that runs over UDP. It uses Curve25519 for key exchange, ChaCha20-Poly1305 for authenticated encryption, and BLAKE2s for hashing. The Linux implementation is small compared with older VPN stacks, and WireGuard was merged into the mainline Linux kernel in 5.6. It also has mature cross-platform implementations across macOS, Windows, iOS, and Android.

It is intentionally opinionated and small. WireGuard gives you encrypted point-to-point tunnels. It does not solve key distribution, NAT traversal, identity, device inventory, access policy, DNS, or user management. Everything around the tunnel is the responsibility of the product built on top.

How HostAnywhere runs WireGuard

HostAnywhere runs WireGuard in userspace on all five platforms — Windows, macOS, Linux, iOS, and Android. The userspace data plane gives us:

On Windows, macOS, iOS, and Android, userspace is effectively the only practical option for an application — those OSes don't expose a kernel WireGuard module the way Linux does. On Linux, kernel WireGuard exists (merged in 5.6) and some products use it directly. We picked userspace on Linux too, to keep a single code path across the entire fleet.

The case for WireGuard

The case is mostly about leverage:

The leverage matters because it means we spend our engineering time on the layer above WireGuard — the mesh coordination, the policy engine, the integrations, the storage server, the phone backups — not on rolling our own crypto.

The case for a custom protocol

It's a real case. ZeroTier has run a custom protocol since 2015. Their team has reasons:

These are real capabilities. If your use case depends on Layer-2 bridging, ZeroTier is likely a better fit than a pure WireGuard-based Layer-3 mesh.

What we gave up by picking WireGuard

Honest list:

  1. No Layer-2 mesh. HostAnywhere is Layer 3 only. If you need broadcast/multicast across the mesh, or you're running legacy protocols that don't speak IP routing, we don't cover that case.
  2. No flow-rules DSL. Our access control is a UI-driven rule list with allow/deny and posture conditions. You can express the common cases (allow tag A to reach device B on port C when posture is X), but you can't write arbitrary packet-inspection logic the way ZeroTier flow rules let you.
  3. No Layer-2 bridging into physical Ethernet segments. HostAnywhere can route IP subnets through gateways — that's what our VPN Gateway does. But it does not make a remote device behave like it's plugged into the same Ethernet switch. Industrial / OT users who need a true virtual Ethernet port will pick something else.
  4. No custom protocol features at the data-plane level. Anything we ship has to live above WireGuard's stable wire format. Most product features don't care about this. A few — like dynamic per-packet rate limiting or in-band traffic classification — would be easier with protocol-level hooks.

Each of those is a real trade-off. For each one, there's some real user out there for whom it's the deciding constraint. We made the choice knowing those users would pick differently.

Why we made the trade

Three reasons.

One: the leverage compounds. Every engineer-hour we don't spend building a data plane is an engineer-hour we spend on the layer above. The phone backup architecture, the Storage Server replication, the CrowdStrike integration, the Internet Gateway failover — those features exist because we're not also maintaining a custom crypto stack.

Two: WireGuard's ecosystem keeps growing. Kernel inclusion is rare in the networking world. Once a protocol is in the mainline Linux kernel, it becomes available across a huge range of future Linux distributions, appliances, servers, and embedded systems. Mature cross-platform implementations elsewhere mean we are not designing a new cryptographic data plane for every OS.

Three: smaller attack surface, less reputational risk. A small, audited implementation and well-reviewed protocol surface is a smaller "trust us, we got the crypto right" ask than rolling our own. For a product positioned around security, having WireGuard's track record under the hood means we're not asking customers to also evaluate our novel cryptographic choices.

What about the convenience features?

A common follow-up: "But Tailscale has MagicDNS, Tailscale SSH, and Taildrop. WireGuard didn't give them those — they built them on top. Why don't you have them?"

Fair question. Those features are not data-plane concerns. They're conveniences in the user-facing product, built on top of whatever mesh you have. They take engineering time to build. We haven't built them yet. They're on our roadmap; none of them require a custom protocol.

The reason we focused elsewhere first is product shape. Our bet is that most users who care about a mesh also care about exposing services, posture-gating access, and phone backups. So we built those things first. MagicDNS-equivalents and SSH-key-replacement are convenience layers we'll add — but they're not what changed our minds about WireGuard. Choosing WireGuard did not prevent us from building those features; it only means they belong above the tunnel, not inside the tunnel.

A note for builders

If you're building a mesh product today and weighing the protocol choice, the questions we'd ask:

WireGuard isn't the answer for every mesh product. It was the right answer for the product we're trying to build.

A few practical notes from the road

If you're already deciding between WireGuard-based products, two things worth knowing:

See the HostAnywhere docs for technical details on mesh networking, VPN Gateway routing, and access control — or follow @HostAnywhere on LinkedIn for more engineering posts.