Skip to main content
The Artifact

Live broadcast. Signed all the way.

Seventeen Rust crates that publish, relay, adapt, egress, and consume media as a chain of signed receipts. Every object's content hash, every group's Merkle root, every relay hop preserved end-to-end. Click any stage.

Live · production

Real-time group receipts from tv.transaction.science/moq-wai-audio

Pulled in your browser from the prod WAI audio publisher. Each receipt covers a 250 ms group of 5 Matryoshka audio layers, each wrapped in a WAI v1.0 envelope. The Ed25519 group signature is verified locally — open devtools and inspect the network tab.

loading…

The pipeline

Six stages. Seventeen crates.

Publish → Relay → Subscribe → Adapt → Egress → Bridge. Every stage forwards JWP receipts unaltered; no node along the chain re-issues a signature or modifies a Merkle root. Per the receipt sub-spec (open-standards/wai/extensions/jwp-receipts.md §4), a conforming relay MUST NOT strip the parent_receipt_hash — so the chain end-to-end stays cryptographically connected from publisher to browser.

Pub
Stage component
Publisher SDK
446 LOC · 5 tests

Track lifecycle · group lifecycle · joule metering · WAI envelope wrap.

joule-moq-publisher. Manages a publishing identity (Ed25519 signing key + optional TrustOS credential), a track catalog, a group lifecycle (start_group → push_object* → finalize_group), and per-object microjoule accounting. push_object_wai() wraps caller-provided codec bytes in a WAI v1.0 envelope and flips ObjectHeader.wai_envelope = true; content hash + Merkle root cover the envelope bytes.

Sample receipt
JWP ReceiptPayload
kind "comms.publisher.group.finalized"
tracks_registered 1
groups_emitted monotonic per track
wai_mode opt-in via push_object_wai
joules 0.42
cite "joule-moq-publisher v0.1 · open-standards/wai/SPEC.md §2 · open-standards/wai/extensions/jwp-receipts.md"
sig "ed25519:0x4f...c1a"
Anatomy — operational specs
API surface
push_object · push_object_layered · push_object_wai · finalize_group
Sink trait
PublisherSink (Send + Sync)
Joule accounting
per-object microjoules, lifetime AtomicU64
Receipt hashing
BLAKE3-256 over delivered payload bytes
MoQ
Stage component
Wire (inv-moq)
2,665 LOC · draft-08

MoQT wire codec + JWP receipt extension + Track/ObjectHeader schema.

inv-moq. Targets draft-ietf-moq-transport draft-08 with custom object-header extensions for Matryoshka layer index (mrl_layer / mrl_total_layers) and the WAI envelope flag (wai_envelope, post-W1). Plus a first-class JWP receipt extension: per-object content hash, per-group Merkle root, Ed25519 group signature with cross-hop preservation guarantees.

Anatomy — operational specs
Module map
endpoint · messages · receipt · session · track · transport_quic · wai_dispatch · wire
Draft version
MOQT_DRAFT_VERSION = 0xff00_0008 (draft-08)
Receipt schema version
JWP_MOQ_EXTENSION_VERSION = 1
Backward compat
#[serde(default)] + skip_serializing_if on new fields
PCM
Stage component
Audio codec
1,021 LOC · 5-layer Matryoshka

comms.audio.layered-pcm — 8/16/24/32/48 kHz fidelity ladder, codebook-free.

joule-moq-audio. The Matryoshka audio codec: 5 nested PCM fidelity layers (8 / 16 / 24 / 32 / 48 kHz) where each higher layer is an additive refinement of the lower. Deterministic, bit-exact, no neural prior — registered as comms.audio.layered-pcm (CommunicationOS-internal extension per PLAN D1, NOT a wai.neural.*). publish_audio_clip_wai() emits one MoQT object per layer, all wrapped in WAI envelopes under a shared manifest.

Anatomy — operational specs
Capability id
comms.audio.layered-pcm
Sample rates
8 / 16 / 24 / 32 / 48 kHz
Layers per group
5 (mrl_layer 0..=4)
Determinism
bit-exact across runs at fixed input
Mtk
Stage component
Multi-track
728 LOC · BCP-47

Track catalog + naming convention + WebVTT routing.

joule-moq-multi-track. Convention layer over inv-moq's track namespaces: audio.{bcp47} for spoken-language audio tracks, subtitle.{bcp47} for WebVTT subtitle tracks, audio_desc.{bcp47} for descriptive audio. A single closing-call namespace can carry English audio, Spanish audio, Spanish subtitles, and English audio-description as parallel tracks; subscribers select by tag.

Anatomy — operational specs
Naming
audio.{en, es, fr…} · subtitle.{en, es…} · audio_desc.{...}
Language tags
BCP 47 (RFC 5646)
Subtitle wire
WebVTT framed as MoQT objects
Rel
Stage component
Relay (lib)
469 LOC · receipt-preserving

Fanout · egress joule metering · receipt forwarding without re-signing.

joule-moq-relay. The receipt-preserving relay. Per the JWP receipt sub-spec (open-standards/wai/extensions/jwp-receipts.md §4): a conforming relay MUST forward object bytes and receipts unaltered, MUST NOT re-issue a Merkle root, MUST NOT strip parent_receipt_hash. The relay verifies group signatures before fan-out and tracks egress joules per subscriber. WAI envelope payloads are opaque to the relay; the wai_envelope flag in the ObjectHeader is propagated unchanged.

Sample receipt
JWP ReceiptPayload
kind "comms.relay.egress"
subscribers_fanned 1..N (per group)
receipt_modification FORBIDDEN
verify_before_fanout Ed25519 + Merkle root
joules 0.02
cite "joule-moq-relay v0.1 · jwp-receipts.md §4"
sig "ed25519:0x4f...c1a"
Anatomy — operational specs
Trust model
verify-then-forward; never re-sign
Joule cost
egress = bytes × per-subscriber × joules_per_byte
Layer cap
drop layers above max_mrl_layer policy per subscriber
Rls
Stage component
Relay server
445 LOC · QUIC :9220/udp

Production relay daemon · QUIC binding · JSON-log audit trail.

joule-moq-relay-server. Production binary that exposes the relay over QUIC on UDP :9220. Caddy does not tunnel raw UDP, so the QUIC port is publicly exposed via firewall passthrough (or Cloudflare Spectrum for global ingress). Currently runs as a launchd service on prod (10.10.10.3) alongside the publisher binaries.

Anatomy — operational specs
Bind
127.0.0.1:9220/udp (QUIC)
TLS
rcgen self-signed for dev; ACME for prod
Launchd label
science.transaction.joule-moq-relay
Logs
JSON to ~/Library/Logs/joule-moq-relay/
Sub
Stage component
Subscriber
413 LOC · receipt verifier

Rust subscriber SDK · BLAKE3 + Merkle proof + Ed25519 verification · gap detection.

joule-moq-subscriber. Per-object content-hash verification, Merkle proof verification against the group receipt's signed root, Ed25519 signature verification against the publisher's anchored verifying key. Detects gaps (skipped object_id within a group). Post-W3 will also dispatch WAI envelopes by capability — today still routes raw bytes; W3 lands the dispatch path.

Anatomy — operational specs
Verifier API
ReceiptVerifier::with_anchors + verify_group + verify_payload
Anchoring
trust pinned to publisher Ed25519 key(s)
Gap detection
monotonic object_id within group
W3 (Q3 2026)
WaiObjectHandler trait + auto-dispatch on WAI1 magic
WA
Stage component
Browser (wasm)
963 LOC · WebGPU-ready

Browser subscriber + verifier · wasm-bindgen · zero-trust client.

joule-moq-wasm. Browser-native subscriber that runs the same receipt verification as the Rust subscriber, in WebAssembly. Pulls publisher key + group receipts from the HTTP companion endpoints, verifies inclusion proofs in-browser, decodes payloads with joule-codec-av1-mrl + joule-codec-neural-mrl. W3 adds WAI envelope dispatch: sniff WAI1 magic, parse manifest, route to per-capability decoder.

Anatomy — operational specs
Bundle
wasm-bindgen + ed25519-dalek + blake3 (no_std-friendly)
Decoders
av1-mrl (Matryoshka video) + neural-mrl (CompressAI ports)
Connection
WebSocket via /moq*/ws-bridge upgrade
Verification
BLAKE3 + Merkle proof + Ed25519 in-browser
Sw
Stage component
iOS (swift-moq)
Swift package · MoQT WS subscriber

Swift wrapper · URLSessionWebSocketTask · MoQT message frames.

joule-compose-mobile/swift-moq. Native iOS / macOS subscriber that speaks MoQT over WebSocket against the ws-bridge. Exposes a JouleMoQ Swift Package (still pre-registry) that compose-mobile apps embed. Same wire format as joule-moq-wasm; same verifier path; same receipt schema. Not yet on Swift Package Index — W8 in PLAN.md ships the /sdk/swift page that registers it.

Anatomy — operational specs
Platform
iOS 17+ · macOS 14+
Transport
URLSessionWebSocketTask (WS upgrade)
Package manager
Swift Package Manager (SPM)
Doc surface
PLAN.md W8 — /sdk/swift
Abr
Stage component
ABR
766 LOC · 4 algos

Adaptive bitrate · BOLA / buffer-based / MPC / throughput · pure math.

joule-moq-abr. Four published adaptive-bitrate algorithms: BOLA (buffer-occupancy Lyapunov), buffer-based heuristic, MPC (model-predictive control), and throughput-based. Pure math, no I/O, side-effect-free. Enforced at the relay as a layer-cap policy: when a subscriber's bandwidth or buffer occupancy drops, the relay stops forwarding higher-mrl_layer objects to that subscriber. Per-object receipts remain unchanged.

Anatomy — operational specs
Algorithms
BOLA · buffer-based · MPC · throughput
Input dimensions
buffer_s · bandwidth_kbps · last_throughput
Output
max_mrl_layer for next group
Receipt impact
none — relay drops layers, receipts unchanged
QoE
Stage component
QoE
838 LOC · Conviva export

Quality-of-experience recorder · rebuffer · join time · bitrate trace.

joule-moq-qoe. Per-session QoE recorder: time-to-first-frame, rebuffer count + duration, average bitrate, layer-cap history, video startup failures. Exports a Conviva-compatible JSON envelope for ingestion by upstream telemetry systems. The QoE record IS a receipt — signed by the publisher's verifying key alongside the group receipts.

Anatomy — operational specs
Metrics
TTFF · rebuffer count / duration · bitrate p50/p95 · join failures
Export format
Conviva JSON + JWP receipt envelope
Window
per-session, finalized on disconnect
Ov
Stage component
Overlay
685 LOC · compositor

Graphics overlay dispatch · lower-thirds · scoring · subtitles.

joule-moq-overlay. Compositor that layers graphics over the base video track: lower-thirds, score bugs, breaking-news supers, subtitle rendering. Each overlay is its own MoQT track in the same namespace; the compositor consumes the base + overlay tracks and produces a single composed output. Policy layer decides which overlays to apply per subscriber (e.g. parental controls hide ratings).

Anatomy — operational specs
Input tracks
video.base + N overlay tracks
Composition
image crate (PNG / WebP / GIF inputs)
Policy
per-subscriber overlay allowlist
Output
single composed track (joule-moq-relay forwards)
HLS
Stage component
HLS egress
839 LOC · axum server

HLS playlist generation · segment chunking · MoQT object → CMAF segment.

joule-moq-hls-egress. Bridges MoQT to HLS for legacy clients that don't speak MoQT directly (still ~80% of installed base in 2026). Buckets MoQT objects into HLS segments (default 6s), generates m3u8 playlists with EXT-X-MEDIA, EXT-X-INDEPENDENT-SEGMENTS, EXT-X-MAP. Serves via axum. Per-segment provenance: each segment file's filename is content-hashed so a CDN can serve it forever.

Anatomy — operational specs
Segment duration
6.0s default; configurable
Playlist
EXT-X-VERSION:7 (HLS spec)
Server
axum 0.7 · :443 via Caddy
Cache
immutable; segment filename is BLAKE3-prefixed
DVR
Stage component
DVR
861 LOC · fs/mem backends

Replay window · retention policy · cold storage handoff.

joule-moq-dvr. The replayer. Tail of MoQT groups buffered for the configured replay window (default 4h live, 30d archival). Two backends: fs (filesystem, prod-grade) and mem (in-memory, test-only). Gap-detection on insert: rejects out-of-order group_ids unless explicitly tolerated. Per-object inclusion proofs survive across the DVR boundary — receipts are stored alongside the payloads so the chain re-verifies after replay.

Anatomy — operational specs
Backends
fs (production) · mem (testing)
Replay window
configurable; 4h live default
Retention
30d archival default; per-track override
Gap policy
reject out-of-order group_ids unless tolerant=true
Ad
Stage component
SSAI
1,118 LOC · SCTE-35

Server-side ad insertion · SCTE-35 splice · VAST 4.2.

joule-moq-ssai. Server-side ad insertion: splice MoQT tracks at SCTE-35 cue boundaries (CUE-OUT / CUE-IN), substitute ad-pod tracks during the break, splice back when the cue-in lands. VAST 4.2 ad selection runs upstream and yields a typed ad-pod descriptor. The break is a per-subscriber concept — different subscribers see different ad-pods on the same source feed.

Anatomy — operational specs
Cue signaling
SCTE-35 splice descriptors
Ad selection
VAST 4.2 (XML over HTTP)
Granularity
per-subscriber · per-pod
Provenance
ad-pod receipts chain into the main group receipt log
Bdg
Stage component
In-process bridge
419 LOC · async traits

In-process MoQT bridge · SIP-call → MoQT · WebRTC → MoQT.

joule-moq-bridge. Lifts an inbound non-MoQT source (a SIP call's RTP stream, a WebRTC track) into a MoQT track on the local publisher SDK. The translator is responsible for the codec mapping (PCMU → opus → comms.audio.layered-pcm) and for synthesising per-frame joule estimates from the source's RTCP feedback. Receipts emit identically to a native MoQT-source publisher.

Anatomy — operational specs
Sources
SIP/RTP · WebRTC · in-memory mock
Codec mapping
encode_codec() → MoQT codec bytes
Joule estimation
RTCP-RR-derived per-frame microjoules
WS
Stage component
WebSocket bridge
555 LOC · per-route

WS upgrade · subscribe / publisher-key / group-receipts / track-info endpoints.

joule-moq-ws-bridge. The HTTP-and-WebSocket surface that browser subscribers use. Caddy routes /moq/* and /moq-wai-*/* into the ws-bridge; the bridge exposes /publisher-key (32-byte hex for trust pinning), /track-info, /group-receipts (ring buffer of last 64 receipts as JSON), and the WebSocket upgrade for streaming objects. The bridge IS the boundary between QUIC-speaking relays and TCP-only browser clients.

Sample receipt
JWP ReceiptPayload
kind "comms.ws.frame.relayed"
frame_codec binary MoQT frames over WS
endpoints /publisher-key · /track-info · /group-receipts · /ws
joules 0.00041
cite "joule-moq-ws-bridge v0.1"
sig "ed25519:0x4f...c1a"
Anatomy — operational specs
HTTP endpoints
/publisher-key · /track-info · /group-receipts · /ws
WS framing
binary; one MoQT object per frame
Caddy paths
/moq/* · /moq-wai-audio/* · /moq-wai-video/* · /moq-wai-live/*

What the chain proves

Every byte you receive came from a named publisher.

The publisher's Ed25519 verifying key is pinned at the subscriber. The group receipt is signed by that key. The Merkle root in the receipt covers every object hash. Every object hash covers the bytes you actually receive — envelope and all. Verifying the chain is a 4-line BLAKE3 + Merkle-proof + Ed25519 check; you can re-run it on any object after the fact and the answer is bit-deterministic.