conv.

All stories
TechQuiet 13d · day 13

Firezone releases Sanstun, a sans-IO WireGuard implementation in Rust

After two years of patching boringtun, Firezone built a cleaner WireGuard state machine designed for parallel-friendly APIs and testability.

What to know

  • Firezone released Sanstun, a new WireGuard implementation in Rust built on sans-IO principles that separate business logic from IO and timing side effects.
  • The project emerged from Firezone's experience maintaining 70+ patches to boringtun while trying to retain upstream API compatibility—a constraint that became unsustainable as product needs evolved.
  • Sanstun eliminates internal buffering and automatic session management, moving those responsibilities to the caller for simpler, more testable APIs that better align with sans-IO design.

Firezone Developer of Sanstun

How it unfolded 1 development · click the chart to see its coverage articlesposts

Peak 5 pieces in 3h at Oct 30, 5 PM; 13 pieces over 13 days (1 article · 2 posts · 10 comments) Oct 30, 5 PM — 5 pieces · 1 article · 1 post · 3 comments — Hacker News 4, Newswires 1Oct 30, 8 PM — 3 pieces · 3 comments — Hacker News 3Oct 30, 11 PM — 2 pieces · 1 post · 1 comment — Hacker News 1, Mastodon 1Oct 31, 2 AM — 3 pieces · 3 comments — Hacker News 3Oct 31, 5 AM — quietOct 31, 8 AM — quietOct 31, 11 AM — quietOct 31, 2 PM — quietOct 31, 5 PM — quietOct 31, 8 PM — quietOct 31, 11 PM — quietNov 1, 1 AM — quietNov 1, 4 AM — quietNov 1, 7 AM — quietNov 1, 10 AM — quietNov 1, 1 PM — quietNov 1, 4 PM — quietNov 1, 7 PM — quietNov 1, 10 PM — quietNov 2, 1 AM — quietNov 2, 4 AM — quietNov 2, 7 AM — quietNov 2, 10 AM — quietNov 2, 1 PM — quietNov 2, 4 PM — quietNov 2, 7 PM — quietNov 2, 10 PM — quietNov 3, 1 AM — quietNov 3, 4 AM — quietNov 3, 7 AM — quietNov 3, 10 AM — quietNov 3, 1 PM — quietNov 3, 4 PM — quietNov 3, 7 PM — quietNov 3, 10 PM — quietNov 4, 1 AM — quietNov 4, 4 AM — quietNov 4, 7 AM — quietNov 4, 10 AM — quietNov 4, 1 PM — quietNov 4, 4 PM — quietNov 4, 7 PM — quietNov 4, 10 PM — quietNov 5, 1 AM — quietNov 5, 4 AM — quietNov 5, 7 AM — quietNov 5, 10 AM — quietNov 5, 1 PM — quietNov 5, 4 PM — quietNov 5, 7 PM — quietNov 5, 10 PM — quietNov 6, 1 AM — quietNov 6, 4 AM — quietNov 6, 7 AM — quietNov 6, 10 AM — quietNov 6, 1 PM — quietNov 6, 4 PM — quietNov 6, 7 PM — quietNov 6, 10 PM — quietNov 7, 1 AM — quietNov 7, 4 AM — quietNov 7, 7 AM — quietNov 7, 10 AM — quietNov 7, 1 PM — quietNov 7, 4 PM — quietNov 7, 7 PM — quietNov 7, 10 PM — quietNov 8, 1 AM — quietNov 8, 4 AM — quietNov 8, 7 AM — quietNov 8, 10 AM — quietNov 8, 1 PM — quietNov 8, 4 PM — quietNov 8, 7 PM — quietNov 8, 10 PM — quietNov 9, 1 AM — quietNov 9, 4 AM — quietNov 9, 7 AM — quietNov 9, 10 AM — quietNov 9, 1 PM — quietNov 9, 4 PM — quietNov 9, 7 PM — quietNov 9, 10 PM — quietNov 10, 1 AM — quietNov 10, 4 AM — quietNov 10, 7 AM — quietNov 10, 10 AM — quietNov 10, 1 PM — quietNov 10, 4 PM — quietNov 10, 7 PM — quietNov 10, 10 PM — quietYesterday, 1 AM — quietYesterday, 4 AM — quietYesterday, 7 AM — quietYesterday, 10 AM — quietYesterday, 1 PM — quietYesterday, 4 PM — quietYesterday, 7 PM — quietYesterday, 10 PM — quietToday, 1 AM — quietToday, 4 AM — quietToday, 7 AM — quietToday, 10 AM — quietToday, 1 PM — quietToday, 4 PM — quietToday, 7 PM — quiet 1
Oct 31Nov 1Nov 2Nov 3Nov 4Nov 5Nov 6Nov 7Nov 8Nov 9Nov 10yesterdaynow · 8:25 PM ET
  1. 1

    Sanstun removes internal buffering for simpler, more testable APIs

    A key design decision in Sanstun was eliminating internal buffering—boringtun automatically established sessions and buffered packets, but Sanstun puts that responsibility on the caller. This simplifies both the interface and implementation, and aligns with sans-IO principles by removing side effects from the library.

    “Just don't buffer in the library. It simplifies the interface and the implementation on both sides.”
    — Firezone
    • > Async is not I/O. It can be used for I/O, but it's just a way of writing pure, deterministic state machines that keeps a logical flow together instead of scattered over a bunch of transitions.I argue that it is exactly opposite. Blocking threads are a much more natural way of thinking about concurrency.Quote from the erlang creator Joe…

      fzeindlHacker News12d agoview on Hacker News ↗
    2 more of the top 3 · 10 posts in this stretch
    • > flow that crosses several state transitions (and may have other disjoint parts of the state updated in the meantime, via other transitions) now has to be rewritten as a (series of) state transitions, and can't be called from a blocking functionThis is incorrect. You can easily call that flow from a blocking function, just call it in a loop.What…

      SkiFire13Hacker News12d agoview on Hacker News ↗
    • In principle, you are right. Async is not I/O. And yes, `async` functions compile to a deterministic state machine.The problem is, the moment you use `async`, your state machine reduces down to one API: `poll`. What if I want to change some state in-between two state transitions (i.e. between two `await` points)? Now I have to wire-in a channel to…

      wh33zleHacker News12d agoview on Hacker News ↗
    all of them →
  2. background

    Firezone details motivations: two years of boringtun patches — Firezone explained that after adopting boringtun for WireGuard, they found themselves maintaining over 70 patches to add features and fix edge cases while trying to keep upstream compatibility. As product requirements evolved, retaining 100% API compatibility became increasingly difficult, leading to the decision to build Sanstun from scratch.

  3. background

    Firezone announces Sanstun, a sans-IO WireGuard implementation — Firezone released Sanstun, a Rust implementation of the WireGuard state machine built on sans-IO principles. The library separates IO and side-effects (including time and randomness) from business logic, enabling easier testing and composition while avoiding function coloring problems.

What people are saying 7 voices from 1 site · best of 10 · verbatim