rift-protocol 0.1.2

Versioned wire protocol framing and message types for Rift P2P
Documentation

rift-protocol


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

What's in this crate?

rift-protocol defines the on-the-wire format for all rift messages:

  • Message Types — Chat, voice, control, and relay messages
  • Framing — Length-prefixed binary encoding
  • Versioning — Protocol version negotiation
  • Serialization — Efficient bincode encoding/decoding

Usage

use rift_protocol::{RiftMessage, ChatMessage, VoiceFrame};
use rift_core::PeerId;

// Create a chat message
let chat = ChatMessage::new(
    peer_id,
    timestamp,
    "Hello, world!".to_string(),
);

// Encode for transmission
let bytes = chat.encode()?;

// Decode on receive
let msg = RiftMessage::decode(&bytes)?;

Protocol Documentation

See PROTOCOL.md for the full protocol specification.

Related Crates

Crate Description
rift-core Core types and identity
rift-mesh Mesh networking layer
rift-media Audio encoding for voice frames

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.