tpt-webrtc

Rust

Pure-Rust, formally-verified WebRTC stack — AV1-first, zero libwebrtc, MIT OR Apache-2.0.

0 stars0 forks0 watchersApache License 2.0

Languages

Rust96.2%C2.1%Go1.3%Python0.4%
README

tpt-webrtc

A complete, production-ready WebRTC implementation in pure Rust.

Mission: replace Google's 2-million-line C++ libwebrtc with a memory-safe, AV1-first, formally-verified WebRTC stack:

  • Full protocol stack — ICE, STUN, TURN, DTLS-SRTP, RTP/RTCP, SCTP data channels
  • AV1-first codecs — AV1 / VP8 / VP9 / Opus; zero H.264 (patent-royalty avoidance)
  • Zero libwebrtc — no Google C++ code, no GN build hell, no hidden patent traps
  • Formally verified core state machines — ICE and DTLS handshake contracts verified via tpt-telos
  • Async-native — built on tokio for high-concurrency server and client use

Dual-licensed under MIT OR Apache-2.0. See LICENSE-MIT and LICENSE-APACHE.

Crates

CrateLayer
tpt-webrtc-coreAsync runtime integration, socket abstraction, errors, crypto primitives
tpt-webrtc-sdpSDP parser/generator (RFC 8866), BUNDLE / RTCP-MUX, offer/answer model
tpt-webrtc-iceICE agent (RFC 8445), STUN (RFC 8489), TURN (RFC 8656)
tpt-webrtc-dtlsDTLS 1.2 (RFC 6347), DTLS-SRTP key derivation, SRTP sessions
tpt-webrtc-rtpRTP/RTCP packetization, payload packetizers, RTCP feedback, jitter buffer
tpt-webrtc-sctpSCTP over DTLS (RFC 8831) for data channels
tpt-webrtc-codecsAV1 (rav1e/dav1d), VP8/VP9, Opus, hardware acceleration
tpt-webrtc-mediaAudio processing (AEC/NS/AGC), BWE (GCC/TWCC/REMB), simulcast
tpt-webrtc-appHigh-level PeerConnection API, signaling integration

The full design lives in spec.txt; the build plan in todo.md.

Status

Phases 1–5 (foundation, security & transport, application layer, media processing) are implemented and integration-tested: two PeerConnections complete SDP negotiation, ICE, DTLS-SRTP and SCTP data channels end-to-end over real loopback UDP, with SRTP-protected audio verified on the receive path. Phase 3 (native codecs: dav1d/vpx/opus/hardware) is environment-blocked; see todo.md. Phase 6 bindings and Phase 7 interop remain.