← All posts

Calls over the mesh

Voice and video calls, peer to peer, over the same encrypted libp2p circuits that move your files. No SFU, no third-party server, nobody in the middle. Turns out a storage mesh makes a perfectly good phone.

Calls over the mesh

Here's a feature I didn't strictly plan but couldn't resist: MeshHold can now place voice and video calls.

The reasoning was simple. The mesh already has authenticated peers, encrypted transport, and even multi-hop relay routing for when two nodes can't reach each other directly. A real-time call is mostly just those pieces plus a media codec. So why route your calls through someone else's server?

How it works

A call rides a dedicated protocol over libp2p, with a small state machine handling ring / answer / hold / reconnect / hang-up, surfaced to the UI over server-sent events. The media itself:

  • Audio is encoded with Opus via WebCodecs and smoothed through a jitter buffer running in an audio worklet, so a few late packets don't turn into clicks.
  • Video is VP8, encoded and decoded with WebCodecs, painted to a canvas, with a local picture-in-picture preview.
  • Everything is end-to-end encrypted through the same circuits that move blocks — and when a direct connection isn't possible, the call relays through an intermediate node without that node being able to read it.

There's a contacts page, an auto-answer toggle for your own always-on devices, and the unglamorous robustness work that real calls demand: comfort tones, a held end-state, automatic reconnect, and a watchdog that gives up gracefully instead of hanging forever.

It is, frankly, a little absurd that the same binary stores your photos and rings your friends. But it all falls out of the same primitives, and that's exactly the point of building on a solid spine.


Since the media player

  • a dedicated call + call-media protocol over libp2p, with a ring/answer/hold/reconnect state machine, REST, and SSE
  • audio: WebCodecs Opus encode/decode + an AudioWorklet jitter buffer
  • video: WebCodecs VP8 encode/decode, canvas render, local picture-in-picture
  • end-to-end-encrypted media, relay-routed when peers can't connect directly
  • contacts page + auto-answer toggle; reconnect, comfort tones, and watchdog robustness
  • early groundwork on an S3-compatible API — access keys and per-vault grants