Skip to content

Libertaria Wire Frame Protocol

24/24 Test Suites Passing

The Libertaria Wire Frame (LWF) protocol is the wire format used by the Libertaria protocol stack — a separate project that converges with Nexus OS at the networking layer.

Overview

LWF provides a structured frame format for Libertaria's decentralized communication protocols. It operates alongside UTCP and TCP/IP on the same network:

EtherTypeProtocolPurpose
0x0800IPv4Legacy TCP/IP (LwIP)
0x88B5UTCPNexus sovereign transport
0x4C57LWFLibertaria protocol stack

Integration with Rumpk

LWF is integrated into Rumpk through:

  • Kernel dispatch: The NetSwitch routes frames with EtherType 0x4C57 to the LWF handler fiber
  • Syscalls: SYS_LWF_RECV (0x700) and SYS_LWF_SEND (0x701) provide kernel-mediated ION copy for LWF frames
  • CSpace: LWF_RX (0x600, READ) and LWF_TX (0x601, WRITE) capabilities
  • Pledge: LWF operations require the PLEDGE_INET bit

LWF Adapter

The lwf_adapter.zig module provides a freestanding LWF parser that runs in the kernel's address space:

  • Parses LWF frame headers
  • Validates frame checksums
  • Routes frames to the correct ION Ring
  • Zero-copy — frames are parsed in place, not copied

Capsule Integration

The Capsule NPL (the Libertaria stack's Nexus-native process) uses LWF for all its network communication:

  1. Capsule receives LWF frames via SYS_LWF_RECV
  2. Parses the LWF payload (protocol-specific messages)
  3. Sends responses via SYS_LWF_SEND
  4. Runs an event loop with heartbeat: recv → parse → echo → yield

The Capsule has been verified stable for 30+ seconds of continuous operation with zero faults.

Implementation

The Libertaria stack is implemented in ~15,000 lines of Zig across 24 test suites. It is maintained as a separate project and converges with Nexus OS when the Capsule runs as an NPL payload inside Rumpk.

Released under the CC0 License.