Skip to content
tensorhaze

Menu

Motion

Reduced motion shows still images instead of animation. Everything else stays the same.

Study 03 · Calling architecture

Sordino

A design for a private messenger with fast voice and video calls. It is at planning stage: no code yet, and every number here is a target.

  • Planning stage

Relay-hop seal

The relay can open this layer

End-to-end seal

Only the two phones hold the key

Voice frame

20 ms of speech, compressed

01

Targets

Four numbers the design is built to hit. None has been measured yet.

Sordino is a design for a private messenger. Messages and calls are end-to-end encrypted, and every call goes through a relay server, so the two people never learn each other's network address. The apps share one Rust core with a native interface on each platform.1

The figures below are goals for two people in one EU region. Across EU regions the typical target is 160 ms. The plan's first real test measures them against Telegram, Signal and WhatsApp on the same impaired network.1

Mouth to ear, typical
≤120ms
Target
9 in 10 calls
≤180ms
Target
Answer to first sound
≤500ms
Target
Network switch gap
≤1s
Target

02

System

Audio goes phone, relay, phone. The end-to-end keys never touch a server.

How a call is carriedAudio goes from the caller's phone through an edge relay to the callee's phone. Messaging servers sit in the same server zone but are off the audio path. Servers hold no plaintext and no media keys. The keys are agreed directly between the two phones.SERVERSNo plaintext, no media keysCaller's phoneRust core, native appCallee's phoneRust core, native appEdge relayForwards sealed audioMessaging serversQueues, directory, pushThe keys are agreed between the two phones only123 How a call is carriedAudio goes from the caller's phone through an edge relay to the callee's phone. Messaging servers sit in the same server zone but are off the audio path. Servers hold no plaintext and no media keys. The keys are agreed directly between the two phones.SERVERSNo plaintext, no media keysCaller's phoneRust core, native appCallee's phoneRust core, native appEdge relayForwards sealed audioMessaging serversQueues, directory, push123
  1. AudioSealed audio goes phone, relay, phone, and flows both ways. Only the edge relay is on the path.
  2. KeysAgreed between the two phones. The servers never see them, so the dashed line skips the servers.
  3. Messaging serversQueues, directory and push sit in the same zone but off the audio path.
Figure 1Planned design. Nothing here is built or measured. The lit line is the route the audio takes; the dashed line is the route the end-to-end keys take.

The plan has ten server roles: gateway, directory, sequencer, message queues, push broker, token issuer, edge relay, probe, attachments and a key transparency log. Only the edge relay is on the audio path.1

Before a call the app tests three nearby relays with three pings each and picks the best. During a call it tests again every 30 seconds and switches only if another relay is at least 15 ms better twice in a row. The relay treats the first authenticated packet from each side as proof that the path works.1

Technical details

Planned values. Nothing here is built or measured.

Group keys
Messaging Layer Security (MLS, RFC 9420) through the mls-rs library.
Post-quantum key exchange
Hybrid ML-KEM-768 + X25519, or an ML-KEM-768 pre-shared-key combiner until the library supports the suite.
Media encryption
Secure Frame (SFrame, RFC 9605), suite AES_128_GCM_SHA256_128.
Call key
Exported from the MLS group, mixed with a fresh 32-byte call secret.
Audio
Opus, 48 kHz mono, 20 ms frames, constant 40 kb/s, in-frame error correction on, silence suppression off, DRED at 12 kb/s.
Planned wire format v1
16-byte header (version u8, flags u8, session id 8 bytes, sequence u16, timestamp u32); AES-128-GCM on each hop with the header as authenticated data; a 128-packet replay window; no RTP or SRTP.
Relay choice
score = median + 0.5 × MAD over three pings; migrate only when another relay is 15 ms or more better twice in a row.
Network switch
Every packet carries an 8-byte session id. After a change of address the relay sends a 16-byte nonce; the phone answers with an HMAC under the hop key.
Traffic shape
Constant bit rate and fixed audio packet size. Message envelopes are padded to one of 8 size buckets, which leaks at most 3 bits of length per message.

03

One packet

One 20 ms voice frame, and what the design wraps around it before it leaves the phone.

One voice frame, sealed twiceA bar grows from a 100-byte voice frame to about 119 bytes with the end-to-end seal, about 151 bytes with the relay-hop seal, and about 179 bytes with UDP and IP headers. Arithmetic, not measured.about 179 BPacket on the wire. Arithmetic, not measured.Voice frame100 B1230100 B119 B151 B179 B One voice frame, sealed twiceA bar grows from a 100-byte voice frame to about 119 bytes with the end-to-end seal, about 151 bytes with the relay-hop seal, and about 179 bytes with UDP and IP headers. Arithmetic, not measured.about 179 BPacket on the wire. Arithmetic, not measured.Voice frame100 B123100 B119 B151 B179 B
  1. End-to-end seal+19 B: a 3-byte header and a 16-byte tag. Only the two phones can open it.
  2. Relay-hop seal+32 B: a 16-byte header and a 16-byte tag. The relay can open it.
  3. UDP and IP headers+28 B over IPv4: 8 bytes of UDP and 20 of IP.
Figure 2Arithmetic from the design, not a measurement. It assumes a 3-byte SFrame header, a 16-byte tag on the relay hop and IPv4; IPv6 headers are 20 bytes longer.
LayerHow it is worked outAddsRunning total
Voice frame40 kb/s × 20 ms ÷ 8. Extra redundancy (DRED) that may share the packet is not counted.100 B100 B
End-to-end sealA 3-byte header (one config byte, with the key id inside it, and a 2-byte counter) plus a 16-byte tag.19 B119 B
Relay-hop sealThe planned 16-byte header plus a 16-byte AES-GCM tag. The plan does not state the tag length; 16 bytes is the GCM default.32 B151 B
UDP and IP headers8 bytes of UDP and 20 bytes of IPv4.28 B179 B

04

Latency budget

Where the time goes between one person's mouth and the other's ear. All targets.

Mouth-to-ear budget against the 150 ms lineTwo stacked bars on a 0 to 150 ms ruler. With every stage at its low target the stages sum to 79.5 ms; at its high target they sum to 138.5 ms. Both stay under the 150 ms line from ITU G.114. These are targets, not measurements.ITU G.114: 150 ms one-wayEvery stage at its low target: 79.5 ms12468Every stage at its high target: 138.5 ms124678050100150 ms Mouth-to-ear budget against the 150 ms lineTwo stacked bars on a 0 to 150 ms ruler. With every stage at its low target the stages sum to 79.5 ms; at its high target they sum to 138.5 ms. Both stay under the 150 ms line from ITU G.114. These are targets, not measurements.ITU G.114: 150 msAll stages low: 79.5 ms12468All stages high: 138.5 ms12468050100150 ms
Figure 3Targets from the call-engine notes, not measurements. Each bar adds the numbered stages in the table below, in order, from capture to playout; darker and lighter blocks alternate, and stages too thin to carry a number are left unnumbered. The relay is counted as 0 and 1 ms.
StageWhat happensTarget
Capture and cleanupMicrophone, echo cancellation, noise reduction10–15 ms
EncodeOpus, one 20 ms frame26.5 ms
Packetise and sendSeal the frame and hand it to the networkabout 1 ms
NetworkPhone to relay to phone, in one EU region10–40 ms
Relay forwardingThe relay passes the packet onunder 1 ms
Jitter bufferWaits for late packets20–40 ms
Decode and concealmentOpus decode, fill small gaps2–5 ms
Playout bufferHands audio to the speaker10 ms
Sum of the rangesAll stages added79.5–138.5 ms

The stages add up to about 80–140 ms (target), under the 150 ms one-way line that ITU G.114 gives as a reference for conversation.4 The typical target of 120 ms sits inside that range.

05

When packets are lost

Four layers of repair, tried from the cheapest. The app measures loss and decides how many to use.

  1. Error-correction data in each packetA small repair copy of the previous frame rides in the next packet, so a single lost packet is rebuilt from the one after it. Always on.
  2. A copy of the previous frameWhen loss is measured, each packet also carries the whole previous frame. Used by the Resilient profile, for loss between 5 and 20 percent or bursty loss.
  3. Deeper redundancy for longer gapsA learned, low-rate encoding of the last stretch of audio. The budget is 12 kb/s, aimed at about 200 ms of history, and 24 kb/s in the Resilient profile.
  4. A neural network fills the gapAs a last resort the decoder synthesises the missing audio.

Four profiles are planned: Quality, Resilient, Data saver and Music. The app moves to a stronger profile at once and back down only after 10 seconds below the threshold, so it does not flap.1

How the app chooses

mean loss              = p / (p + r)                     two-state loss model (Gilbert–Elliott)
burst length           = 1 / r                           p: chance of entering loss, r: chance of leaving it
after repair data      = (p / (p + r)) · (1 − r)
after deeper redundancy ≈ (p / (p + r)) · (1 − r)^W      W: frames the redundancy can cover
choose                 = cheapest profile with predicted loss < 0.5 %   a target

The jitter buffer, which holds audio briefly so late packets can catch up, aims at the 95th percentile of recent delay variation plus one frame, never below 20 ms or above 200 ms. It grows at once and shrinks by 1 ms every 100 ms.1

06

Keys

Two layers of encryption. The relay can open only the outer one, never the end-to-end layer.

  1. Agree group keysThe two phones form a secure group with a standard protocol (MLS) and a post-quantum key exchange added.2
  2. Make a call keyThe call key mixes a value exported from that group with a fresh 32-byte secret made for the call.
  3. Seal each frameEvery audio frame is encrypted end to end (SFrame). The relay forwards it without being able to read it.3
  4. Seal each hopA second layer protects each link between a phone and the relay. Its key comes from the join handshake with the relay, so the relay holds it.

Confidentiality is designed to hold against a future quantum computer. Authentication is not: signatures are classical in version 1. In a one-to-one chat the group keys are refreshed every 24 hours or 200 messages, and call keys rotate whenever someone joins or leaves.1

07

Placing a call

From the tap to the first sound, as the plan sequences it.

  • Caller RelayJoins the nearest of the relays it tested. While the call rings, the relay session sends padding so the bandwidth estimate is already warm.
  • Caller CalleeSends an encrypted offer, and a push notification whose content the servers cannot read.
  • Apple or Google CalleeDeliver the push and wake the phone. The plan assumes a mean of about 0.8 s and a 95th percentile of about 2 s, which the push providers decide.
  • CalleeFetches the offer, decrypts it, and the phone rings.
  • Callee RelayOn accept, joins the relay and sends the encrypted answer. Each side sends a first packet the relay can verify, and the relay forwards nothing until it has both.
  • Relay CallerAudio starts flowing. The target is first sound within 500 ms of the accept.

08

What the servers can see

The design assumes its own servers could be curious or compelled, so it limits what they hold. Planned design; nothing here is built or measured.

Cannot read
Message text, call audio and video, and the end-to-end call keys.
Can see
That a device received a message or a call at a given time; how long a call lasts and how many people are on it; each phone's network address, for the length of the call.
The other person sees
Nothing about your network address. Calls are always relayed.
Waiting messages
Planned: sealed envelopes are kept until delivered, at most 21 days. Attachments are kept for 30 days.
Call session
Planned: held in memory for the length of the call.
Push tokens
Planned: kept until unregistered, or until 90 days without use.
Statistics
Planned: aggregate figures only, kept for 13 months, with no identifiers.

What the design does not promise

  • Push timingApple and Google see when a push is delivered to a device.
  • Call length and sizeThe relay can tell how long a call lasts and how many take part. Anyone watching the network can tell that a call exists and how long it lasts.
  • DeniabilityMessages are signed, so a conversation is not deniable. This is an accepted trade-off.
  • Quantum-safe authenticationNot in version 1.
  • A global observerSomeone who can watch the whole network and correlate flows is out of scope.
  • A compromised phoneReveals everything on that phone.

09

Decisions

14 decisions are recorded, and each says what would reverse it. Three are shown here.

Calls

Every call goes through a relay. No peer-to-peer in version 1.

Why
It hides everyone's network address without a setting and makes connecting predictable. The planned expectation is that the detour to a nearby relay costs single-digit milliseconds in the same region. This is not measured.
What would reverse it
Early tests showing a median penalty of 20 ms or more against peer-to-peer for people in the same city. Then an optional direct mode for verified contacts.

Audio engine

A Rust engine on libopus, with its own packet format and no WebRTC fork.

Why
A WebRTC fork needs a heavy build toolchain and a maintainer. What the design needs from it is small: Opus with DRED, a jitter buffer, echo cancellation, a packet format. The phones supply echo cancellation. The cost is no browser support in version 1.
What would reverse it
Step 2.5 failing to beat Telegram for reasons that trace to the audio engine rather than the network. Then a standalone echo canceller and a port of the NetEQ jitter buffer come before any fork.

Audio format

Opus with 20 ms frames at a constant 40 kb/s, and DRED.

Why
20 ms frames cut about 40 ms of packet-building delay compared with 60 ms frames. A constant rate keeps packet sizes from leaking speech patterns. DRED and the neural gap-filler exist only in apps that ship their own libopus.
What would reverse it
A lab test showing the constant rate clearly worse on mobile networks than a variable rate. Then the Resilient profile becomes the mobile default.

10

Plan and gate

Seven milestones and 41 sub-steps. The first real test decides whether the project continues.

  • M0 · Skeleton and toolchainGate: tests pass in continuous integration, and a DRED round trip works.
  • M1 · Loopback audio engine on a desktopGate: mouth-to-ear measured on one machine, and the loss profiles verified.
  • M2 · Relay and a real callStep 2.5 is the kill gate. Two laptops make a real call on the same impaired link as Telegram, Signal and WhatsApp desktop. If Sordino does not beat Telegram on clean links, work stops and the lab decides.
  • M3 · Mobile shells and ring pathsAn iPhone and a Pixel repeat the step 2.5 tests against the targets above.
  • M4 · Identity, MLS, envelopes, signallingGate: an end-to-end encrypted call through the real stack.
  • M5 · Product appSwiftUI and Compose interfaces on the shared core.
  • M6 · Private beta and the review cycleReview is planned in layers: automated checks, a published specification and public source, and a disclosure policy.

11

Open questions

What the planning notes have not settled.

  • Group call sizeThe product notes allow 32 people in a group voice call. The plan's step 5.6 sets 16. They have not been reconciled.
  • How far back DRED reachesThe call-engine notes aim for about 200 ms of history. The algorithms note says up to about one second. This page uses the 200 ms figure.
  • VideoPlanned after the product-app milestone, with the same packet format. Not designed in detail.
  • BrowsersNot supported in version 1.

12

Sources

  1. Lab design notes, 2026: architecture, call engine, algorithms, security model, implementation plan and decision records D-002, D-004, D-006, D-007, D-011, D-012, D-014. Planning documents; no code and no measurements exist yet.
  2. IETF RFC 9420, The Messaging Layer Security (MLS) Protocol. www.rfc-editor.org/rfc/rfc9420
  3. IETF RFC 9605, Secure Frame (SFrame): Lightweight Authenticated Encryption for Real-Time Media. Section 4.3 (header) and the AES_128_GCM_SHA256_128 suite (16-byte tag) are the basis for the byte arithmetic. www.rfc-editor.org/rfc/rfc9605
  4. ITU-T Recommendation G.114, One-way transmission time. The 150 ms reference line. www.itu.int/rec/T-REC-G.114
  5. IETF RFC 6562, Guidelines for the Use of Variable Bit Rate Audio with Secure RTP. Why packet sizes can leak speech. www.rfc-editor.org/rfc/rfc6562
  6. IETF RFC 9000, QUIC: A UDP-Based Multiplexed and Secure Transport, section 9 (connection migration), the idea behind the planned network-switch handling. www.rfc-editor.org/rfc/rfc9000
  7. E. N. Gilbert, “Capacity of a burst-noise channel”, Bell System Technical Journal, 1960; E. O. Elliott, “Estimates of error rates for codes on burst-noise channels”, Bell System Technical Journal, 1963. The two-state loss model.
  8. R. Jain and I. Chlamtac, “The P² algorithm for dynamic calculation of quantiles and histograms without storing observations”, Communications of the ACM, 1985. The streaming estimate used for the jitter-buffer target.

Facts as of 2 Oct 2026.