rift-discovery 0.1.4

Peer discovery via mDNS and DHT for Rift P2P
Documentation

rift-discovery


Part of the riftd project — serverless P2P voice + text chat over UDP.

What's in this crate?

rift-discovery combines local and wide-area peer discovery:

  • mDNS Discovery — Find peers on the local network automatically
  • DHT Discovery — Find peers anywhere on the internet
  • Service Browsing — Discover rift channels and peers
  • Peer Announcement — Advertise your presence
  • Unified API — Single interface for all discovery methods

Usage

use rift_discovery::Discovery;

let discovery = Discovery::new(peer_id).await?;

// Start announcing
discovery.announce(channel_id).await?;

// Discover peers (combines mDNS + DHT)
let mut stream = discovery.discover();
while let Some(peer) = stream.next().await {
    println!("Found peer: {:?}", peer);
}

How Discovery Works

  1. LAN — mDNS broadcasts find peers on the same network instantly
  2. Internet — DHT queries find peers anywhere (requires bootstrap)
  3. Invites — Direct connection via invite tokens (see rift-rndzv)

Related Crates

Crate Description
rift-dht DHT implementation
rift-rndzv Invite-based rendezvous
rift-mesh Mesh networking layer

Citation

If you use riftd in academic work, please cite:

de Beer, R. (2026). Predictive Rendezvous: Time–Intent–Deterministic Peer Coordination Without Infrastructure. Zenodo. https://doi.org/10.5281/zenodo.18528430

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.