Proof of concept mechanical port of ircnet/ircd to Rust as part of a bit about C being insecure for network services
1

Configure Feed

Select the types of activity you want to include in your feed.

4.6k 2 7

Clone this repository

https://tangled.org/xeiaso.net/ircd.rs https://tangled.org/did:plc:vudi3by7z2tnojq3uzbrtkdn
git@tangled.org:xeiaso.net/ircd.rs git@tangled.org:did:plc:vudi3by7z2tnojq3uzbrtkdn

For self-hosted knots, clone URLs may differ based on your setup.



README.md

leveva — an idiomatic-Rust IRC daemon#

NOTE: by reading this README or any of the code, you hereby and irrevocably agree to leave the IRCNet team alone with regards to this repo. This experiment was done without their knowledge, consultation, or any belief on my part that this will be anything but an experiment to see what is possible with tools that exist today.

This repo started as a mechanical C→Rust port of ircnet/ircd 2.11 — a faithful, byte-for-byte translation kept honest against the original C as a differential oracle. That port did its job and is gone. What remains is what it was scaffolding for: leveva, a from-scratch, idiomatic-Rust IRC daemon that grew to feature parity against the mechanical port and then replaced it.

So this is a finished strangler fig: the C tree was strangled by a faithful Rust port, the faithful port was strangled by leveva, and now only leveva is left standing.

What leveva is#

A single-binary IRCnet-style daemon written in idiomatic async Rust:

  • tokio runtime, one task per connection — no select()/poll() loop, no global buffers, no unsafe FFI seam.
  • rustls TLS (via ring, no system OpenSSL) with hot certificate reload.
  • KDL config (typed, validated) instead of the C daemon's pipe-delimited single-letter lines.
  • Typed identifier strings (Nick/ChanName/Uid/Sid/…) that reject illegal input at construction, and casemapping-aware string types.
  • The full IRCnet client surface (registration, channels + channel/user modes, WHO/WHOIS/WHOX, OPER/STATS, …), the UID-based S2S link/burst/netsplit protocol (UNICK/NJOIN/SAVE/EOB), and a growing IRCv3 track (CAP, message-tags + delivery plane, away/account/invite/echo/server-time, MONITOR, chghost/setname, multi-prefix, standard-replies, WebSocket transport, …).
  • In-process authentication (leveva-iauth: ident/dnsbl/socks/webproxy), running as an .await in the per-connection task rather than a separate iauth process.

The behavioral guarantees are carried by leveva's own self-contained test suite — boot-golden snapshots plus property-based (proptest) fuzzing for essentially every command.

Workspace layout#

Crate What it is
leveva the daemon (library + the leveva binary)
leveva-iauth in-process async authentication modules

Build and run#

cargo build --release -p leveva --bin leveva
./target/release/leveva --config path/to/ircd.kdl

Useful flags: --check (validate the config and exit), --motd <file>, --log-level <level|RUST_LOG-filter>. Example configs live in leveva/examples/ (simple.kdl is a good starting point).

Container images build with buildx bake:

docker buildx bake leveva

History and how it was built#

leveva was built with Claude Code and the superpowers plugin, one differentially verified slice at a time. The full migration story — the mechanical port, the 4-layer test harness, the phase-by-phase plan, and the pivot to leveva — lives in PLAN.md, with per-phase progress logs under docs/progress-log/ and the generated specs/plans under docs/superpowers/. The deleted mechanical port, the C source tree, and the differential oracles all remain recoverable from git history.