2026-06-21 16:14:07 +02:00
# waste-go
A modern reimagining of [WASTE ](https://en.wikipedia.org/wiki/WASTE ) — decentralized,
friend-to-friend encrypted mesh networking with chat and file sharing. Written in Go.
## Project layout
```
waste-go/
├── cmd/
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
│ ├── daemon/ The peer process — run one on each friend's machine
│ └── anchor/ WebSocket signaling server — run this on your Hetzner VPS
2026-06-21 16:14:07 +02:00
└── internal/
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
├── proto/ All wire types (shared by daemon and anchor)
├── crypto/ Ed25519 identity, nacl/box signaling, ChaCha20-Poly1305
<20> <> <EFBFBD> ── mesh/ Connected peer state + DataChannel helpers
├── anchor/ Anchor client — WebRTC signaling via the anchor server
└── ipc/ Local JSON API (UI talks to daemon here, port 17337)
2026-06-21 16:14:07 +02:00
```
## Prerequisites
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
- Go 1.24+ → https://go.dev/dl/
2026-06-21 16:14:07 +02:00
- VS Code with the Go extension (`golang.go` )
On first open VS Code will prompt you to install `gopls` , `dlv` , and `goimports` — accept all of them.
## Getting started
```bash
# Fetch dependencies
go mod tidy
# Build everything (confirms it compiles)
go build ./...
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
# Terminal 1 — anchor (required for peers to find each other)
go run ./cmd/anchor -bind 127.0.0.1:17339
2026-06-21 16:14:07 +02:00
# Terminal 2 — peer A
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
go run ./cmd/daemon -alias alice -data-dir /tmp/waste-alice -ipc-port 17337 -anchor ws://127.0.0.1:17339/ws
2026-06-21 16:14:07 +02:00
# Terminal 3 — peer B
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
go run ./cmd/daemon -alias bob -data-dir /tmp/waste-bob -ipc-port 17341 -anchor ws://127.0.0.1:17339/ws
2026-06-21 16:14:07 +02:00
```
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
Both peers join the same named network via IPC:
2026-06-21 16:14:07 +02:00
```bash
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
# Join peer A to a network called "friends"
echo '{"type":"join_network","network_name":"friends"}' | nc 127.0.0.1 17337
2026-06-21 16:14:07 +02:00
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
# Join peer B to the same network
echo '{"type":"join_network","network_name":"friends"}' | nc 127.0.0.1 17341
# Subscribe to peer A's events (in a separate terminal)
2026-06-21 16:14:07 +02:00
nc 127.0.0.1 17337 &
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
# Send a message from B
2026-06-21 16:14:07 +02:00
echo '{"type":"send_message","room":"general","body":"hello from bob"}' | nc 127.0.0.1 17341
```
**On Windows** — use PowerShell's built-in TCP client instead of `nc` :
```powershell
$c = [System.Net.Sockets.TcpClient]::new('127.0.0.1', 17341)
$w = [System.IO.StreamWriter]::new($c.GetStream()); $w.AutoFlush = $true
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
$w.WriteLine('{"type":"join_network","network_name":"friends"}')
2026-06-21 16:14:07 +02:00
$w.WriteLine('{"type":"send_message","room":"general","body":"hello from bob"}')
# In a separate terminal — subscribe to peer A's events
$r = [System.Net.Sockets.TcpClient]::new('127.0.0.1', 17337)
$reader = [System.IO.StreamReader]::new($r.GetStream())
while ($true) { $reader.ReadLine() }
```
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
## Deploying the anchor on your Hetzner VPS
2026-06-21 16:14:07 +02:00
```bash
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
GOOS=linux GOARCH=amd64 go build -o bin/waste-anchor ./cmd/anchor
scp bin/waste-anchor user@your -vps:~/
2026-06-21 16:14:07 +02:00
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
# On the VPS (also run coturn in STUN-only mode on port 3478)
./waste-anchor -bind 0.0.0.0:17339
2026-06-21 16:14:07 +02:00
```
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
Then start daemons with `-anchor ws://your-vps-ip:17339/ws` and they'll connect via WebRTC
with ICE (STUN-assisted hole punching) through the anchor for signaling.
2026-06-21 16:14:07 +02:00
## IPC protocol (plain JSON over TCP)
Everything is newline-delimited JSON. You can test with `nc 127.0.0.1 17337` .
**Commands you send:**
```jsonc
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
{"type":"join_network","network_name":"friends"}
{"type":"leave_network"}
2026-06-21 16:14:07 +02:00
{"type":"send_message","room":"general","body":"hi"}
{"type":"get_state"}
```
**Events the daemon pushes:**
```jsonc
{"type":"state_snapshot","local_peer":{...},"connected_peers":[...]}
{"type":"peer_connected","peer":{...}}
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
{"type":"session_ready","peer_id":"<hex>","nick":"alice"}
{"type":"message_received","message":{"from":"<hex>","body":"hi","room":"general"}}
{"type":"peer_disconnected","peer_id":"<hex>"}
2026-06-21 16:14:07 +02:00
```
## Crypto choices
| Purpose | Algorithm | Notes |
|---|---|---|
| Identity | Ed25519 | Fast, small keys, standard |
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
| Peer ID | Hex-encoded Ed25519 pubkey | 64 lowercase hex chars (YAW/2 §2) |
| Signaling encryption | XSalsa20-Poly1305 (`nacl/box` ) | X25519 keys derived from Ed25519 identity (YAW/2 §3) |
| Transport | WebRTC DataChannels (DTLS+SCTP) | pion/webrtc — ICE, hole punching included |
| Hashing | SHA-256 | File integrity, network name hashing |
2026-06-21 16:14:07 +02:00
Replaces WASTE's original Blowfish/PCBC (broken cipher mode) + RSA.
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
> Peer IDs are 64-char lowercase hex (Ed25519 public key). Existing `identity.json` files
> on disk are unaffected — only the over-the-wire representation changed from base64url.
2026-06-21 18:16:45 +02:00
## Testing
A self-contained test script boots anchor + three peers, joins them to a named network, exchanges group messages and DMs, and verifies SQLite persistence:
```bash
./test-network.sh
```
Data lands at `/tmp/waste-test` (wiped on each run). Inspect after a run:
```bash
sqlite3 /tmp/waste-test/alice/messages.db
.headers on
SELECT room, from_peer, body, sent_at FROM messages;
SELECT peer_id, alias, last_seen FROM peers;
```
2026-06-21 16:14:07 +02:00
## Roadmap
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
- [x] **Crypto layer ** — hex peer IDs, `nacl/box` signaling, Ed25519→X25519 key derivation
2026-06-21 18:16:45 +02:00
- [x] **Proto additions ** — `mid` dedup field, signaling types, anchor wire types, `hello` message
- [x] **Anchor server ** (`cmd/anchor` ) — WebSocket signaling server replacing TCP relay
- [x] **WebRTC peer connections ** — pion/webrtc DataChannels; ICE hole-punching via STUN
- [x] **Anchor client ** (`internal/anchor` ) — offer/answer/candidate lifecycle, `nacl/box` sealing
- [x] **IPC updates ** — `join_network` /`leave_network` ; `session_ready` event; DMs via `to` field
- [x] **Message persistence ** — SQLite (`internal/store` ); messages and peer alias cache
- [ ] **TUI ** — Bubble Tea terminal UI consuming the IPC port
Migrate to YAW/2 protocol: WebRTC transport, anchor signaling, nacl/box crypto
Replace the original raw-TCP peer connections and Blowfish/RSA-era design with
the YAW/2 protocol stack:
Transport
- internal/mesh/peer.go: raw TCP + manual ECDH replaced with pion/webrtc
DataChannels (ICE, DTLS, SCTP). Peers negotiate via sealed offer/answer/
candidate exchange rather than direct dialling.
- internal/nat: deleted — ICE subsumes everything this package was going to do.
Signaling
- cmd/anchor: new WebSocket signaling server (replaces cmd/relay). Verifies
Ed25519 challenge/join signatures, routes opaque nacl/box blobs, broadcasts
peer-join/peer-leave events. Never sees plaintext signaling content.
- internal/anchor: new anchor client. Manages PeerConnection lifecycle,
decides offerer by peer-id comparison, seals/opens signaling payloads with
nacl/box, implements mesh.Anchor.
Crypto (internal/crypto)
- PeerID encoding: base64url → lowercase hex (64 chars, YAW/2 §2).
- Sign/Verify: hex signatures throughout.
- Added CurvePublicKey/CurvePrivateKey: X25519 keys derived from Ed25519
identity via Montgomery conversion (filippo.io/edwards25519), matching
libsodium's crypto_sign_ed25519_*_to_curve25519.
- Added SignalingBox/SignalingOpen: nacl/box (XSalsa20-Poly1305) seal/open
for signaling payloads.
Wire types (internal/proto)
- ChatMessage gains Mid (random 16-byte hex) for mesh deduplication (§8).
- FileChunk removed from PeerMessage — chunks go on a separate binary
DataChannel labelled "f:<xid>"; FileDone added.
- New types: SignalingPayload, AnchorMessage, HelloMessage, HelloBindString.
- PeerID.Short() now returns first 16 hex chars grouped in 4s.
- IPC: CmdConnect removed; CmdJoinNetwork/CmdLeaveNetwork added;
EvtSessionReady added (fires when DataChannel opens and hello is received).
IPC (internal/ipc)
- join_network/leave_network replace connect (direct TCP dial).
- Network joins are context-scoped: leave_network or client disconnect
cancels the anchor connection cleanly.
README updated to reflect new project layout, getting-started commands,
IPC protocol, and roadmap state.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-21 17:48:14 +02:00
- [ ] **File transfer ** — chunked binary DataChannel (`f:<xid>` )
- [ ] **Native UI ** — web frontend with native packaging (Tauri-style)