# ECP-0014: In-app MoQ sharing (relay-first)

## Status
Draft

## Context
We need a low-friction way for a viewer node to share a live stream with other nodes. Today the CLI can publish MoQ streams, but the Tauri app cannot initiate a publish session or surface share details. Early adoption needs a quick path to “click Share, send details.”

We also need a near-term relay path that works across NATs without extra configuration. iroh provides default public relays; we can use those until we add custom relay selection.

## Decision
Add an in-app MoQ publish path for the currently selected channel. When a user clicks **Share**, the app starts a MoQ publisher and returns a share bundle (endpoint addr, broadcast, track). The bundle is shown in the UI for copy/paste and can be used by any MoQ subscriber.

For now, the publish flow relies on iroh’s default relay configuration (relay-first). A later ECP can formalize relay selection and custom relay registries.

## Details
- New `start_moq_publish` Tauri command that:
  - Opens the selected stream source.
  - Chunks with the existing ffmpeg pipeline.
  - Publishes objects over MoQ with deterministic encryption metadata.
  - Returns a share bundle: `{ endpoint_addr, broadcast_name, track_name, stream_id }`.
- The viewer UI shows a **Share** button in the Viewer panel and surfaces the share bundle.
- Manual MoQ connect stays available in the **Add source** menu for now.

## Consequences
- Sharing a stream consumes a tuner when the source is a live HDHomeRun stream.
- Publishing is long-lived; the app keeps a MoQ node alive until exit.
- The share bundle is ephemeral unless a stable iroh secret is configured.

## Risks
- Relay capacity and policy may change; a future ECP should specify relay configuration and redundancy.
- DRM-protected streams may fail to publish or play; UI should surface DRM hints.

## Follow-ups
- Add stable identity and share token signing.
- Add catalog gossip announcements for published streams.
- Provide a web gateway (MoQ -> HLS/MSE) for browsers without MoQ support.
