What's New
This release adds a cross-platform transport — iOS and Android devices can now discover each other and exchange end-to-end encrypted messages over the local network using a platform-neutral wire protocol with a matching Kotlin implementation.
Cross-Platform Transport (Android Interop)
A new CrossPlatform module ships alongside the existing MultipeerConnectivity and remote-relay transports. The legacy wire formats are byte-identical to previous releases — existing consumers are unaffected.
CrossPlatformPool— actor owning the transport lifecycle: host-side handshake + rate limiting, guest-side connection + tap-code key derivation, resume bookkeepingCrossPlatformSession/MoveChannel— per-peer encrypted session with strict monotone sequence counters and replay rejection- Canonical JSON wire format — keys sorted by Unicode code point, no insignificant whitespace, ISO-8601 millisecond timestamps, RFC-4648 padded base64 payloads — byte-identical encoding across Swift and Kotlin
- ChaCha20-Poly1305 + HKDF-SHA256 — a 6-digit tap code plus per-side handshake nonces derive directional session keys; frames are length-prefixed AEAD
- Bonjour/mDNS discovery —
BonjourAdvertiser(NWListener) andBonjourBrowser(NWBrowser) with TXT records; service type is disjoint from the MultipeerConnectivity transport so the two coexist - Session resume — guests reconnect after a drop and re-handshake under fresh keys; the host replays unacknowledged frames from its outbound buffer
- Host-side hardening — per-IP hello rate limiting, handshake timeouts, device blocking, and a closed 13-tag error taxonomy (
CrossPlatformTransportError) mirrored on both platforms - Transport-agnostic core — the pool operates on a
RawConnectionabstraction; production wrapsNWConnectionviaSocketConnection, tests useInMemoryConnection.pair() - Frozen reference vectors — HKDF, handshake, encrypted-frame, and game-action vectors asserted byte-equal on both the Swift and Kotlin sides lock wire compatibility
Compatibility
- Legacy
PoolMessage/ MC / relay encoders unchanged — fully backward compatible - All 213 tests pass, including the pre-existing MC and relay suites