WASTE's design philosophy is still sound: small trusted groups, no central server, encrypted everything, equal nodes. That's essentially what Signal's sealed sender and private groups do today, just without a self-hosted option. This gap is worth filling.
---
## Architecture
Two clean layers, connected by the IPC port.
### Daemon
The real application. A long-running background process that handles everything:
- Peer mesh and connection management
- Cryptography and handshake
- NAT traversal and relay fallback
- File transfer
Exposes a local JSON API over TCP (`127.0.0.1:17337`). Can run headlessly — SSH into a box and the mesh stays alive even with no UI attached.
### UI Layer
Talks to the daemon over the IPC port. The separation means the UI is replaceable without touching the core.
Target: a web frontend (React or similar) wrapped in a native binary using a Tauri-style approach — native packaging, OS webview, no Electron weight. Avoids the wxWidgets ugliness of the old wxWASTE fork and the Qt licensing headaches of the VIA fork.
A terminal UI is worth building first, as a `cmd/tui` using [Bubble Tea](https://github.com/charmbracelet/bubbletea). Since the IPC contract is already the full boundary, a TUI is just another client — connect to `127.0.0.1:17337`, receive the `state_snapshot`, then funnel incoming events into Bubble Tea's update loop. Incoming mesh events map naturally onto its Elm-style message model.
Benefits over jumping straight to a native GUI:
- Works over SSH; zero packaging complexity
- Validates the full IPC protocol and message flow end-to-end
- Useful day-to-day while the native UI is still future work
The TUI doesn't replace the long-term GUI — it won't serve non-technical friends — but it's the right first UI milestone.
The main unsolved problem from the original WASTE — one party always needed an open port.
- Try UDP hole punching (STUN) first
- Fall back to an encrypted relay (DERP-style) when hole punching fails
- Relay sees only opaque encrypted blobs — end-to-end encryption holds
- Run the relay on a Hetzner VPS; `waste-relay` already implements the blind-forward model
### Bootstrapping & Rendezvous
No DHT needed at small group scale (10–50 nodes). Keep it simple:
- Each peer generates an Ed25519 keypair on first run — the public key **is** their identity
- Share a small signed invite file (`.waste-invite`) out of band: email, Signal, whatever
- The invite contains: current IP:port hint + public key + short-lived signature
- Once two peers connect, they gossip each other's addresses to mutual friends
- A local known-peers list in the data directory is sufficient at this scale
### Identity
- Persistent Ed25519 keypair, generated once
- Public key = stable identity, not a mutable nickname
- No phone number, no central registry — closer to Signal's model than WASTE's original unregistered aliases
### Transport (Long-term)
Current transport is TCP with custom framing. QUIC is worth revisiting once the core is solid — it gives multiplexing and better NAT traversal behavior essentially for free.