#p2p #chat #protocols #networking

rift-protocol

Versioned wire protocol framing and message types for Rift P2P

5 releases

0.1.4 Feb 11, 2026
0.1.3 Feb 11, 2026
0.1.2 Feb 11, 2026
0.1.1 Feb 10, 2026
0.1.0 Feb 10, 2026

#246 in #chat


Used in 5 crates

Apache-2.0 OR MIT

47KB
830 lines

rift-protocol

riftd

crates.io docs.rs License DOI

Versioned wire protocol framing and message types for the riftd P2P 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.

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.

Dependencies

~7–18MB
~196K SLoC