Specification · document 19
19 Notifications and push
| Status | Draft. Protocol version 1 (sv1) of the Sloppy Voice v2 product |
| Date | 2026-12-04 |
| Depends on | 00 (architecture contract), 06 (S2S requests, event delivery, audiences), 12 (DM index, message requests, DM calls), 14 (SealedMessage, notification-extension rules). Also uses 01, 02, 03, 04, 05, 08, 09, 10, 11, 15 and 20 by reference. |
| Decisions used | D-004, D-007, D-009, D-010, D-022, D-031, D-032, D-049, D-051, D-055, D-056, D-058, D-060, D-061, D-063, D-065, D-066, D-071, D-093; proposed decisions PD-19-1 to PD-19-19 (§3.4) |
| Owns | The notify.event payload and its kinds; notification settings (global, per community, per context) and /v1/contexts/{ctx}/notification-settings; the NotificationRecord object and /v1/me/notifications…; the PushRegistration object and /v1/me/push-registrations…; the push gateway API {gatewayUrl}/v1/…; the opaque push payload; event tickets and fetch tokens; the notify.*, push.* and notification.* events and error codes |
Status of this document and conformance
This document is normative. It uses the key words of BCP 14 (RFC 2119, RFC 8174) as described in 00 §1.4. Rationale notes start with "Why:" and are informative. Examples are informative unless the text says otherwise; where an example and the normative text disagree, the text wins.
Conformance by class (00 §1.5):
| Class | Sections that apply |
|---|---|
| Server, hosting role | §4 (producing notifications), §5 (sending notify.event), §8.6 (the event-ticket endpoint), §14.1, §16, §17 |
| Server, home role | §5.6 (receiving notify.event), §6 to §12, §14.2, §14.3, §15, §16, §17. Every Server conforms to both roles (D-066). |
| Full client (desktop and mobile) | §7 to §10, §13 to §15. Desktop clients implement §13.6 instead of the mobile parts. |
| Web client | As Full client, plus §12 (Web Push) and §13.5 (service worker). |
| Bot client | §9.5 only: bot devices never register for push. Bots learn about events through their own sessions. |
| Push gateway | §10.2 and §11, plus 03 §2 to §4 and §10 as 03 requires; 02 (server resolution §5.2 and §5.6, serverKey §11.6, key-set pinning with continuity or strong evidence §10.2, D-030); 04 §4 and §6 (strict Ed25519 rules and the JWS profile); 06 §8.3 to §8.5 as §11.4 and §11.5 reference them. |
A Server MUST support every part of this document; push delivery isn't an optional feature and has no feature flag. A Server MAY offer Web Push or not (endpoints.push.webPushKey, 02).
1. Scope
1.1 What this document covers
- How a hosting server turns the notification triggers of 11 and the rings of 15 into notifications: recipients, the "attentive session" rule, the in-app
notify.triggeredevent, the 30-second coalescing window, withdrawal of notifications for deleted messages and of previews of edited ones, previews and event tickets (§4). - The
notify.eventserver-to-server payload and its kinds (§5) (D-051, D-022). - What the recipient's home server does with it: the legitimacy filter, notification settings, notification records, and the decision between the event WebSocket and a push (§6).
- Notification settings: global, per community and per context, stored only at the home server (§7).
- Notification records and
/v1/me/notifications…(§8), badges and read-state synchronization (§15). - Push registrations and
/v1/me/push-registrations…, which exist only at the home server (§9). - The opaque push payload, identical in every security mode (§10).
- The push gateway API,
{gatewayUrl}/v1/registerand{gatewayUrl}/v1/push, its authentication, error handling and the open-source requirement (§11) (D-009), and the official gateway the project runs for its official apps (D-093). - Web Push delivery for web clients (RFC 8030, RFC 8291, RFC 8292) (§12).
- What a device does with a push: fetch the record from the home server, fetch the event from the hosting server, decrypt locally; the iOS notification service extension and Android limits; the shared key storage; the fallback text (§13).
- Call ringing pushes for DM calls (§14).
- The events, error codes, limits, registry additions and test vectors of this document's areas (§16 to §20).
1.2 What this document does not cover
| Topic | Owner |
|---|---|
Which messages trigger a notification (mentions, replies, "everyone", DM messages, edits), the mention hint, read state (readSeq, mentionCount) and presence (dnd) |
11 |
| Message content, SealedMessage and how a device decrypts it; the sender public-key cache | 11, 14 |
DM requests, the DM index, requestNotifications, message-request UI, DM blocks |
12 |
Call control, the Ring object, call.ringing, call.ring_ended, answering and declining |
15 |
| The S2S envelope, S2S request tokens, delivery lanes, retries and deduplication | 06 |
The endpoints.push members of ServerMetadata (this document defines their meaning) |
02 |
| Device records, device revocation, account deletion | 05 |
| Platform key storage and the notification key subset | 08 |
The JWS profile, the typ registry and the HMAC label registry |
04 |
| Localisation rules for this document's reference texts (20 §19.2); the in-app incoming-call screen (20 §11.9) and the settings screens | 20 |
1.3 Terminology
Terms from 00 §2 are used exactly as defined there, in particular notify, notification record, push registration, push gateway, home server, hosting server, context, context reference. This document adds:
| Term | Definition |
|---|---|
| Trigger | One reason to notify one account about one durable event, as defined by 11 §16 (mention, reply, "everyone", DM message, edit mention) or by 15 §13 (ring, ring ended). |
| Attentive session | A session of the recipient account on a server (the hosting server, or the home server in §6.4) whose event WebSocket is open, whose last session.state declared foreground: true (03 §5.8), and whose presence idle flag (11 §11.2) is false (§4.3). |
| Notification window | The per-(recipient, context) 30-second coalescing state at the hosting server (§4.5). |
| Notification kind | The value of kind in a notify.event or NotificationRecord (§5.3). |
| Event ticket | A short-lived bearer credential, issued by the hosting server inside a notify.event, that lets the recipient's devices fetch exactly the notified events without a remote session (§4.7, §8.6). |
| Fetch token | A bearer credential, issued by the home server with a push registration, that lets a notification extension read notification records and nothing else (§9.3). |
| Push key | The opaque, gateway-sealed form of a platform push token (APNs or FCM) that the home server stores instead of the token itself (§11.2). |
| Official gateway | The push gateway the project runs for the official iOS and Android apps, published as open-source software (§11.1, D-093). |
| Push type | alert, call or background: how the gateway and platform deliver one push (§10.3). |
| Notification extension | The code that handles a push while the app isn't running: the iOS Notification Service Extension (NSE), the iOS PushKit handler for calls, the Android FCM service, or a web service worker. |
| Notification key subset | As 08 §1.3 and §13.5 define: the history keys, and nothing else secret, that a notification extension may read. |
| Reference text | The English text this document gives for a notification (§13.7). Localised text keeps its meaning (20 §19.2). |
| Silent record | A notification record created without any push or alerting display, for example during do-not-disturb (§6.3). |
1.4 Notation
|| is byte concatenation. b64u(x) is base64url without padding (RFC 4648 §5). opaque(x) is the TLS-presentation encoding opaque x<V> of 04 §3.2: a variable-length-integer length prefix (RFC 9420 §2.1.2) followed by the bytes, with strings encoded as UTF-8. Times in JSON are RFC 3339 with milliseconds (00 §7.7); durations end in Ms.
2. Requirements this document satisfies
| Requirement | Where |
|---|---|
| Mobile push works across federated servers (brief §3 item 10, D-010, HP-9) | §3, §5, §6 |
| Push goes from the user's home server through a push gateway; secure-context pushes carry no content (D-022) | §6.4, §10, §11 |
Push payloads are an opaque notification ID in every mode; previews only for insecure contexts in notify; push registrations only at the home server (D-051) |
§4.8, §5.2, §9.5, §10 |
notify only for recipients without a foreground session on the hosting server, coalesced over 30 s (00 HP-9) |
§4.3, §4.5 |
| The device fetches the record, then the event, and decrypts locally; the extension needs only symmetric history keys and never touches MLS state; fallback text (00 HP-9, Matrix G) | §13 |
Vendor-neutral, self-hostable, open-source gateway (D-009); the project runs the official gateway for its official apps as open source, and servers default to gatewayPolicy any (D-093) |
§11.1, §12.6 |
| Secure servers never store plaintext (SM-10) | §6.2 rule H6 |
| Warnings only from the closed catalogue (D-055) | Notifications are never security warnings; §13.7 |
| A downgrade is never shown without W9, and a hosting server can't forge a member's message (00 §5.2, SM-12, D-056) | §13.1 step D6a, §13.1 step D8 |
| Only enrolled devices of secure accounts read secure contexts (SM-4) | §4.7, §8.1 ticket |
3. Overview
3.1 Parties and flow
HOSTING SERVER b.com HOME SERVER a.com PUSH GATEWAY DEVICE of alice@a.com
(context ch:…, dm:…, gdm:…) (alice's account) (app publisher) (phone, app suspended)
| | | |
trigger (11 §16, 15 §13) | | |
attentive session? --yes--> notify.triggered on b.com's `me` socket (in-app only) | |
| no | | |
notification window (30 s) | | |
|--- notify.event (S2S, 06) ------------>| | |
| kind, sender, ctx name, seq/mid, | legitimacy filter (§6.1) | |
| preview (insecure only), ticket | settings (§6.2) | |
| | NotificationRecord {h} (§8) | |
| |--- notification.created (WS) ---> other connected devices |
| |--- POST /v1/push {pushKey, {v,h,r}} ->| |
| | (sv-push+jwt) |--- APNs / FCM --------->|
| | | | extension wakes
| |<-- GET /v1/me/notifications/{h} (fetch token) ---------------|
| |--- record (+ event ticket, hostApi, badge) --------------------->|
|<-- GET /v1/me/notifications/events (event ticket) ------------------------------------------------------|
|--- the notified events (SealedMessage in secure contexts) ---------------------------------------------->|
| | | decrypt with K_hist |
| | | from the key subset,|
| | | verify signature, |
| | | show or fall back |Web browsers use Web Push instead of a gateway (§12): the home server encrypts the same payload to the browser's push subscription and sends it to the browser's push service.
Desktop apps don't use push at all. While running, they hold the home server's event WebSocket and turn notification.created events into operating-system notifications (§13.6).
3.2 Design principles
- One payload for everything. Every push, in every mode, for every kind, carries the same 93-byte object
{"v":1,"h":…,"r":…}(§10). Push providers, gateways and network observers can't tell a mention from a DM, a secure context from an insecure one, or one sender from another (D-051). - The home server is the only push sender. Remote servers never see push tokens, push keys or registrations (D-051). They tell the home server through
notify.event, and the home server applies the user's settings, which live only there. - Content stays where it is. In secure contexts nothing readable leaves the hosting server except ciphertext, fetched by the user's own device. In insecure contexts the hosting server MAY include a short preview (at most 140 characters) so the lock screen can show it without a second round trip (00 Matrix G).
- Nothing needs MLS in the background. A notification extension decrypts with a history key and verifies a signature. It never processes a commit, never holds the identity key, a device signing key or a vault key, and never runs Argon2id (14 §6.7, 04 §12).
- No user decisions. Notifications work right after onboarding with one operating-system permission prompt (M3, 20 §6.1). Settings exist, with sensible defaults, but nobody has to visit them.
3.3 What each party learns
| Party | Learns | Never learns |
|---|---|---|
| Hosting server | Who it notifies, when, for which context and event; whether the recipient has an attentive session | Push tokens, registrations, devices of remote users beyond their sessions, notification settings |
| Recipient's home server | Which remote contexts notify its user, the kind, the sender, the context name, timing; the preview in insecure contexts | Secure content; it can fetch the ciphertext of notified events with the event ticket but can't decrypt it |
| Push gateway | Which home server pushes to which app installation, when, and the push type (alert, call, background) |
Content, sender, context, account address, security mode |
| APNs, FCM, Web Push service | Which installation gets a wake-up, when, and the push type | As for the gateway; Web Push services see only ciphertext |
3.4 Proposed decisions
These decisions aren't in the decision log yet. Each is stated where it applies; this list summarizes them for the lead (00 §1.7 rule 5).
| ID | Decision | Section |
|---|---|---|
| PD-19-1 | The push payload is {"v":1,"h":<record ID>,"r":<registration ID>}, serialized in one fixed 93-byte form; r lets an app with several accounts route the push. |
§10.1 |
| PD-19-2 | Platform tokens are sealed by the gateway into a push key bound to one home server ({gatewayUrl}/v1/register); home servers store push keys, never raw APNs or FCM tokens. |
§11.2 |
| PD-19-3 | Home servers authenticate to gateways with a new JWS type sv-push+jwt, request-bound like sv-s2s+jwt. |
§11.4 |
| PD-19-4 | Each push registration carries a fetch token, a bearer credential limited to reading and marking notification records, so extensions never use or refresh session tokens. It is rotated at every 30-day re-registration and expires 60 days after issue. | §9.3 |
| PD-19-5 | Every message-kind notify.event carries an event ticket that lets the recipient's devices fetch exactly the notified events from the hosting server without a remote session. |
§4.7 |
| PD-19-6 | Coalescing is leading-edge: the first trigger is sent at once, later triggers in the next 30 s (including triggers that arrived while the recipient was attentive) are sent as one aggregate at the end of the window, and dropped if the recipient has read past them or is attentive then. | §4.5 |
| PD-19-7 | A hosting server sends the ephemeral notify.triggered event to the recipient's own connected sessions, so mentions in unsubscribed contexts appear in-app. |
§4.4 |
| PD-19-8 | A home server accepts notify.event only from hosts its user has a relationship with (community list, recent assertion, or an active DM index entry), and answers ignored otherwise. |
§6.1 |
| PD-19-9 | A home server that is a secure server discards insecure previews on receipt and never stores them (SM-10). | §6.2 rule H6 |
| PD-19-10 | Read state reaches the home server from the reading client, not from the hosting server; the badge is the number of unread notification records. | §15 |
| PD-19-11 | Per-context levels are all, mentions and nothing; all is allowed only for DMs and group DMs in v1, because channels produce no per-message trigger. |
§7 |
| PD-19-12 | Do-not-disturb (the home-server presence status dnd, 11) creates silent records: no pushes and no ringing, except for pairing requests and test pushes. |
§6.3 |
| PD-19-13 | An idle session doesn't count as attentive, so a desktop left open on an empty desk doesn't suppress phone notifications. | §4.3 |
| PD-19-14 | Bots never receive notify.event; they learn about mentions through their own sessions. |
§4.2 |
| PD-19-15 | This document owns the reference English text of notifications (20 owns localisation). An account_alert notification uses neutral, non-security reference text that only asks the user to open the app, where the W4 surface of 20 is shown. |
§13.7 |
| PD-19-16 | Event tickets are the bounded exception to SM-4 that 00 §4.2 SM-4 records: in a secure context they return ciphertext only, and the home server gives a secure-context ticket only to enrolled devices. | §4.7, §8.1 |
| PD-19-17 | Pushes are routed per device, then per registration: a device with a call-capable registration gets a ring only there; a server never sends a push type that a registration's types don't list. |
§6.4 |
| PD-19-18 | A ring record is identified by (host, ctx, callId, ring expiresAt); call_ring_ended carries the ring's expiresAt; an early ring end leaves a tombstone; one call produces at most one unread missed-call record. |
§6.3, §14 |
| PD-19-19 | A device treats a context it has pinned as secure (D-056), or last knew as a secure DM, as secure whatever a notification says, so a hosting server can't put forged plaintext on the lock screen. | §13.1 step D6a |
4. Producing notifications at the hosting server
4.1 Triggers
The hosting server derives triggers from each accepted durable event, as 11 §16 defines for messages and 15 §13 defines for rings:
| Source | Trigger kinds | Defined by |
|---|---|---|
A message entry that mentions the recipient (insecure content.mentions, or the secure mention hint, D-063) |
mention |
11 |
A reply with ping: true to the recipient, in an insecure context |
reply |
11 |
mentionAll by a sender holding mention_everyone (10) |
mention_all |
11 |
| A root message in a DM or group DM | dm_message |
11 |
| An edit that newly mentions the recipient | mention |
11 |
| A ring of a DM call | call_ring |
15 |
| The end of that ring | call_ring_ended |
15 |
| Deletion or expiry of a message that produced a sent notification | withdrawn |
11 |
| An edit of an insecure message whose notification carried a preview | withdrawn with previewOnly: true (§4.6) |
11 |
In a secure context a reply ping arrives as a mention through the hint (11 §4.4), so the hosting server reports it as mention. Reactions, typing, read state, presence, membership changes and manual history shares (14's history.shared, D-007) trigger nothing in v1.
One trigger per event and recipient. For one durable event and one recipient, the hosting server derives at most one message-kind trigger. When several kinds apply (a DM root message that also mentions the recipient, a reply ping that also lists the recipient in mentions, a mention together with mentionAll), the trigger's kind is the highest-priority one, in the order mention > reply > mention_all > dm_message. The same rule applies to notify.triggered (§4.4). Why: otherwise one message would be notified twice, once at once and once in the next aggregate.
4.2 Recipients and exclusions
For each trigger the hosting server computes the recipient accounts as 11 §16 or 15 §13 says, then removes:
- the sender's own account;
- accounts that don't currently have access to the context (not a member,
banned,left,needs_encryptionin a secure context, or below the visibility rules of 11 §7.5 for that event; in a secure context that includes anything sequenced before the recipient's current membership began, such as an edit made after the join of a message from before it, D-007); - DM participants in state
pending(12 §8.1: their home server notifies them from thedm.request); 3a. a 1:1 DM participant in statedeclined(12 §6.3), for every trigger kind; - a 1:1 DM participant who blocked the other participant (12 §8.5), for every trigger kind;
- accounts of
kind: "bot". Proposed decision PD-19-14: bots never receivenotify.event. Why: bots have no push registrations and read events through their own sessions; sendingnotifyto them only creates S2S traffic.
call_ring follows 15 §13 for its targets; rules 1, 3, 3a, 4 and 5 still apply.
4.3 Attentive sessions
A session of the recipient account on the hosting server is attentive when all three hold:
- its event WebSocket is in state
ready(03 §5.3); - its last
session.state(or theforegroundmember ofsession.hello) declaredforeground: true(03 §5.8); - its presence idle flag is
false(11 §11.2:PUT /v1/me/presencewithidle).
Keeping this state current:
- A server MUST apply a
session.statewithforeground: falseat once, even when it arrives less than 5 s after the previous one, as 03 §5.8 requires. Why: a stale "foreground" loses notifications, a stale "background" only duplicates one (03 §5.4 rationale). - An app that opens an event WebSocket while it isn't visible to the user (for example an iOS app woken by PushKit for a call, §13.3, or an Android app finishing work in an expedited job) MUST send
foreground: falseinsession.hello(the default, 03 §5.4) and MUST NOT sendforeground: trueuntil the user can see it.
Rules:
- For every trigger kind except
call_ring,call_ring_endedandwithdrawn, the hosting server sendsnotify.eventonly if, at the moment it would send (at once, or at the window's deadline, §4.5), the recipient has no attentive session on it (00 HP-9). call_ringandcall_ring_endedare sent whatever the recipient's sessions are, and are never coalesced (15 §13.1), so the user's phone rings even while their desktop app is open.withdrawnis sent whenever an earlier notification for the message was sent (§4.6).
Proposed decision PD-19-13: an idle session doesn't count as attentive. Why: 03 defines foreground as "the user can see the app". A desktop window left visible while the user is away would otherwise silence every phone notification. The idle flag, which clients already maintain for presence (11), fixes this at no extra cost.
UX: the effect users see is the familiar one: while they are actively using any app connected to that server, their phone stays quiet for that server; when they step away, it starts buzzing.
4.4 In-app notification: notify.triggered
For every trigger of kind mention, reply, mention_all or dm_message, the hosting server sends notify.triggered to every connected session of the recipient account on that server, attentive or not. It is an ephemeral event on the hosting server's me stream, targeted at those sessions (03 §7.2 E5).
| Member | Type | Required | Meaning |
|---|---|---|---|
ctx |
string | Yes | The context reference. |
kind |
string | Yes | mention, reply, mention_all or dm_message. A client treats an unknown value as dm_message for display. |
seq |
integer | Yes | The seq of the triggering event in the context. |
mid |
string | Yes | The mid of the triggering entry: the root message's mid, or, for an edit that newly mentions the recipient, the edit entry's mid (11 §8.2). |
sender |
object | Yes | AddressRef {addr, name, kind} (01), where kind is user, bot or webhook. For a message posted through a webhook (11 §15.4), the sender is 11's webhook Sender { "kind": "webhook", "webhook": id, "name": name }, with no addr. Unknown kind values are treated as user. |
at |
string | Yes | The event's timestamp. |
{
"v": 1,
"t": "notify.triggered",
"id": "01a2424b-7a10-7c3d-8e4f-5061728394a5",
"ctx": "me",
"ts": "2026-12-04T18:31:02.118Z",
"d": { "ctx": "ch:01938a11-2b3c-7d4e-8f90-aabbccddeeff", "kind": "mention", "seq": 91, "mid": "01a2424b-79f0-7b2c-9d3e-4f5061728394",
"sender": { "addr": "carol@c.com", "name": "Carol", "kind": "user" }, "at": "2026-12-04T18:31:02.104Z" }
}A client uses it to update mention badges and, when the context isn't on screen, to show an in-app banner. It MUST NOT show an operating-system notification for it, in any state: operating-system notifications come only from home-server records (§13.6) or pushes (§13.1), which have passed the user's settings. Before showing an in-app banner, the client MUST apply the settings it has synced from its home server (§7 and notification.settings_changed) and the account's presence status: no banner when rule H1 to H4 of §6.2 would give drop, and no sound when the outcome would be silent (rules H5, H8). The same information survives reconnects through the ReadState of 11 (mentionCount), which satisfies 03 §7.2 E4.
Proposed decision PD-19-7. Why: a client follows only a few contexts in full; for the rest it gets session.heads, which carries no mention information (03 §5.7). Without this event a connected user wouldn't see that someone mentioned them in another channel of the same server.
4.5 The notification window (coalescing)
The hosting server keeps one notification window per (recipient account, context). Message-kind triggers (mention, reply, mention_all, dm_message) go through it. call_ring, call_ring_ended and withdrawn bypass it.
State machine (per window):
| State | Event | Action | Next state |
|---|---|---|---|
idle |
Trigger t; recipient has an attentive session |
notify.triggered (§4.4); pending = [t]; set deadline = now + 30 s |
open |
idle |
Trigger t; no attentive session; rate cap not reached |
Send notify.event with items = [t] at once; set deadline = now + 30 s |
open |
idle |
Trigger t; no attentive session; rate cap reached |
pending = [t]; set deadline = now + 30 s |
open |
open |
Trigger t; recipient has an attentive session |
notify.triggered; append t to pending |
open |
open |
Trigger t; no attentive session |
Append t to pending |
open |
open |
A pending message is deleted or expires | Remove it from pending |
open |
open |
deadline reached, pending empty |
— | idle |
open |
deadline reached; the recipient has an attentive session, or its readSeq (11) is at least the highest seq in pending |
Discard pending |
idle |
open |
deadline reached; pending non-empty; rate cap reached |
Keep pending; set deadline to the time the cap frees a slot (at most 60 s later) |
open |
open |
deadline reached, otherwise |
Send one notify.event aggregating pending (below); set deadline = now + 30 s; clear pending |
open |
Why triggers that arrive while the recipient is attentive still go to pending: "attentive" can be stale for a few seconds (a phone app suspended just after a session.state). Holding the trigger until the deadline, and dropping it only if the recipient is still attentive or has read past it then, bounds what a stale state can lose to one window instead of losing the trigger outright.
Aggregation. An aggregate carries the latest trigger's sender, seq, mid, at and (in insecure contexts) preview; the last 20 triggers in items, each with its own sender (§5.2); count = the number of triggers aggregated (all of them, not only the 20 listed); otherSenders = the number of distinct senders other than the latest one; and kind = the highest-priority kind among them, in the order mention > reply > mention_all > dm_message. The mid values in items are unique (§4.1).
Rate cap. Across all of one recipient's windows, a hosting server MUST NOT send more than 20 message-kind notify.events for that recipient in any sliding 60-second interval. A trigger or deadline that would exceed the cap follows the "rate cap reached" rows of the state machine: the trigger waits in pending, and a deadline moves to the moment the oldest of the 20 counted events leaves the interval.
Timer precision. The deadline MAY fire up to 2 s late. Windows are kept in memory and MAY be lost on a restart; a lost window loses at most the pending aggregate.
Proposed decision PD-19-6. Why: the first message must reach the phone at once, or users think notifications are broken. Bursts after that (a lively DM, several mentions) collapse into one push per 30 s per context, which is the "coalesced over 30 s" of 00 HP-9. Discarding the aggregate when the user has meanwhile read or come back avoids buzzing about something already seen.
4.6 Withdrawal
When a message that has triggered a notification is deleted (by its author or a moderator, 10, 11) or expires under retention (11), the hosting server:
- removes it from every
pendinglist (§4.5); - for every recipient to whom a
notify.eventnaming thatmidwas sent in the last 7 days, sends anotify.eventof kindwithdrawnlisting themid(§5.2). Withdrawals for one recipient and context MAY be batched over up to 5 s, at most 50mids per event. When a root message is deleted or expires, the withdrawal lists the root'smidand themidof every edit of it that was notified to that recipient.
When an insecure message whose notification carried a preview (§4.8) is edited (11), the hosting server sends, to every recipient that got that preview in the last 7 days, a notify.event of kind withdrawn with previewOnly: true listing the mid, batched in the same way. The home server then drops the preview (§6.3); devices show the fallback text, or fetch the current text with the ticket.
A hosting server MUST remember, for 7 days, which (recipient, mid) pairs it has notified, and whether a preview was sent. The mids of message.created events it carried in a dm.request batch (12 §8.1) count as notified for every recipient of that request, because the recipient's home server may have built a record from them (§6.5). After 7 days, no withdrawal is sent; the record has expired from most devices by then (§8.4).
4.7 Event tickets
Every notify.event of a message kind carries an event ticket (Proposed decision PD-19-5).
- The ticket is an opaque bearer string of at least 128 random bits, base64url, at most 64 characters. It MAY start with a short issuer prefix such as
et_. - It authorizes exactly one operation:
GET {host}/v1/me/notifications/events(§8.6) for the events listed in thatnotify.event'sitems, on behalf of the recipient account. - It is valid for 72 h from issue. It MAY be used any number of times within that time, by any of the recipient's devices, at most 30 requests per minute per ticket.
- The hosting server stores only
SHA-256(ticket)together with (recipient, context, the listedseqvalues, expiry), and deletes the entry at expiry. - At every use the hosting server re-checks the recipient's current access (§8.6). The ticket never grants more than the recipient could read with a remote session at that moment.
Proposed decision PD-19-16: tickets and SM-4. A ticket identifies an account, not a device. In a secure context it is therefore the bounded exception to SM-4 that 00 §4.2 SM-4 records. The exception is bounded as follows:
- the ticket endpoint returns, for a secure context, only what a server can see anyway: SealedMessages, mention hints, sender addresses and device IDs, and the edit or deletion state of the named events (§8.6). It never returns anything readable without
K_hist; - the home server gives the ticket (§8.1
ticket) for a record withsecurity: "secure"only to sessions and fetch tokens of devices that are enrolled (active in the account's current IdentityState, 07); every other device getsticket: null, because it couldn't decrypt the events anyway.
22 lists the residual exposure: the home server, and anyone who steals a fetch token, can fetch the ciphertext and metadata of notified secure events for up to 72 h.
Why: a notification extension can't create a remote session in its time and memory budget. That would need a HomeAssertion, a DeviceProof signed with the device signing key (which the extension doesn't hold) and a session exchange. A ticket scoped to the notified events gives it exactly what it needs. The ticket passes through the user's own home server, which could use it to fetch the same events; in a secure context it gets only ciphertext, and in an insecure context the home server could already read the context by asserting its user (00 §5.2).
4.8 Previews
In an insecure context the hosting server MAY include a preview of the latest triggering message:
text: the currenttextof the message (11), with mention and channel tokens replaced by display names (11 §16), line breaks replaced by single spaces, truncated to at most 140 Unicode scalar values. When truncated, the last scalar value of the 140 is U+2026 HORIZONTAL ELLIPSIS. An empty text gives an empty string.attachments: the number of attachments on the message (0 if none), so the device can say "sent a file".
In a secure context the hosting server MUST NOT include a preview, nor any other text derived from content (D-022, D-051). The home server rejects one that does (§5.6).
A hosting server SHOULD omit the preview when the recipient's home server is a secure server (its ServerMetadata secure is true), because that home server must discard it anyway (§6.2 rule H6).
5. The notify.event S2S event
5.1 Delivery
notify.event is an S2S event (03 §11.3) delivered with 06's event envelope, batching, retries and deduplication (06 §9). The catalogue entry of 06 §10.1 applies:
| Property | Value |
|---|---|
| Origin → destination | Hosting server → the recipient's home server (internal delivery when they are the same server, 06 §9.1) |
| Lane | high for call_ring and call_ring_ended, which set expiresAt within 120 s of ts; normal for every other kind |
orderKey |
The recipient's canonical address |
| Subject binding | The recipient is homed at the receiver; iss is the hosting server of the referenced context (d.host = iss) |
expiresAt |
call_ring: this recipient's ring expiresAt (the RingTarget expiresAt of 15 §2.5.3, 45 s after the ring started). call_ring_ended: ts + 60 s, well inside the 120 s bound of the high lane. Other kinds: absent (06's 24 h limit applies). |
| Give-up hook | None. A notification that can't be delivered in time is dropped. |
Both ring kinds use the high lane, so 06 §9.6 keeps them in order for one recipient. A call_ring that expired before delivery is dropped, though, so a call_ring_ended can arrive with no ring before it, and events in different lanes (a ring and a message notification) aren't ordered at all (06 §9.8). The home server handles both cases (§6.3, PD-19-18).
A serialized notify.event (the whole S2S event including d) MUST NOT exceed 8 KiB. If the computed payload is larger, the sender drops items entries from the oldest until it fits, then shortens ctxName and community.name to 64 scalar values.
5.2 Payload
| Member | Type | Required | Meaning and constraints |
|---|---|---|---|
recipient |
string | Yes | Canonical address of the account to notify, homed at the receiver (D-032). |
kind |
string | Yes | §5.3. A receiver answers ignored for an unknown value. |
host |
string | Yes | The hosting server's canonical domain. MUST equal the S2S token's iss (06). |
ctx |
string | Yes | The context reference (03 §8.3). |
ctxKind |
string | Yes | channel, direct (1:1 DM) or group (group DM). MUST agree with the ctx prefix (ch:, dm:, gdm:). |
ctxName |
string or null | Yes | The channel's display name (01, 09) or the group DM's name (12); null for a 1:1 DM or an unnamed group. At most 100 Unicode scalar values. |
ctxAddr |
string or null | Yes | The channel's canonical address for channel; null otherwise. |
community |
object or null | Yes | For channel: { "name": string }, the community's display name (09), at most 100 scalar values. Null otherwise. |
security |
string | Yes | insecure or secure: the context's mode when the event was sequenced. A receiver treats an unknown value as secure. |
sender |
object | Yes, except for withdrawn |
The latest trigger's sender, or the caller for call kinds: an AddressRef {addr, name, kind} (01), where kind is user, bot or webhook. For a message posted through a webhook (11 §15.4), the sender is 11's webhook Sender { "kind": "webhook", "webhook": id, "name": name }, with no addr. Unknown kind values are treated as user. The hosting server applies 01 §6.4's server rule to the names of remote accounts before sending. |
at |
string | Yes | Timestamp of the latest trigger (the event's ts at the hosting server), or of the ring start or end. |
items |
array of NotifyItem | Message kinds | 1–20 items, oldest first; the last item is the latest trigger. |
count |
integer | Message kinds | Number of triggers this event represents, ≥ the length of items. |
otherSenders |
integer | Message kinds | Number of distinct senders among the represented triggers other than sender. |
preview |
object or null | No | Message kinds, insecure contexts only: { "text": string, "attachments": integer } (§4.8). Absent is equivalent to null; null or absent means the hosting server included no preview. MUST be absent or null when security is secure, and senders SHOULD omit it there. |
ticket |
object | Message kinds | { "token": string, "expiresAt": string } (§4.7). |
call |
object | Call kinds | call_ring: { "callId", "video": boolean, "expiresAt" }, where expiresAt is this ring's expiry for this recipient (the RingTarget expiresAt of 15 §2.5.3). call_ring_ended: { "callId", "expiresAt", "reason" }, where expiresAt is the expiry of the ring that ended (it identifies the ring when the same call rings again, 15 §13.3) and reason is from 15 §13.1: answered, declined, timeout or cancelled; an unknown reason is treated as cancelled. |
withdrawn |
array of string | withdrawn |
1–50 message IDs (mid) whose notifications are withdrawn. |
previewOnly |
boolean | No | withdrawn only. true: the listed messages were edited, not deleted; only their previews are withdrawn (§4.6). Default false. |
Kind-dependent members. A member whose Required column names kinds ("Message kinds" = mention, reply, mention_all, dm_message; "Call kinds" = call_ring, call_ring_ended; withdrawn) is required for those kinds and SHOULD be absent for other kinds. A receiver ignores a member that doesn't apply to the event's kind.
NotifyItem:
| Member | Type | Required | Meaning |
|---|---|---|---|
seq |
integer | Yes | The triggering event's seq in the context. |
mid |
string | Yes | The mid of the triggering entry: the root message's mid, or, for an edit that newly mentions the recipient, the edit entry's mid (11 §8.2). Unique within one event's items. |
kind |
string | Yes | The item's own kind (mention, reply, mention_all or dm_message). A receiver treats an unknown value as dm_message. |
sender |
object | Yes | This item's sender, so that the home server can recompute the record after items are removed (§6.2, §6.3): an AddressRef {addr, name, kind} (01), where kind is user, bot or webhook. For a message posted through a webhook (11 §15.4), the sender is 11's webhook Sender { "kind": "webhook", "webhook": id, "name": name }, with no addr. Unknown kind values are treated as user. |
at |
string | Yes | The event's timestamp. |
The payload carries no message text in secure contexts, no reaction values, no attachment names and no keys. Every address present in it is canonical; a receiver rejects a non-canonical address with address.non_canonical (01) as the event's error.
5.3 Notification kinds
| Kind | Origin | In notify.event |
Creates a record | Push type (§10.3) | Coalesced (§4.5) |
|---|---|---|---|---|---|
mention |
Hosting server (11) | Yes | Yes | alert |
Yes |
reply |
Hosting server (11), insecure contexts | Yes | Yes | alert |
Yes |
mention_all |
Hosting server (11) | Yes | Yes | alert |
Yes |
dm_message |
Hosting server (11); home server for an auto-accepted dm.request (12 §8.4) |
Yes | Yes | alert |
Yes |
call_ring |
Hosting server (15) | Yes | Yes | call (alert for a device with no call registration, §6.4) |
No |
call_ring_ended |
Hosting server (15) | Yes | No; updates the call_ring record and may create call_missed |
background or alert (§14.3) |
No |
withdrawn |
Hosting server (11) | Yes | No; updates records | background |
No |
call_missed |
Home server, from a ring that ended unanswered (§14.3) | No | Yes | alert |
No |
dm_request |
Home server (12 §8.4) | No | Yes | alert |
No |
pairing_request |
Home server (08 §6) | No | Yes, targeted at enrolled devices | alert |
No |
account_alert |
Home server (07 §15.2) | No | Yes | alert |
No |
test |
Home server (§9.4) | No | Yes, targeted at one registration | alert |
No |
Kinds marked "No" in the third column are home-local. A hosting server MUST NOT send them in notify.event, and a home server answers rejected with federation.event_invalid if one arrives.
account_alert is reserved for account-level alerts on the user's own devices, in v1 only the self-alert W4a (00 §4.12.1). Its record carries alert: { "code": string }, where the code is the warning ID: W4a in v1; a later version may add codes. This document defines only its delivery and its neutral reference text (§13.7, PD-19-15); 07 §15.2 step 10 creates it at every reset or downgrade. The W4 surface itself is shown by the app when it opens, as 20 defines.
5.4 Examples
An insecure channel mention, the first trigger in its window:
{
"id": "01a2424b-7a20-7d11-8a22-334455667788",
"t": "notify.event",
"ts": "2026-12-04T18:31:02.130Z",
"orderKey": "alice@a.com",
"d": {
"recipient": "alice@a.com",
"kind": "mention",
"host": "b.com",
"ctx": "ch:01938a11-2b3c-7d4e-8f90-aabbccddeeff",
"ctxKind": "channel",
"ctxName": "Lobby",
"ctxAddr": "lobby@b.com",
"community": { "name": "B Community" },
"security": "insecure",
"sender": { "addr": "carol@c.com", "name": "Carol", "kind": "user" },
"at": "2026-12-04T18:31:02.104Z",
"items": [ { "seq": 91, "mid": "01a2424b-79f0-7b2c-9d3e-4f5061728394", "kind": "mention",
"sender": { "addr": "carol@c.com", "name": "Carol", "kind": "user" }, "at": "2026-12-04T18:31:02.104Z" } ],
"count": 1,
"otherSenders": 0,
"preview": { "text": "@Alice are you joining voice tonight?", "attachments": 0 },
"ticket": { "token": "et_Qm9kZ2V0LXRpY2tldC0wMDAx", "expiresAt": "2026-12-07T18:31:02.130Z" }
}
}A secure 1:1 DM, aggregated at the end of a window (three messages from Alice; no preview):
{
"id": "01a2424c-0f31-7a02-9b13-2c3d4e5f6071",
"t": "notify.event",
"ts": "2026-12-04T18:41:33.020Z",
"orderKey": "dan@d.com",
"d": {
"recipient": "dan@d.com",
"kind": "dm_message",
"host": "a.com",
"ctx": "dm:KBXfagPoLlQyKu3QOiLfgw",
"ctxKind": "direct",
"ctxName": null,
"ctxAddr": null,
"community": null,
"security": "secure",
"sender": { "addr": "alice@a.com", "name": "Alice", "kind": "user" },
"at": "2026-12-04T18:41:29.871Z",
"items": [
{ "seq": 15, "mid": "01a2424b-f8a0-7c1d-8e2f-3a4b5c6d7e8f", "kind": "dm_message",
"sender": { "addr": "alice@a.com", "name": "Alice", "kind": "user" }, "at": "2026-12-04T18:41:10.002Z" },
{ "seq": 16, "mid": "01a2424b-fd11-7e3a-8b4c-5d6e7f809102", "kind": "dm_message",
"sender": { "addr": "alice@a.com", "name": "Alice", "kind": "user" }, "at": "2026-12-04T18:41:21.551Z" },
{ "seq": 17, "mid": "01a2424c-0a87-7f40-9152-6374859607a8", "kind": "dm_message",
"sender": { "addr": "alice@a.com", "name": "Alice", "kind": "user" }, "at": "2026-12-04T18:41:29.871Z" }
],
"count": 3,
"otherSenders": 0,
"ticket": { "token": "et_ZG0tdGlja2V0LWV4YW1wbGU", "expiresAt": "2026-12-07T18:41:33.020Z" }
}
}A ring and its end:
{
"id": "01a2424c-2b00-7c11-8d22-3e4f50617283",
"t": "notify.event",
"ts": "2026-12-04T18:45:00.012Z",
"orderKey": "dan@d.com",
"expiresAt": "2026-12-04T18:45:45.000Z",
"d": {
"recipient": "dan@d.com", "kind": "call_ring", "host": "a.com",
"ctx": "dm:KBXfagPoLlQyKu3QOiLfgw", "ctxKind": "direct", "ctxName": null, "ctxAddr": null, "community": null,
"security": "secure",
"sender": { "addr": "alice@a.com", "name": "Alice", "kind": "user" },
"at": "2026-12-04T18:45:00.000Z",
"call": { "callId": "01a2424c-2a9f-7b10-8c21-3d4e5f607182", "video": false, "expiresAt": "2026-12-04T18:45:45.000Z" }
}
}{
"id": "01a2424c-3f88-7e01-9a12-2b3c4d5e6f70",
"t": "notify.event",
"ts": "2026-12-04T18:45:45.004Z",
"orderKey": "dan@d.com",
"expiresAt": "2026-12-04T18:46:45.004Z",
"d": {
"recipient": "dan@d.com", "kind": "call_ring_ended", "host": "a.com",
"ctx": "dm:KBXfagPoLlQyKu3QOiLfgw", "ctxKind": "direct", "ctxName": null, "ctxAddr": null, "community": null,
"security": "secure",
"sender": { "addr": "alice@a.com", "name": "Alice", "kind": "user" },
"at": "2026-12-04T18:45:45.000Z",
"call": { "callId": "01a2424c-2a9f-7b10-8c21-3d4e5f607182", "expiresAt": "2026-12-04T18:45:45.000Z", "reason": "timeout" }
}
}A withdrawal:
{
"id": "01a2424c-5500-7a33-8b44-5c6d7e8f9001",
"t": "notify.event",
"ts": "2026-12-04T18:50:12.300Z",
"orderKey": "alice@a.com",
"d": {
"recipient": "alice@a.com", "kind": "withdrawn", "host": "b.com",
"ctx": "ch:01938a11-2b3c-7d4e-8f90-aabbccddeeff", "ctxKind": "channel", "ctxName": "Lobby", "ctxAddr": "lobby@b.com",
"community": { "name": "B Community" }, "security": "insecure",
"at": "2026-12-04T18:50:12.288Z",
"withdrawn": [ "01a2424b-79f0-7b2c-9d3e-4f5061728394" ]
}
}5.5 Sending rules
- The hosting server enqueues
notify.eventin 06's outbox in the same transaction as the window state change that causes it (06 §9.7), except that an event lost together with an in-memory window on a crash is acceptable (§4.5). - Latency target: the leading-edge
notify.eventfor a trigger, and everycall_ring, SHOULD be handed to the S2S sender within 1 s of the triggering event being sequenced (95th percentile). - A hosting server MUST NOT send
notify.eventfor a context the recipient's home server couldn't legitimately hear about (a context the recipient never had access to). Receivers ignore such events (§6.1); senders that keep sending them waste their own 06 rate budget. - A hosting server that is blocked by the recipient's home server (06 §12) sends nothing; a home server blocked by the hosting server receives nothing.
5.6 Validation at the receiving home server
After 06 §9.4 steps 1–7, the home server validates d (06 §9.4 step 8). It evaluates these rows in order, and the first that matches decides:
| # | Condition | Result |
|---|---|---|
| V1 | A kind-independent member (recipient, kind, host, ctx, ctxKind, ctxName, ctxAddr, community, security, at) is missing or has the wrong type; ctxKind disagrees with the ctx prefix |
rejected, federation.event_invalid |
| V2 | host ≠ the token's iss |
rejected, federation.event_not_authorized |
| V3 | kind is a home-local kind (§5.3) |
rejected, federation.event_invalid |
| V4 | kind is unknown |
ignored |
| V5 | A member required for this kind is missing or has the wrong type (including sender for every kind except withdrawn; a sender of kind webhook without addr is well formed); items empty, over 20, or with a repeated mid; withdrawn empty or over 50 |
rejected, federation.event_invalid |
| V6 | security is secure and preview is present and not null |
rejected, notify.secure_preview; nothing is stored |
| V7 | A present address isn't canonical | rejected, address.non_canonical |
| V8 | recipient unknown or deleted, or the legitimacy filter fails (§6.1) |
ignored |
| V9 | Otherwise | Process (§6) and answer accepted |
Before storing, the home server runs 01 §6.4 checkDisplayName on sender.name and every items[].sender.name against its address (a webhook sender has no address and isn't checked, §13.7), and on ctxName against ctxAddr for channels; it replaces each passing name with the normalized string S and sets a failing name to null (01 §6.4 server rule).
Why this order: an unknown kind from a newer minor version (00 §7.8) has kind-dependent members this receiver doesn't know, so it must be ignored before those members are checked.
A home server MUST NOT reveal through its answers whether an account exists or has a relationship with the sender: unknown recipients and failed legitimacy checks both give ignored (06 §10.1).
6. Processing at the home server
6.1 Legitimacy filter
Proposed decision PD-19-8. Before using a notify.event, the home server checks that its user has a relationship with the sending host for that context. If the check fails, the event is ignored and nothing is stored.
ctxKind |
Accepted when |
|---|---|
channel |
iss is the home server itself (internal delivery), or iss is on the recipient's community list (09), or the recipient's audience set (06 §11.1) contains iss with source assertion. |
direct, group |
The recipient's DM index (12 §9.1) has an entry for (iss, ctx) in state active. |
Special cases for DMs:
- Entry in state
requested: acall_ringis not rung. The home server ignores it; the missed call reaches the request through thedm.call_loggedstart in its batches (12 §8.4 step 11, §14.1). Every other kind is ignored: content for a pending participant travels indm.requestbatches (12 §8.1). - A DM that moved to a new hosting server (K5, 12 §13) has a new entry for (new host,
ctx); notifications from the new host pass the filter through that entry. - Entry in state
blocked,declined,leftorclosed, or no entry: ignored.
Why: without this filter, any server on the federation could make anyone's phone buzz by inventing a context. The filter costs one indexed lookup and uses data the home server already has.
6.2 Settings evaluation
For an accepted event of a message kind or call_ring, the home server computes the outcome: drop (store nothing), silent (store a silent record, no push) or notify (store a record and deliver it). Settings are those of §7; "the context settings" are the ContextNotificationSettings for (host, ctx), "the community settings" are the CommunityNotificationSettings for host (channels only).
Rules, applied in order; the first that decides wins:
| # | Rule | Outcome |
|---|---|---|
| H1 | Global enabled is false. |
drop (for call_ring: silent) |
| H2 | The context settings have muteUntil in the future, or (channels) the community settings do. |
drop (for call_ring: silent) |
| H3 | The effective level (below) is nothing. |
drop (for call_ring: silent) |
| H4 | The kind is dm_message and the effective level is mentions. Or the kind is mention_all and the effective everyone (below) is false. |
drop |
| H5 | The kind is call_ring and the effective calls is false. |
silent |
| H6 | The home server is a secure server (its ServerMetadata secure is true). |
Discard preview from the event before anything is stored; continue. |
| H7 | Global previews isn't full. |
Discard preview; continue. |
| H8 | The account's chosen presence status at the home server is dnd (11 §11.1). |
silent |
| H9 | Otherwise. | notify |
Effective level. The context settings' level unless it is default; then, for channels, the community settings' level unless it is default or absent; then the global default for the context kind (channels, dms or groupDms).
Effective everyone. The context settings' everyone if not null; else, for channels, the community settings' everyone if not null; else the global everyone.
Effective calls. The context settings' calls if not null; else the global calls.
Per-item evaluation. For message kinds, rule H4 (both clauses) is evaluated for each item, using the item's own kind, instead of for the event's kind. Items whose result is drop are removed before the record is stored; if no item remains, the outcome is drop. When any item was removed, the home server recomputes the record from the remaining items: kind = the highest-priority remaining kind (§4.5); sender and eventAt = those of the latest remaining item; otherSenders = the number of distinct remaining senders other than sender; count = the original count minus the number of removed items, but at least the number of remaining items; and preview = null if the latest item was removed (the preview belonged to it). Rules H1 to H3 and H5 to H9 are then evaluated once for the record.
Proposed decision PD-19-9 (rule H6). Why: SM-10 says a secure server never stores plaintext content it receives from other servers. An insecure preview from a remote context would be such content. The devices of a secure server's users still see the message: the event ticket lets them fetch it from the hosting server directly (§13.2).
6.3 Records
For outcome silent or notify, the home server creates one NotificationRecord (§8.1) per accepted notify.event, in one transaction with the deduplication entry of 06 §9.4 step 9. silent is true for outcome silent.
A call_ring record is identified by (host, ctx, call.callId, call.expiresAt) (Proposed decision PD-19-18), because 15 §13.3 can ring the same call again with a new 45 s ring. When a call_ring arrives:
- if a tombstone (below) exists for its (
host,ctx,callId,expiresAt), the ring already ended: the record is created alreadyended, with the tombstone's reason, and in stateread; nothing rings or is pushed (any missed call was recorded when the tombstone was stored); - otherwise, an older record of the same (
host,ctx,callId) that is stillringingis superseded: it is set toendedwithendReason: "cancelled"andendedAt= now, becomesread, and creates no missed call. The new ring'scallpush carries the same collapse key (§10.3), so the platform replaces the old ring.
For call_ring_ended, withdrawn and withdrawn with previewOnly, which create no record of their own, the home server updates existing records:
call_ring_ended: thecall_ringrecord with the same (host,ctx,call.callId,call.expiresAt); see §14.3. The update applies only while that record'scall.stateisringing, so a repeated or late end changes nothing. If no such record exists (the ring was dropped, ignored, or hasn't arrived yet), the home server keeps a tombstone for (host,ctx,callId,expiresAt,reason) for 120 s. If the reason istimeoutorcancelledand nounreadcall_missedrecord exists for (host,ctx,callId), it also creates one from thecall_ring_endedevent (sender,ctx, names,call.callId,video: false),silentwhen §6.2 would make acall_ringsilent, so a ring that never reached the home server still shows as a missed call.withdrawn(deletion): every record of the recipient for (host,ctx) whoseitemscontain a listedmid. Each such item is removed, and the record is recomputed as in §6.2 ("Per-item evaluation"). A record left with no items becomeswithdrawn(§8.2), whatever itscountsays. Note:countcan include triggers beyond the 20 listed items; those can't be withdrawn individually, socountis approximate after a withdrawal and is corrected only when the record ends.withdrawnwithpreviewOnly: true(edit): every record of the recipient for (host,ctx) whose latest item has a listedmidgetspreview: null. Nothing else changes.
After a withdrawal the home server emits notification.updated and sends a background push (with the record's collapse key) to each registration that was pushed the record and has background in types, at most one per registration per 30 s, so devices can remove or refresh the notification (§13.1 steps D3 and D5).
Proposed decision PD-19-12 (rule H8). Why: do-not-disturb is a status users already set (11). Honouring it at the home server means one switch silences every device at once. Records are still created, so nothing is lost; the user sees them when they look.
6.4 Delivery decision
After creating or changing a record, the home server delivers it:
Event WebSocket. It emits
notification.created(new record) ornotification.updated/notification.state_changed(changes) on the account'smestream (§16). Every connected session of the account at the home server receives it, as for every durablemeevent.Push. For a new record with
silent: false, it pushes to the account's active devices, device by device (Proposed decision PD-19-17). It skips:- devices that have an attentive session (§4.3) at the home server: they already got the WebSocket event and the user is looking at the app;
- for a targeted record (
targetsnot null), devices not intargets.
For each remaining device it chooses registrations by the record's push type (§10.3):
- a
call_ringrecord: if any of the device's registrations hascallintypes, push typecallto those registrations only; otherwise push typealert(withurgency: high) to its registrations that havealert; - any other record: push type
alertto its registrations that havealert.
Records changed by
call_ring_ended,withdrawnor a read (§15) cause further pushes as §6.3, §14.3 and §15.2 specify, chosen per device in the same way.
Types are binding. A home server MUST NOT send a registration a push type that isn't in its types. Why: an iPhone has a PushKit registration (call) and an APNs registration (alert, background). Choosing per device gives it exactly one ring (CallKit), and never sends the PushKit registration a type the gateway must reject (§11.5 step 3), which would otherwise count toward deleting it (§9.4).
A mobile client SHOULD send session.state with foreground: false before the operating system suspends it (03 §5.8), and servers apply that change at once (§4.3). A suspended app's socket may stay ready at the server for up to 75 s; because only attentive sockets suppress pushes, a backgrounded app that reported its state still gets its push. The client deduplicates a record that arrives both ways by its id (§13.1 step D3).
Latency target: the home server SHOULD hand the push to the gateway or Web Push service within 1 s of accepting the notify.event (95th percentile).
6.5 Home-local notifications
The home server also creates records without any notify.event:
| Kind | Created when | Contents and rules |
|---|---|---|
dm_request |
12 §8.4 step 10 files a new message request and the user's DmSettings requestNotifications (12 §9.4) is true |
host, ctx, ctxKind, ctxName from the request; sender = the inviter; dmRequest: {requestId}; security from the request; no items, no ticket, no preview. Settings rules H1 and H8 apply; levels don't (the context has no settings yet). A request filed silently by 10's anti-spam rule (three blocks within 7 days) gets silent: true. Later batches of the same request don't create new records. When the request is resolved (12 dm.request_resolved), the record becomes read. A call start that reaches the request through a later batch (dm.call_logged, 12 §8.4 step 11; §6.1) updates updatedAt and doesn't push. |
dm_message |
12 §8.4 auto-accepts a dm.request |
As for a notify.event dm_message, with items built from the message.created events in the request (at most 20) and no ticket (the events are stored with the DmIndexEntry, 12 §8.4). In an insecure DM, the home server MAY build a preview from the first event's content as §4.8 says, subject to rules H6 and H7. Settings rules H1 to H8 apply. |
call_missed |
A ring ended unanswered (§14.3), or a call_ring_ended arrived for a ring the home server never saw (§6.3) |
Copies host, ctx, context names, sender and call from the ring record, or from the call_ring_ended event when there is none. At most one unread call_missed record exists per (host, ctx, callId); a later missed ring of the same call updates it (§14.3). |
pairing_request |
08 §6.4.1 step 5 | pairing: {pairingId}; targets = the enrolled devices that had no open WebSocket at the home server; no host or ctx. Ignores global enabled, levels, mutes and do-not-disturb, because the user started it. Becomes read when the pairing session ends (08). |
account_alert |
07 §15.2 step 10 | alert: {code}, optional targets. Ignores rules H1 to H5 (global enabled, mutes and levels). For code W4a it also ignores rule H8 (do-not-disturb), like pairing_request, because D-071's accepted risk relies on the victim learning of a reset at once; codes a later version adds honour H8 unless that version says otherwise. The notification uses the neutral reference text of §13.7. The app marks it read (ids selector) when it has shown the W4 surface (20). |
test |
POST /v1/me/push-registrations/{id}/test (§9.4) |
targets = the calling device; delivered only to that registration. Ignores every setting. Becomes read 60 s after creation. |
7. Notification settings
Settings are stored only at the home server. They are addressed by (hosting server canonical domain, context reference), because a context reference names a context only on its hosting server (a 1:1 DM and its successor share a dm: reference on different hosts, 12 §13). Hosting servers never see them.
Why: one place for every setting means a user's mute applies to all their devices at once, and remote servers learn nothing about what the user mutes. The cost is that hosting servers send triggers that the home server then drops; §4.5 and §6.1 keep that bounded.
Moved DMs. When the home server adds a DM index entry for a 1:1 DM that succeeds one closed by a server upgrade (K5, 12 §13: same dm: reference, new host), it copies the ContextNotificationSettings of (old host, ctx) to (new host, ctx), unless an entry for the new key already exists, and emits notification.settings_changed. Why: a user who muted a chat shouldn't find it notifying again after a move they didn't cause.
All settings endpoints require a home session of the account (Authorization: Bearer). Bot tokens get 403 core.forbidden. A remote session gets 403 push.home_only (§9.5). Every change emits notification.settings_changed on me (§16).
7.1 Global settings
NotificationSettings:
| Member | Type | Default | Meaning and constraints |
|---|---|---|---|
enabled |
boolean | true |
Master switch. false drops every notification (rule H1). |
previews |
string | full |
What notifications show: full (sender, context and message text), sender_only (sender and context, never text), none (only "New message" or "Incoming call"). Unknown values are treated as sender_only. |
channels |
string | mentions |
Default level for channels: mentions or nothing. |
dms |
string | all |
Default level for 1:1 DMs: all, mentions or nothing. |
groupDms |
string | all |
Default level for group DMs: all, mentions or nothing. |
everyone |
boolean | true |
Whether "everyone" mentions notify. |
calls |
boolean | true |
Whether DM calls ring. |
version |
integer | — | Read-only. Increases by 1 on every change. |
updatedAt |
string or null | — | Read-only. |
Unknown level values in stored settings are treated as mentions.
GET {home}/v1/me/notifications/settings
PUT {home}/v1/me/notifications/settingsGET returns the NotificationSettings. PUT takes every writable member (all required) and an optional ifVersion (integer). If ifVersion is present and differs from the stored version, the server answers 409 core.conflict and changes nothing. A level value outside the allowed set for its member is 400 notification.level_unsupported. The response is the new NotificationSettings.
PUT {home}/v1/me/notifications/settings
{ "enabled": true, "previews": "sender_only", "channels": "mentions", "dms": "all",
"groupDms": "all", "everyone": false, "calls": true, "ifVersion": 3 }Message-request notifications are controlled by 12's DmSettings requestNotifications, not here. Clients SHOULD show that switch on the same settings screen.
7.2 Per-community settings
CommunityNotificationSettings, for the community of one hosting server:
| Member | Type | Required | Meaning and constraints |
|---|---|---|---|
host |
string | Yes | Canonical domain of the community's server (read-only; from the path). |
level |
string | Yes | default, mentions or nothing. |
muteUntil |
string or null | Yes | While in the future, the community's channels don't notify. At most 366 days ahead; null for none. "Mute forever" is level: "nothing". |
everyone |
boolean or null | Yes | Overrides the global everyone; null inherits. |
updatedAt |
string | Read-only |
GET {home}/v1/me/notifications/settings/communities list (cursor pagination, 00 §7.10)
GET {home}/v1/me/notifications/settings/communities/{host}
PUT {home}/v1/me/notifications/settings/communities/{host}
DELETE {home}/v1/me/notifications/settings/communities/{host}{host} is a domain. Clients MUST send the canonical domain, which they know from that server's ServerMetadata (02). The home server answers 400 core.invalid_request if it isn't a valid domain, and canonicalizes it through discovery (01, 02) before storing. It MUST NOT refuse a host it can't reach: a user may mute a community whose server is down. It then stores the domain as given, as a lowercase A-label (a provisional value permitted by 01 §7.7), and re-canonicalizes it at its next successful resolution of that domain (merging into an existing entry for the canonical domain, whose values win). GET of an entry that doesn't exist returns the defaults (level: "default", others null) with status 200. DELETE restores the defaults and answers 204. An account has at most 1,000 entries; excess gives 409 core.conflict with data.max.
7.3 Per-context settings: /v1/contexts/{ctx}/notification-settings
ContextNotificationSettings:
| Member | Type | Required | Meaning and constraints |
|---|---|---|---|
host |
string | Yes | Canonical domain of the hosting server (read-only; from the query). |
ctx |
string | Yes | The context reference (read-only; from the path). |
level |
string | Yes | default, all, mentions or nothing. all is allowed only for dm: and gdm: contexts. |
muteUntil |
string or null | Yes | As in §7.2. |
everyone |
boolean or null | Yes | Overrides everyone; null inherits. |
calls |
boolean or null | Yes | DMs only: overrides calls; null inherits. MUST be null for channels. |
updatedAt |
string | Read-only |
GET {home}/v1/contexts/{ctx}/notification-settings?host=<domain>
PUT {home}/v1/contexts/{ctx}/notification-settings?host=<domain>
DELETE {home}/v1/contexts/{ctx}/notification-settings?host=<domain>
GET {home}/v1/me/notifications/settings/contexts list (cursor pagination; optional ?host=)- These endpoints are served by the home server for contexts on any hosting server. The query parameter
hostnames the hosting server; when absent it defaults to the home server's own canonical domain. The home server canonicalizeshostas in §7.2. {ctx}MUST match the context-reference grammar (03 §8.3); the colon MAY be percent-encoded (00 §7.3). The home server doesn't check that the context exists or that the user can see it.PUTwithlevel: "all"for ach:context answers 400notification.level_unsupported. A non-nullcallsfor ach:context answers 400core.invalid_request.GETof an entry that doesn't exist returns the defaults with status 200;DELETEanswers 204.- An account has at most 10,000 entries; excess gives 409
core.conflictwithdata.max. Entries for contexts the user has left MAY be deleted by the home server after 90 days without change.
PUT {home}/v1/contexts/ch:01938a11-2b3c-7d4e-8f90-aabbccddeeff/notification-settings?host=b.com
{ "level": "nothing", "muteUntil": null, "everyone": null, "calls": null }{ "host": "b.com", "ctx": "ch:01938a11-2b3c-7d4e-8f90-aabbccddeeff", "level": "nothing",
"muteUntil": null, "everyone": null, "calls": null, "updatedAt": "2026-12-04T19:02:11.511Z" }Proposed decision PD-19-11. Why: 11 creates no trigger for ordinary channel messages, so the home server can't offer "all messages" for a channel without hosting servers sending a notify for every message to every member, which large communities can't afford. DMs and group DMs already trigger on every message. See Open question 1.
7.4 User experience
- Defaults need no visit to settings: DMs notify for every message, channels for mentions, calls ring, previews show.
- A context's menu offers one control, "Notifications: All messages / Only @mentions / Nothing" (channels: the last two), and "Mute for 1 hour / 8 hours / 24 hours / Until I turn it back on". A community's menu offers the same for the whole community.
- A muted context shows a muted icon in the context list on every device, from the settings list (§7.3).
- The previews setting is worded in plain terms, for example "Show message text in notifications". 20 owns the copy.
- Settings never produce warnings (D-055).
8. Notification records
8.1 The NotificationRecord object
| Member | Type | Required | Meaning |
|---|---|---|---|
id |
string | Yes | UUIDv7 assigned by the home server. This is the h of the push payload (§10.1). |
kind |
string | Yes | §5.3. A client treats an unknown kind as a generic notification ("New notification"). |
state |
string | Yes | unread, read, dismissed or withdrawn (§8.2). A client treats an unknown value as read. |
silent |
boolean | Yes | Created without push or alerting (§6.2). |
host |
string or null | Yes | Hosting server canonical domain; null for pairing_request, account_alert and test. |
hostApi |
string or null | Yes | The hosting server's base URL as the home server resolved it when verifying the S2S request (02); null when host is null. |
ctx |
string or null | Yes | Context reference; null when host is null. |
ctxKind, ctxName, ctxAddr, community, security |
as §5.2 | Yes (null when host is null) |
Copied from the notify.event or the DM request. |
sender |
object or null | Yes | As the notify.event sender (§5.2): an AddressRef (01) or 11's webhook Sender (no addr), or null. |
items |
array of NotifyItem | Yes | As §5.2 after §6.2 and §6.3 processing; empty for kinds without items. |
count |
integer | Yes | As §5.2; 0 for kinds without items. |
otherSenders |
integer | Yes | As §5.2; 0 for kinds without items. |
preview |
object or null | Yes | As §5.2, after rules H6 and H7. Always null in secure contexts. |
ticket |
object or null | Yes | The event ticket (§4.7), or null. For a record with security: "secure", the home server returns the ticket only to sessions and fetch tokens of devices that are enrolled (PD-19-16); other devices get null. |
call |
object or null | Yes | For call_ring and call_missed: { "callId", "video", "expiresAt", "state", "endReason", "endedAt" }, with expiresAt the ring's expiry (§5.2), state ringing or ended, and endReason (15 §13.1: answered, declined, timeout, cancelled) and endedAt null while ringing. A client treats an unknown state as ended and an unknown endReason as cancelled. |
dmRequest |
object or null | Yes | For dm_request: { "requestId" } (12 §10.1). |
pairing |
object or null | Yes | For pairing_request: { "pairingId" } (08). |
alert |
object or null | Yes | For account_alert: { "code" }. |
targets |
array of string or null | Yes | Device IDs the record is for; null means every device of the account. Devices not listed don't see the record in lists or events. |
eventAt |
string | Yes | at of the latest underlying event. |
pushedAt |
string or null | Yes | When the first push for the record was handed to a gateway or Web Push service; null if none. |
createdAt, updatedAt |
string | Yes | Timestamps. |
8.2 States
| State | Meaning | Counts toward the badge |
|---|---|---|
unread |
Not yet seen | Yes, unless silent |
read |
The user opened it, read the context past it, or its subject was resolved (an answered call, a resolved request) | No |
dismissed |
The user cleared it from a notification tray without opening it | No |
withdrawn |
Every message it referred to was deleted or expired | No |
| From | Event | To |
|---|---|---|
unread |
POST …/read with state: "read" selecting it; a read-through covering its latest item (§15.2); ring answered or declined by this account, or ended unanswered, or superseded by a new ring (§6.3); DM request resolved; pairing session ended; test record 60 s old |
read |
unread |
POST …/read with state: "dismissed" selecting it |
dismissed |
unread, read, dismissed |
All items withdrawn (§6.3) | withdrawn |
read, dismissed |
Anything else | unchanged |
withdrawn |
Anything | unchanged (terminal) |
A record never returns to unread. A ring record whose ring ends unanswered becomes read, and the new call_missed record is unread (§14.3).
8.3 Endpoints
All require a home session of the account, except where a fetch token (§9.3) is allowed. Remote sessions get 403 push.home_only; bot tokens get 403 core.forbidden.
GET {home}/v1/me/notifications. Lists records visible to the calling device (records whose targets is null or contains the device), newest createdAt first. Query: state (comma-separated; default unread), host and ctx (filter; ctx requires host), kind (comma-separated), cursor, limit (1–100, default 50). Response: { "items": [NotificationRecord…], "nextCursor": string or null, "badge": integer }.
GET {home}/v1/me/notifications/{id}. Accepts a home session or a fetch token. Response:
| Member | Type | Meaning |
|---|---|---|
record |
NotificationRecord | The record. |
badge |
integer | The account's badge for the calling device (§15.1). |
display |
object | `{ "previews": "full" |
A record that doesn't exist, has been deleted (§8.4), or targets other devices answers 404 core.not_found.
{
"record": {
"id": "01a2424b-7a3c-7d1e-9f00-1b2c3d4e5f60",
"kind": "mention",
"state": "unread",
"silent": false,
"host": "b.com",
"hostApi": "https://chat.b.com/server",
"ctx": "ch:01938a11-2b3c-7d4e-8f90-aabbccddeeff",
"ctxKind": "channel",
"ctxName": "Lobby",
"ctxAddr": "lobby@b.com",
"community": { "name": "B Community" },
"security": "insecure",
"sender": { "addr": "carol@c.com", "name": "Carol", "kind": "user" },
"items": [ { "seq": 91, "mid": "01a2424b-79f0-7b2c-9d3e-4f5061728394", "kind": "mention",
"sender": { "addr": "carol@c.com", "name": "Carol", "kind": "user" }, "at": "2026-12-04T18:31:02.104Z" } ],
"count": 1,
"otherSenders": 0,
"preview": { "text": "@Alice are you joining voice tonight?", "attachments": 0 },
"ticket": { "token": "et_Qm9kZ2V0LXRpY2tldC0wMDAx", "expiresAt": "2026-12-07T18:31:02.130Z" },
"call": null, "dmRequest": null, "pairing": null, "alert": null, "targets": null,
"eventAt": "2026-12-04T18:31:02.104Z",
"pushedAt": "2026-12-04T18:31:02.410Z",
"createdAt": "2026-12-04T18:31:02.301Z",
"updatedAt": "2026-12-04T18:31:02.301Z"
},
"badge": 3,
"display": { "previews": "full" }
}POST {home}/v1/me/notifications/read. Changes record states. Body:
| Member | Type | Required | Meaning |
|---|---|---|---|
ids |
array of string | One selector is required | 1–100 record IDs. |
host, ctx, throughSeq |
string, string, integer | One selector is required | host and ctx are both required in this selector; throughSeq is optional. With throughSeq: every unread record of (host, ctx) that has items and whose latest item has seq ≤ throughSeq; records without items (call_ring, call_missed, dm_request) are never selected by throughSeq, and are cleared by ids, by all, or by opening the call or request they name. Without throughSeq: every unread record of (host, ctx), with or without items. |
all |
boolean | One selector is required | true: every unread record visible to the device. |
state |
string | No | read (default) or dismissed. |
Exactly one selector (ids, the host group, or all) MUST be present; otherwise 400 core.invalid_request. With a fetch token, only the ids selector is allowed; anything else gives 403 core.forbidden (§9.3). IDs that don't exist or aren't unread are skipped silently. Response: { "updated": integer, "badge": integer }. The server then emits notification.state_changed and sends background pushes as §15.2 says.
POST {home}/v1/me/notifications/read
{ "host": "b.com", "ctx": "ch:01938a11-2b3c-7d4e-8f90-aabbccddeeff", "throughSeq": 95 }{ "updated": 2, "badge": 1 }8.4 Retention and limits
unreadrecords are deleted 30 days aftercreatedAt;read,dismissedandwithdrawnrecords 7 days after their last change.- An account keeps at most 1,000 records. When a new record would exceed that, the oldest records are deleted first, preferring non-
unreadones. - Records are deleted with the account (05) and are never sent to other servers.
tickettokens are deleted from a record when they expire; the record then hasticket: null.
8.5 Client reconciliation
- When the app starts or comes to the foreground, a client fetches
GET /v1/me/notifications?state=unread(all pages up to 1,000 records), removes from the operating system's tray every notification it displayed whose record isn't in the list, and sets the badge (§15.1). - When the user taps a notification, the client opens the context at the record's latest item (
host,ctx,seq) and marks the recordreadwith theidsselector. A notification action "Mark as read" does the same without opening the app (an extension uses its fetch token). - When the user swipes a notification away, the client SHOULD mark it
dismissedif the platform reports the dismissal (AndroiddeleteIntent, iOSUNNotificationDismissActionIdentifierwith the custom-dismiss option, the webnotificationcloseevent). - While connected to the home server, a client applies
notification.*events (§16) to its local list and tray in the same way.
8.6 GET {host}/v1/me/notifications/events
Served by every server in its hosting role. Authenticated only by an event ticket (§4.7): Authorization: Bearer <ticket>. Every credential that isn't a valid ticket, including session, bot and S2S tokens, gets 401 notify.ticket_invalid, never core.unauthenticated (03 §3.2 rule 8(c)), so that no client treats a failed ticket as a signed-out session (03 §3.3). CORS is open (03 §4), so web service workers can call it. Responses carry Cache-Control: no-store.
Processing:
- Look up
SHA-256(ticket). Missing, unknown or expired: 401notify.ticket_invalid. - Re-check the recipient's access to the context now, with the rules a remote session would face: membership state, bans,
needs_encryption(SM-4 for secure contexts), DM participation state, and the visibility rules of 11 §7.5. If access has ended: 403notify.access_ended, and the ticket is deleted. - Apply the per-ticket rate limit (30 per minute): 429
core.rate_limited. - Respond 200:
| Member | Type | Meaning |
|---|---|---|
ctx |
string | The context reference. |
items |
array | The events named by the ticket, as event envelopes (00 §7.4) with ctx and seq, in seq order, in their current form: an edited message as 11 serves it now, a deleted one as its tombstone (03 §7.2 D7). Events the recipient can no longer see are omitted. |
readSeq |
integer | The recipient's current readSeq in the context (11 §9.1). |
In a secure context each item carries what 11 serves: a message.created item carries the root sealed, or, once the message was edited, edit (an EditEntry with its own sealed, 11 §5.2); a message.edited item carries the edit's sealed; each with the mention hint. The server never decrypts anything.
{
"ctx": "dm:KBXfagPoLlQyKu3QOiLfgw",
"items": [
{ "v": 1, "t": "message.created", "id": "01a2424c-0a90-7b11-8c22-3d4e5f607181",
"ctx": "dm:KBXfagPoLlQyKu3QOiLfgw", "seq": 17, "ts": "2026-12-04T18:41:29.871Z",
"d": { "mid": "01a2424c-0a87-7f40-9152-6374859607a8",
"sender": { "addr": "alice@a.com", "name": "Alice", "did": "q2bS9xVg3m0yJpQe1vT0Aw" },
"carrier": "sealed", "createdAt": "2026-12-04T18:41:29.871Z",
"sealed": { "v": 1, "mid": "01a2424c-0a87-7f40-9152-6374859607a8", "ctx": "dm:KBXfagPoLlQyKu3QOiLfgw",
"gen": 1, "epoch": 4, "ekid": "q83vEjRWeJA", "kind": "message", "did": "q2bS9xVg3m0yJpQe1vT0Aw",
"nonce": "3q2-7wAAAAAAAAAA", "kc": "mZ8rQ1cX0vB7nT4yL2kP9w", "ct": "Vt1yQm9…", "sig": "Jk3b0xW…" },
"mentions": [], "mentionAll": false,
"edit": null, "editedAt": null, "deleted": null, "reactions": [], "updatedSeq": 17 } }
],
"readSeq": 14
}(d is a complete Message object of 11 §5.2, and the sealed members are 14's; the values shown are illustrative.)
Why the path sits under /v1/me/notifications: the path names "notifications for me on this server", which is what the ticket reads. It is the only /v1/me/notifications… endpoint a server serves for remote accounts; all the others are home-only (§9.5).
9. Push registrations
9.1 The PushRegistration object
A push registration belongs to one device record (05 §12.2) of one account, at that account's home server. A device has one registration per push channel it uses: typically one on Android (FCM), two on iOS (APNs for alerts and background pushes, PushKit for calls), and one in a browser (Web Push).
| Member | Type | Required | Meaning and constraints |
|---|---|---|---|
id |
string | Yes | UUIDv7 assigned by the home server. It is the r of the push payload (§10.1). |
did |
string | Yes | The device the registration belongs to (read-only; the calling device). |
transport |
string | Yes | gateway or webpush. A server refuses an unknown value with 400 push.registration_invalid (reason: "transport"). |
types |
array of string | Yes | The push types this registration accepts (§10.3): a non-empty set of alert, call, background. A webpush registration MUST NOT include background. A server refuses an unknown value with 400 push.registration_invalid (reason: "types"). The client lists only types its platform channel can take (§11.5 step 3): apns_voip push keys ["call"]; apns push keys alert and background; fcm any. |
gatewayUrl |
string | gateway only |
The gateway's base URL (02 §3.3 base-url), without a trailing slash. The server stores normalizeBaseUrl(gatewayUrl) (02 §3.3) and refuses a value that fails normalization with push.registration_invalid (gateway_url). |
pushKey |
string | gateway only |
The push key returned by {gatewayUrl}/v1/register (§11.2): 1–1,024 characters from ALPHA / DIGIT / "-" / "." / "_" / "~". Opaque to the home server. |
webPush |
object | webpush only |
{ "endpoint", "p256dh", "auth" } from the browser's PushSubscription (W3C Push API): endpoint an https URL of at most 2,048 octets; p256dh the base64url 65-octet uncompressed P-256 point; auth the base64url 16-octet secret (RFC 8291). |
vapidKey |
string | webpush only |
The webPushKey (02) the client passed as applicationServerKey when it subscribed. Supplied by the client; the server accepts it only if it equals the current webPushKey or an old one it still keeps (§12.4), otherwise 400 push.registration_invalid (reason: "keys"). |
state |
string | Yes | Read-only: active or failing (§9.4). Unknown values are treated as failing. |
lastDeliveredAt |
string or null | Yes | Read-only: the last push accepted by the gateway or Web Push service. |
lastError |
string or null | Yes | Read-only: the error code of the last failed push, or null. |
createdAt, updatedAt |
string | Yes | Read-only. |
fetchToken |
string | Only in the responses of §9.2 that issue one | The fetch token (§9.3). Never returned by GET. |
fetchTokenExpiresAt |
string | Yes | Read-only: when the current fetch token expires (§9.3). |
9.2 Endpoints
All require a home session (Authorization: Bearer) of the device that owns the registration. Each device sees and changes only its own registrations.
POST {home}/v1/me/push-registrations. Creates a registration. Body: transport, types, and either gatewayUrl and pushKey, or webPush and vapidKey. The server checks, in order:
- The device's platform isn't
bot, and the device isn't in shared-computer mode (DeviceRecordsharedComputer, 05 §12.6); otherwise 403push.device_not_eligible. Why: a shared-computer device keeps every token in memory only, so it can't leave a fetch token in IndexedDB for a service worker; it shows notifications only fromnotification.createdwhile its tab is open (§13.6). - The body is valid (§9.1), otherwise 400
push.registration_invalidwithdata.reasonone oftransport,types,gateway_url,push_key,endpoint,keys. - For
gateway:gatewayUrlis anhttpsURL whose host is a domain name (not an IP literal) and whose addresses, when resolved, are all public unicast addresses (not loopback, private, link-local, unique-local, multicast or reserved); otherwisepush.registration_invalid(gateway_url). Ifendpoints.push.gatewayPolicyislisted(02), the normalizedgatewayUrlMUST equal the normalized form of one ofgateways(02 §3.3); otherwise 403push.gateway_not_allowedwithdata.gateways(the allowed list). - For
webpush: the server offers Web Push (webPushKeypresent), otherwise 501core.unsupported_featurewithdata.feature: "webpush". The endpoint passes the same address check asgatewayUrl(push.registration_invalid,endpoint);p256dhis a valid point on P-256,authis 16 octets, andvapidKeyis acceptable (§9.1) (keys). - The device has fewer than
maxPushRegistrationsPerDeviceregistrations (default 4, floor 4), otherwise 409push.too_many_registrationswithdata.max.
If the device already has a registration with the same transport and the same pushKey (or webPush.endpoint), the server updates its types, issues a new fetch token (invalidating the old one) and answers 200 with it. Otherwise it creates the registration and answers 201. Both responses carry the PushRegistration with fetchToken.
Because every push key carries a fresh nonce (§11.2), the same platform token gives a different pushKey each time, so the server's match above rarely applies to gateway registrations. The client therefore keeps its registrations tidy itself: a client that doesn't know the IDs of its registrations (for example after its shared storage was cleared while its session survived) MUST call GET /v1/me/push-registrations before POST, and PUT or DELETE its own entries instead of creating new ones. Why: duplicate registrations cause duplicate pushes and eventually push.too_many_registrations.
POST {home}/v1/me/push-registrations
{ "transport": "gateway", "types": ["alert", "background"],
"gatewayUrl": "https://push.example.net/gw",
"pushKey": "pk1.AQ3vTq0b9Xc2mW8yLr5uZp1sKd4fHg7jNe6aBt0iVo2xQyRw" }{
"id": "01a24190-0c4e-7b8a-9d10-2e3f4a5b6c7d",
"did": "oKGio6SlpqeoqaqrrK2urw",
"transport": "gateway",
"types": ["alert", "background"],
"gatewayUrl": "https://push.example.net/gw",
"pushKey": "pk1.AQ3vTq0b9Xc2mW8yLr5uZp1sKd4fHg7jNe6aBt0iVo2xQyRw",
"state": "active",
"lastDeliveredAt": null,
"lastError": null,
"createdAt": "2026-12-04T17:58:40.120Z",
"updatedAt": "2026-12-04T17:58:40.120Z",
"fetchToken": "pf_Jm3kV9tQ2xYb7LcR0sWp4nHd8eGa1uFz",
"fetchTokenExpiresAt": "2027-02-02T17:58:40.120Z"
}GET {home}/v1/me/push-registrations. The calling device's registrations: { "items": [PushRegistration…], "nextCursor": null }.
GET {home}/v1/me/push-registrations/{id}. One registration; 404 core.not_found if it belongs to another device.
PUT {home}/v1/me/push-registrations/{id}. Replaces types and the transport data (pushKey, or webPush and vapidKey; transport and gatewayUrl can't change: 400 push.registration_invalid). Optional rotateFetchToken (boolean, default false): when true, a new fetch token is issued and returned, and the old one stops working at once. The periodic re-registration of §9.4 MUST set it. The same checks as POST apply. Answers 200 with the registration. The id, and therefore the r the app already knows, stays the same.
DELETE {home}/v1/me/push-registrations/{id}. Deletes the registration and its fetch token. 204. Deleting a registration that doesn't exist answers 204.
POST {home}/v1/me/push-registrations/{id}/test. Creates a test record targeted at the calling device and pushes it to this registration only, ignoring every setting. 202 with { "recordId": "<uuid>" }. At most 5 per registration per hour (core.rate_limited). The client waits up to 30 s for the push to arrive; if it doesn't, it shows its troubleshooting help (20) and MAY show lastError in a diagnostics view.
9.3 Fetch tokens
Proposed decision PD-19-4. Every registration has one fetch token.
- It is an opaque bearer string of at least 128 random bits, base64url, at most 64 characters, optionally with a prefix such as
pf_. The home server stores only its SHA-256. - It authorizes exactly two operations of the registration's account, for the registration's device:
GET /v1/me/notifications/{id}andPOST /v1/me/notifications/readwith theidsselector. Using it on any other endpoint, or with another selector, gives 403core.forbidden, not 401, so that a main app that sends it by mistake doesn't start 03 §3.3's sign-in recovery. An unknown, rotated or expired fetch token gives 401core.unauthenticated; the extension then shows the fallback text and leaves a flag in shared storage, and the main app re-registers silently at its next run (§9.4). - It expires 60 days after issue, and earlier when it is rotated (§9.2
PUT) or the registration is deleted. It ends with the registration when the device is revoked (05 §13 step 1) or the account is deleted. The client rotates it at least every 30 days (§9.4), so an active app never sees it expire. - Requests authenticated with it are not device activity in the sense of 05 §12.5.
- It is a bearer secret, not a key (04 §2.4 item 5). Insecure accounts use it too.
Why: an extension that used the app's own access token would sooner or later need to refresh it, racing the main app; 05's refresh-token reuse detection would then revoke the device. A separate token with a small scope avoids the race. Its scope isn't harmless, though: whoever steals it can read the account's notification records, including insecure previews and event tickets, and through those tickets the notified events (insecure content in full; ciphertext in secure contexts), until it is rotated or expires. Mandatory rotation and the 60-day expiry bound that exposure (§21).
9.4 Lifecycle
| Situation | Client duty | Server behaviour |
|---|---|---|
| First arrival at the home screen after onboarding on a device that supports push (20 §6.1) | After the operating-system permission (M3), obtain the platform token, call {gatewayUrl}/v1/register (or subscribe to Web Push), then POST the registration. Store id, fetchToken and the home base URL in shared storage (§13.1). |
Create; issue the fetch token. |
Platform token changes (APNs, FCM onNewToken, Web Push pushsubscriptionchange) |
Register the new token with the gateway and PUT the registration. |
Replace. |
ServerMetadata webPushKey changes |
Unsubscribe, subscribe with the new key, PUT. |
Keep sending with the old VAPID key to registrations made with it until they are replaced or 90 days pass (§12.4). |
| Every 30 days at least | Re-run {gatewayUrl}/v1/register (or confirm the Web Push subscription) and PUT the new push key with rotateFetchToken: true. Platforms that offer background refresh SHOULD do this in the background, so the token stays fresh even when the app isn't opened. |
Rotate the fetch token. |
| The extension found its fetch token refused (§9.3) | At the next run, PUT with rotateFetchToken: true, or re-register if the registration is gone. |
— |
Gateway or Web Push service reports the token gone (gone, HTTP 404 or 410) |
— | Delete the registration at once; emit push.registration_removed (reason: "gone"). |
Pushes are rejected 3 times in a row, or the registration has been failing for 7 days |
— | Set failing on the first rejection; delete at the limit with reason: "rejected". Any accepted push sets active again. A rejected result with push.type_unsupported doesn't count: the registration's types names a type its platform can't take, so the server removes that type from types (and deletes the registration with reason: "rejected" if none remains). |
The gateway is no longer allowed by a listed policy |
— | Delete with reason: "gateway_not_allowed". |
| The user turns notifications off in the operating system | SHOULD DELETE the registration. |
— |
| Sign-out or device revocation | — | Deleted by 05 §13 step 1, with the fetch token. |
On push.registration_removed for its own device, a client re-registers silently if it can (for gone, after getting a fresh platform token). For gateway_not_allowed it SHOULD tell the user once, in plain words, that this server doesn't deliver notifications to this app (copy in 20).
9.5 Home only
Push registrations, fetch tokens, notification records and notification settings exist only at the account's home server (D-051). A server MUST answer every /v1/me/push-registrations… request, and every /v1/me/notifications… request other than /v1/me/notifications/events, that is authenticated with a remote session, with 403 push.home_only. A client MUST NOT send push tokens, push keys, fetch tokens or registration IDs to any server other than its home server and its push gateway.
Bot devices and shared-computer devices never register (§9.2 check 1). A bot learns about mentions from its own sessions (11, 03).
10. The opaque push payload
10.1 Format
Proposed decision PD-19-1. Every push, of every kind, in every security mode, carries exactly this JSON object:
| Member | Type | Meaning |
|---|---|---|
v |
integer | Payload version, 1. |
h |
string | The NotificationRecord id (UUIDv7, lowercase, hyphenated). |
r |
string | The PushRegistration id the push was sent for. |
Senders MUST serialize it in exactly this form, with no white space, members in this order:
push-payload = %s"{" DQUOTE %s"v" DQUOTE %s":1," DQUOTE %s"h" DQUOTE ":" DQUOTE uuid DQUOTE
"," DQUOTE %s"r" DQUOTE ":" DQUOTE uuid DQUOTE %s"}"
uuid = 8hexl "-" 4hexl "-" 4hexl "-" 4hexl "-" 12hexl
hexl = DIGIT / %x61-66The serialized payload is always 93 octets. Receivers parse it as JSON, ignore unknown members, and treat a payload with v other than 1, or without h or r, as unusable (§13.7).
For background pushes (§10.3), h names the record whose change caused the push (for example the record just marked read or withdrawn). The payload is the same for every push type, and a receiver never needs to know which type delivered it: it always fetches the record and acts on the record's state (§13.1).
Why: the fixed form makes every push the same size and shape, so push services and gateways learn nothing from it (D-051). r lets an app signed in to several accounts, possibly on several home servers, know which account's fetch token and home server to use, without the gateway or the platform learning the account.
10.2 Platform mapping
The gateway (§11) builds the platform message from the push type and the payload. The payload object is copied byte for byte into the platform message as shown.
| Push type | APNs (apns-push-type, priority) |
APNs body | FCM HTTP v1 message |
Web Push (§12) |
|---|---|---|---|---|
alert |
alert, apns-priority: 10 |
{"aps":{"alert":{"loc-key":"<alert loc-key>"},"mutable-content":1,"sound":"default"},"sv":<payload>} |
{"token":…,"data":{"sv":"<payload as a string>"},"android":{"priority":"HIGH","ttl":"<s>s"}} |
Urgency: high |
call |
voip (topic <bundle ID>.voip), apns-priority: 10 |
{"sv":<payload>} |
as alert |
Urgency: high |
background |
background, apns-priority: 5 |
{"aps":{"content-available":1},"sv":<payload>} |
{"token":…,"data":{"sv":"<payload as a string>"},"android":{"priority":"NORMAL","ttl":"<s>s"}} |
not used |
<alert loc-key>is a localization key that the app bundle maps to a generic text such as "New notification". It is configured per app at the gateway; the RECOMMENDED key isSV_NOTIFICATION. If the iOS extension fails to replace the content in time, iOS shows this text, which contains nothing about the message.apns-expirationand FCMttlcome fromttlMs(§11.5), rounded up to whole seconds.apns-collapse-idand, forbackgroundonly, FCMcollapse_keycome fromcollapseKeywhen present. FCMcollapse_keyis never used foralertorcall, because FCM keeps at most four collapse keys per device.- FCM messages are data-only (no
notificationblock), so the app decides what to display.
10.3 Push types, urgency, lifetime and collapse keys
| Push type | Used for | urgency |
ttlMs |
collapseKey |
|---|---|---|---|---|
alert |
New records of every kind except call_ring; call_ring records for a device with no call registration (§6.4); ring ends for Web Push registrations (§14.3) |
high |
86,400,000 (24 h); for a call_ring record, as for call |
None, except call_ring, call_missed and ring ends: the call's key |
call |
call_ring records |
high |
The time left until call.expiresAt, at least 1,000 |
The call's key |
background |
Read-state sync (§15.2), withdrawals and withdrawn previews (§6.3), a ring answered or declined elsewhere (§14.3) | normal |
3,600,000 (1 h) | The record's key; for a ring end, the call's key |
Collapse keys. Where a collapse key is used, the home server computes it from a 32-byte random secret K_coll that it generates for each registration when creating it and never discloses:
collapseKey = b64u( HMAC-SHA256( K_coll, "sv1 push collapse" || 0x00 || opaque(topic) )[0..16] )topic is the ASCII string call: followed by the callId for the call's key, or rec: followed by the record id for the record's key. The result is 22 characters, which fits the 32-character limit of the Web Push Topic header (RFC 8030 §5.4) and the 64-byte limit of apns-collapse-id. Test vectors: §20.1.
Why: a collapse key lets the platform replace a ringing notification with "Missed call" and drop superseded background pushes for an offline device. Deriving it with a per-registration secret means the gateway and the platform can't link two pushes about the same call on two devices, or learn anything from the key.
11. The push gateway API
11.1 Role and the open-source requirement
A push gateway forwards wake-ups for one app publisher's builds to APNs and FCM, because only the publisher holds the credentials those services require (00 §2.2). It holds nothing else: no accounts, no records, no keys.
- A conforming Push gateway implements this section and nothing proprietary beyond the APNs and FCM interfaces themselves. Anyone holding their own APNs and FCM credentials MUST be able to run it from this specification. The project publishes its gateway as open-source software that implements this section completely, and runs it as the official gateway for the official iOS and Android apps (D-093). The gateway used by official app builds MUST be that software or a published open-source fork of it (D-009, D-093). Anyone who builds the app with their own APNs and FCM credentials runs their own copy for those builds.
- A server operator never needs to run a gateway. Server software MUST use
gatewayPolicy: "any"as its default configuration (D-093): the server then delivers to the gateway that each device names, including the official gateway, with no setup. An operator MAY chooselistedinstead, to deliver only to gateways it names (02); apps whose gateway isn't listed then get no background notifications from that server (§9.4, 20ST.push_not_allowed). - Push without any gateway works through Web Push (§12), for browsers and for Android devices that use a UnifiedPush distributor (§12.6).
11.2 Registration: POST {gatewayUrl}/v1/register
Proposed decision PD-19-2. The app sends its platform token to its own gateway, which returns a push key: the token sealed for the gateway and bound to one home server. The app gives the push key, never the raw token, to its home server.
Unauthenticated; called by the app. Request:
| Member | Type | Required | Meaning |
|---|---|---|---|
platform |
string | Yes | apns (alert and background), apns_voip (PushKit) or fcm. |
appId |
string | Yes | The app's bundle ID (APNs) or package name (FCM), 1–255 characters. |
environment |
string | apns and apns_voip |
production or development (the APNs sandbox). |
token |
string | Yes | The platform token: APNs device token as lowercase hex, or the FCM registration token. At most 4,096 characters. |
home |
string | Yes | The canonical domain of the account's home server (02). |
Response 200:
| Member | Type | Meaning |
|---|---|---|
pushKey |
string | The push key, 1–1,024 characters from ALPHA / DIGIT / "-" / "." / "_" / "~". |
Errors: 400 core.invalid_request (including an unknown environment); 400 push.app_unknown (the gateway doesn't serve appId in that environment); 400 push.platform_unsupported (including an unknown platform); 429 core.rate_limited (the gateway SHOULD allow at least 10 registrations per minute per IP address). A gateway MAY additionally require evidence that the caller is a genuine build of its app (for example Apple App Attest or Google Play Integrity); how is a matter between the gateway and its own app, outside this document, and a gateway that does so answers a request without valid evidence with 403 core.forbidden.
An app with several accounts calls this once per account (each home), and on iOS once per platform (apns and apns_voip).
Push key requirements. The format is private to the gateway that issued it; nobody else parses it. It MUST:
- be protected by authenticated encryption under a secret only the gateway holds, so that nobody else can read the token from it or forge one;
- bind the platform,
appId, environment, token andhome; - use a fresh random nonce, so that two push keys for the same token (two accounts on one phone, or one account over time) can't be linked by anyone but the gateway;
- identify the gateway key that sealed it, so the gateway can rotate keys; a gateway MUST keep a retired key for opening push keys for at least 90 days.
RECOMMENDED construction: "pk1." || b64u( keyId (1 octet) || nonce (12 octets) || AES-256-GCM(K_gw[keyId], nonce, plaintext, aad = "pk1") ), where plaintext is the TLS-presentation encoding of struct { uint8 platform; opaque appId<V>; uint8 environment; opaque token<V>; opaque home<V>; uint64 issuedAt; }.
Why: home servers then never hold APNs or FCM tokens, so two home servers can't link one person's two accounts by a shared device token, and a leaked home-server database yields nothing usable. The binding to home means a push key issued for one home server can't be used by another. It does not stop a party that holds the raw platform token from calling /v1/register with its own server as home, because registration is unauthenticated. Platform tokens are therefore secrets of the app: it MUST NOT send them anywhere except to its own gateway, and MUST NOT log them. A forged push obtained this way can only wake the app, which finds the r unknown (§13.1 step D2) and shows nothing where the platform allows. The gateway stays stateless.
11.3 Delivery: POST {gatewayUrl}/v1/push
POST {gatewayUrl}/v1/push
Authorization: Bearer <sv-push+jwt>
Content-Type: application/jsonRequest body:
| Member | Type | Required | Meaning |
|---|---|---|---|
pushes |
array of PushRequest | Yes | 1–100 pushes. The body MUST NOT exceed 256 KiB. |
PushRequest:
| Member | Type | Required | Meaning and constraints |
|---|---|---|---|
pushKey |
string | Yes | From the registration. |
type |
string | Yes | alert, call or background (§10.3). An unknown value gives this push the result rejected with push.type_unsupported. |
payload |
object | Yes | The push payload (§10.1). The gateway MUST check that its serialized form, as received, is at most 256 octets, and MUST pass it on unchanged. |
ttlMs |
integer | Yes | 0 to 86,400,000. 0 means "deliver now or never". |
urgency |
string | Yes | high or normal. A gateway treats an unknown value as normal. |
collapseKey |
string | No | 1–64 base64url characters (§10.3). |
{"pushes":[{"pushKey":"pk1.AQ3vTq0b9Xc2mW8yLr5uZp1sKd4fHg7jNe6aBt0iVo2xQyRw","type":"alert","payload":{"v":1,"h":"01a2424b-7a3c-7d1e-9f00-1b2c3d4e5f60","r":"01a24190-0c4e-7b8a-9d10-2e3f4a5b6c7d"},"ttlMs":86400000,"urgency":"high"}]}Response 200: { "results": [PushResult…] }, one per push in request order.
| Member | Type | Required | Meaning |
|---|---|---|---|
status |
string | Yes | accepted, gone, rejected or deferred. A home server treats an unknown value as deferred. |
error |
object | With gone, rejected; MAY with deferred |
A problem object (03 §10.1). |
retryAfterMs |
integer | No | With deferred. |
status |
Meaning | Home server action |
|---|---|---|
accepted |
The platform accepted the push | Set lastDeliveredAt; done. |
gone |
The platform says the token is no longer valid (push.token_gone) |
Delete the registration (§9.4). |
rejected |
Permanently refused: push.key_invalid, push.home_mismatch, push.type_unsupported, core.invalid_request |
Count toward failing (§9.4); don't retry this push. |
deferred |
Temporary: core.rate_limited, push.upstream_unavailable |
Retry (§11.7). |
Whole-request outcomes: 200 (per-push results); 400 core.invalid_request (malformed body, more than 100 pushes); 401 push.unauthenticated (token refused; retry with back-off, keys may be propagating); 403 push.home_blocked (the gateway refuses this home server; stop for 24 h); 413 core.too_large (split and resend); 429 core.rate_limited and 5xx (retry the whole batch with back-off, honouring Retry-After).
11.4 Authentication: the sv-push+jwt token
Proposed decision PD-19-3. Every /v1/push request carries Authorization: Bearer <sv-push+jwt>, a JWS (04 §6) signed with one of the home server's keys of purpose sign (02).
Header: {"alg": "EdDSA", "typ": "sv-push+jwt", "kid": "<home canonical domain>#<keyId>"}.
| Claim | Type | Required | Meaning and constraints |
|---|---|---|---|
iss |
string | Yes | The home server's canonical domain. |
aud |
string | Yes | normalize(gatewayUrl) (06 §8.3), where gatewayUrl is the registration's base URL without a trailing slash (§9.1). For a gateway at the root of its host this gives a path of /, for example https://push.example.net/. |
htm |
string | Yes | POST. |
htu |
string | Yes | normalize(gatewayUrl + "/v1/push") (06 §8.3), computed from gatewayUrl itself, never by appending to aud (which would give //v1/push for a root gateway). |
bh |
string | Yes | Base64url SHA-256 of the request content (06 §8.4). |
iat |
integer | Yes | NumericDate. |
exp |
integer | Yes | iat < exp ≤ iat + 60. |
jti |
string | Yes | At least 16 random octets, base64url. Single use at the gateway. |
The serialized token MUST NOT exceed 4,096 octets. A new token, with a new jti, is made for every attempt.
Why a new type rather than sv-s2s+jwt: a gateway isn't a Sloppy Voice server and has no canonical domain to put in aud. A distinct typ also means a push token can never be accepted as an S2S token or the reverse (04 §6.2).
11.5 Verification at the gateway
The gateway verifies like 06 §8.5, with these differences:
| Step | Check | Failure (push.unauthenticated unless stated; data.reason as in 06 §8.5) |
|---|---|---|
| G1 | Exactly one Authorization: Bearer header, at most 4,096 octets. |
missing, malformed |
| G2 | JWS header per 04 §6.2: exactly the members alg, typ and kid, all strings; alg = EdDSA; typ = sv-push+jwt; decoded header at most 1,024 bytes. |
alg, typ, malformed (an extra or missing member gives malformed) |
| G3 | Required claims present and well-typed; iss a lowercase A-label domain equal to the kid domain part. |
claims, kid |
| G4 | iss isn't on the gateway's block list. |
403 push.home_blocked |
| G5 | Resolve iss with 02's server resolution (02 §5.2, including §5.6), and obtain the key with serverKey(iss, kid, "sign", iat) (02 §11.6), which uses the gateway's pin for iss and accepts later key sets only as 02 §10.2 allows (continuity or strong evidence). canonicalDomain equals iss. |
issuer_not_canonical, key_unknown, key_status; 503 core.unavailable if iss can't be resolved; 503 core.unavailable also while the pin for iss is suspended |
| G6 | Signature, with 04's strict Ed25519 rules. | signature |
| G7 | aud equals normalize(configured base URL) (06 §8.3), where the configured base URL is the gateway's public base URL without a trailing slash. |
audience |
| G8 | htm equals the request method; htu equals normalize(origin(configured base URL) + request-target), built as 06 §8.3 says for S2S receivers. |
method, uri |
| G9 | bh equals the SHA-256 of the content. |
body_hash |
| G10 | Times: ±60 s skew, lifetime ≤ 60 s. | expired, not_yet_valid, lifetime |
| G11 | Insert (iss, jti) into a replay cache until exp + 60 s; fail if present. If the cache is unavailable, fail closed with 503 core.unavailable. |
replayed |
Then, for each PushRequest:
- Open
pushKey. Failure (malformed, unknown key ID, authentication failure, anappIdthe gateway no longer serves):rejected,push.key_invalid. - The
homebound in the key MUST equaliss; otherwiserejected,push.home_mismatch. - The type MUST suit the platform:
apns_voipaccepts onlycall;apnsacceptsalertandbackground, andcallis delivered asalert;fcmaccepts all three. Otherwiserejected,push.type_unsupported. - Per push key, the gateway MUST allow at least 60 pushes per minute with bursts of 20; beyond its limit,
deferredwithcore.rate_limitedandretryAfterMs. - Build the platform message (§10.2) and send it.
11.6 Upstream results
| Upstream answer | PushResult |
|---|---|
| APNs 200; FCM 200 | accepted |
APNs 410 Unregistered, 400 BadDeviceToken or DeviceTokenNotForTopic; FCM UNREGISTERED (404), or INVALID_ARGUMENT naming the token |
gone, push.token_gone |
APNs 400 or 413 for another reason; FCM INVALID_ARGUMENT for another reason, SENDER_ID_MISMATCH |
rejected, core.invalid_request (the gateway logs the detail without the token) |
APNs 429, 500, 503; FCM QUOTA_EXCEEDED, UNAVAILABLE, INTERNAL; timeouts |
deferred, push.upstream_unavailable or core.rate_limited |
APNs 403 (provider credentials), FCM THIRD_PARTY_AUTH_ERROR |
deferred, push.upstream_unavailable; the gateway alerts its operator |
A gateway SHOULD answer within 10 s. It MUST NOT store payloads, push keys, tokens or JWS tokens beyond the replay cache, and MUST NOT log push keys, tokens, Authorization values or payloads (03 §3.2 rule 7). It MAY keep aggregate counters per home server.
11.7 Sending rules at the home server
- The home server keeps a durable queue per registration. Pushes to one gateway MAY be batched up to 100 per request and SHOULD wait no more than 50 ms to fill a batch. At most 4 concurrent requests per gateway.
- Retries. After a
deferredresult or a temporary whole-request failure, the push is retried aftermin(2^(n−1), 300) s × u(uuniform in [0.8, 1.2],nthe consecutive failures for that registration), or afterretryAfterMsif larger, until itsttlMshas passed since the record was created; then it is dropped. Acallpush is never retried after its ring'sexpiresAt. - No redirects. A 3xx response is a failed attempt. Timeouts: 10 s to connect, 30 s for the whole exchange.
- Address checks. Before each connection the home server re-checks that the gateway host resolves only to public unicast addresses (§9.2 check 3), so a DNS change can't turn it into a probe of internal networks.
- Order. Pushes for one registration are sent in record order; a newer
callpush doesn't wait for olderalertretries.
12. Web Push
12.1 Role
For webpush registrations the home server is the RFC 8030 application server. It sends the push itself to the subscription's endpoint, which belongs to the browser's push service; no gateway is involved. Web Push subscription keys are transport keys managed by the browser (04 §2.4), so insecure accounts use Web Push too.
12.2 The request
POST <endpoint>
Authorization: vapid t=<VAPID JWT>, k=<webPushKey>
Content-Encoding: aes128gcm
TTL: <seconds>
Urgency: high | normal
Topic: <collapseKey> (only when §10.3 gives one)
Content-Type: application/octet-stream- Body: the 93-octet push payload (§10.1) encrypted as RFC 8291 specifies (
aes128gcm, RFC 8188), with the subscription'sp256dhandauth, a fresh ephemeral P-256 key and a fresh 16-octet salt per message, and one record of record size 4,096. The encrypted body is therefore 196 octets: 86 header octets, 93 payload octets, 1 delimiter octet and 16 tag octets. - VAPID (RFC 8292): a JWT signed with ES256 by the private key matching
endpoints.push.webPushKey(02), withaud= the origin ofendpoint(scheme, host and port),expat most 12 h ahead, andsub= the home server's base URL (anhttpsURI, so no personal contact is disclosed). ES256 here is required by RFC 8292 and is allowed by 00 §7.15; it isn't an exception to the EdDSA-only rule for Sloppy Voice's own signed objects. TTLandUrgencycome from §10.3 (ttlMsin seconds, rounded up).backgroundpushes are never sent to Web Push registrations.
12.3 Responses
| Response | Action |
|---|---|
| 201 Created | Accepted; set lastDeliveredAt. |
| 404, 410 | The subscription is gone: delete the registration (§9.4). |
| 403 | VAPID key mismatch or rejected authorization: treat as gone if the registration's vapidKey isn't the current webPushKey; otherwise as rejected. |
| 400, 413 | rejected. |
| 429, 5xx, timeout | Retry as §11.7, honouring Retry-After. |
Redirects aren't followed. The address checks of §11.7 apply to every endpoint host.
12.4 VAPID key rotation
A subscription is bound to the applicationServerKey it was created with. To rotate, the operator publishes a new webPushKey in ServerMetadata; clients see the change at their next metadata fetch and re-subscribe (§9.4). The home server keeps the old private key and keeps using it for registrations whose vapidKey is the old key until each is replaced, and for at most 90 days, after which it deletes the remaining old registrations with reason: "rejected".
12.5 Web client duties
- The web client subscribes with
userVisibleOnly: trueandapplicationServerKey=webPushKey, only after the user has allowed notifications in the browser's prompt (M3). It asks for that permission in context, never on first page load. - It sends, as
vapidKey, thewebPushKeyit actually passed asapplicationServerKey(§9.1). - It stores the registration
id, the fetch token and the home base URL in IndexedDB, where its service worker can read them (§13.5). - In shared-computer mode (05 §12.6) it doesn't subscribe or register at all (§9.2 check 1); it shows operating-system notifications only from
notification.createdwhile its tab is open (§13.6). - On
pushsubscriptionchangeit re-subscribes and callsPUT(§9.4).
12.6 Web Push without a browser: UnifiedPush
An Android app MAY register a webpush registration whose endpoint comes from a UnifiedPush distributor that supports RFC 8291 encryption, instead of FCM through a gateway. The home server can't tell the difference and needs none. This gives a push path with no Google service and no gateway at all (D-009). The app then processes pushes as §13.4 describes.
13. Processing on the device
13.1 Common procedure
On every push, the receiving code (app or notification extension) runs these steps. Each network request has a timeout of 5 s.
| Step | Action |
|---|---|
| D1 | Parse the payload (§10.1). If it is unusable, show the generic text ("New notification") and stop. |
| D2 | Look up r among the registrations this app installation made (any account). This identifies the account, its home base URL and its fetch token. If r is unknown (a stale registration from an earlier install or a removed account, or a push forged by someone who learned the platform token, §11.2), the push MUST be suppressed where the platform allows (§13.3 to §13.5); where it can't be, show the generic text with no sound. Then stop. |
| D3 | The app keeps a set of handled record IDs in shared storage for 7 days. If h was already handled and no notification for h is currently displayed, stop. If a notification for h is displayed, continue with D4 and D5 only, to refresh it. |
| D4 | GET {home}/v1/me/notifications/{h} with the fetch token. On 404, stop without showing anything where the platform allows (§13.3, §13.5); otherwise show the generic text. On 401 (the fetch token was refused, §9.3), set the re-registration flag in shared storage and show the fallback text using whatever the app has cached, or the generic text. On a timeout or other error, show the fallback text (§13.7) in the same way. |
| D5 | If the record's state isn't unread: remove the displayed notification for h; also re-fetch, with the fetch token, the records of the other notifications displayed for the same (host, ctx) (at most 10) and remove those that are no longer unread, so one read-through push clears the context; update the badge; and stop without showing anything where the platform allows. If the record is unread and D3 found it already displayed, leave it as it is and stop. |
| D6 | If display.previews is none, show the minimal text (§13.7) and go to D10. |
| D6a | Pinned security (Proposed decision PD-19-19). If the main app has pinned (host, ctx), or host's community, as secure (D-056), or last knew (host, ctx) as a secure DM or group DM (shared storage, §13.2), the device MUST treat the record as secure whatever its security says: it MUST ignore preview and MUST NOT render any content that the ticket endpoint returns; it continues with D8, which renders only a SealedMessage. The main app deals with the mismatch when it next opens the context (W9 for a pinned channel or server, SM-12; 12's rules for a DM whose mode changed). Why: otherwise a hosting server could put forged plaintext, credited to a real member, on the lock screen of a secure context, which 00 §5.2 says it can never do. |
| D7 | Insecure context: the text is preview.text when display.previews is full and a preview is present; otherwise, if display.previews is full and the record has a ticket (a secure-server home dropped the preview, rule H6, or an edit withdrew it, §4.6), fetch the events with the ticket (D8) and use the latest message's content.text, shortened to 140 scalar values; otherwise use the fallback text. |
| D8 | Secure context (or D6a), display.previews = full: GET {hostApi}/v1/me/notifications/events with Authorization: Bearer <ticket.token>. Take the item whose seq is the seq of the record's latest item. If its seq ≤ the returned readSeq, mark the record read (POST {home}/v1/me/notifications/read with { "ids": [h] } and the fetch token) and continue as D5. Open d.edit.sealed when the item is a message.created whose edit is non-null, otherwise d.sealed; if neither is present, use the fallback text. Open that SealedMessage with the notification key subset (§13.2). The displayed sender MUST be the address under which the sender public-key cache (14 §6.7) holds the key that verified the signature, and that address MUST equal both the record's sender.addr and the event's sender.addr; if they differ, use the fallback text without content and record a diagnostic. On success, render the decrypted content's text (mention tokens replaced by names the app knows, otherwise by local parts). On any failure, use the fallback text. |
| D9 | Mention check (11 §4.4): when the decrypted item's own kind (NotifyItem) is mention and its content mentions neither the user nor replies to the user with ping: true: if the record has no other item, suppress the notification silently where the platform allows and mark the record read with the fetch token, and where it can't be suppressed, show the fallback text without the "mentioned you" wording: the channel-message row of §13.7 in a channel, the dm_message row in a DM; if the record has other items, show the fallback text for the record without the "mentioned you" wording (the count > 1 or dm_message row of §13.7). |
| D10 | Display, grouped by (host, ctx) (iOS threadIdentifier, Android notification group and channel, web tag). The sender's display name is checked against its address (01, D-031): the normalized string S is shown if it passes, and the prepared local part if it fails (01 §6.4, §6.5), and the domain when it differs from the context's domain. For a channel, ctxName is checked against ctxAddr in the same way, and the local part of ctxAddr is shown if it fails. Set the badge from badge plus the latest known badges of the device's other accounts. Record h as handled. |
The receiving code never needs to know which push type delivered the payload: an alert, call or background push all lead to the same record fetch, and the record's state decides what is shown or removed (§10.1).
The hosting server's base URL is taken from the record's hostApi. A client that already has a discovery result for host (cached by the main app in shared storage) SHOULD use its own result; if they differ, it uses its own and SHOULD record a diagnostic.
13.2 Secure content in an extension
A notification extension opens a SealedMessage exactly as 14 §6.7 requires:
- It uses only the notification key subset, in the layout 08 §13.5 defines (14 §3.7 rule 4), written by the main app.
- It selects the history key whose (
host,ctx,gen,epoch,ekid) equal the record'shostandctxand the SealedMessage'sgen,epochandekid(08 §13.5; 14 §6.3 steps 3 and 7); if none matches, it shows the fallback text. (Adm:reference can name contexts on two hosts, 12 §13, soctxalone isn't enough.) - It verifies the DSK signature with the sender public-key cache (14 §6.7), looked up by (
host,ctx, the event's sender address,sealed.did), checks the key commitment, and decrypts withK_msgderived fromK_hist(14). - If no entry matches, the sender's public key is missing, or any check fails, it shows the fallback text and never partial content (14 §6.7, 08 §13.5).
The extension MUST NOT hold or use the identity key, a device signing key, a vault key, a box key, the phrase entropy, MLS state, or home or remote session tokens. It never processes MLS messages, never runs Argon2id (04 §12), and never writes to the key archive.
Besides the notification key subset, the shared storage holds these non-key items, owned by this document:
| Item | Secret? | Written by |
|---|---|---|
| Per account: home base URL, registration IDs, fetch token | The fetch token is a bearer secret | Main app |
| Handled record IDs (7 days) | No | Main app and extension |
Per (host): the main app's discovery result (base URL) |
No | Main app |
Display-name cache for mention rendering: (host, address) → display name |
No | Main app |
| Latest badge per account | No | Main app and extension |
Per account: the (host, ctx) pairs and the hosts the main app has pinned as secure (D-056), and the (host, ctx) of DMs and group DMs it last knew as secure (step D6a) |
No, but integrity matters: only the main app writes it | Main app |
| Per account: the re-registration flag (§9.3) | No | Extension |
Secrets in shared storage are protected as 08 §13.5 requires for the notification key subset: on iOS under the subset's own wrapping key, a Keychain item in an access group shared with the extension, readable after first unlock on this device only; on Android under the subset's own Keystore key alias; on the web in IndexedDB under the subset's own non-extractable wrapping key, never the main wrapping key of D-065.
UX: in a busy secure channel whose epoch changed while the app wasn't running (someone joined), the extension lacks the new key and shows "Alice mentioned you in #Lobby" (or "New message from Alice in #Lobby" when the mention can't be confirmed). The text appears when the user opens the app. This is expected and never presented as an error.
13.3 iOS
Notification Service Extension (alert pushes).
- The push has
mutable-content: 1, so iOS runs the NSE. iOS gives it about 30 s and a small memory budget (on the order of 24 MB) before callingserviceExtensionTimeWillExpire. - The NSE MUST finish the procedure of §13.1 within 20 s of receiving the push. If it hasn't, it delivers the fallback text at once. In
serviceExtensionTimeWillExpireit delivers the fallback text (never the bareloc-keytext if it has the record). - It MUST keep its peak memory well under the platform limit: no MLS library, no Argon2id, streaming JSON for the events response, and at most one event decrypted.
- To suppress a notification (D2, D4 404, D5, D9), the app needs the
com.apple.developer.usernotifications.filteringentitlement. An app without it delivers the fallback text withrelevanceScore0 and no sound, and the main app removes it at its next run (§8.5).
Calls (PushKit VoIP pushes). iOS requires that every VoIP push results in CXProvider.reportNewIncomingCall before the handler returns, or it stops delivering VoIP pushes to the app. Therefore the app MUST, on every call push:
- report a new incoming call at once, with a generic caller ("Sloppy Voice call") and the record ID
has the call's UUID; - then fetch the record (§13.1 D4, 5 s timeout) and update the call with
CXCallUpdate: the caller's display name, the DM or group name, andhasVideofromcall.video; - if the record isn't
unread, itscall.stateisended, orcall.expiresAthas passed, end the reported call at once withCXCallEndedReason.remoteEnded(or.answeredElsewherewhencall.endReasonisanswered,.declinedElsewherewhendeclined); - if the fetch fails, keep ringing with the generic caller; the ring ends at the latest at
call.expiresAt, which the app learns from the record or, failing that, 45 s after the push (15 §13.1); - if
ris unknown (§13.1 D2), still report the call (iOS requires it) and end it at once withCXCallEndedReason.failed, before any ringtone plays where CallKit allows.
While CallKit shows the call, the app is running and opens its event WebSocket to the home server (with foreground: false, §4.3), so it receives notification.updated when the ring ends elsewhere (§14.3). A background push for the ring record has the same effect (§13.1 D5). Either way, the app ends the reported call as step 3 says.
Background pushes. iOS delivers content-available pushes at low priority and may throttle them heavily. They are a best-effort optimization for clearing notifications and badges (§15.2); correctness never depends on them.
13.4 Android
- FCM data messages with priority
HIGHstart the app'sFirebaseMessagingServiceeven in Doze. The app MUST post a visible notification for everyalertandcallpush it doesn't suppress under D2, D4, D5 or D9; FCM may lower the priority of apps whose high-priority messages don't lead to visible notifications. - The handler has a short time budget (the platform allows roughly 10 to 20 s). The app MUST complete §13.1 within 8 s or post the fallback text. It MAY continue work in an expedited job, for example to replace the fallback with decrypted text, and then update the same notification; that job is bound by the next rule too.
- The FCM handler MUST use only the notification key subset (§13.2, 08 §13.5). It MUST NOT load MLS state or unwrap the main key store, even though it runs in the app's own process (00 HP-9). Only the main app, once the user has started it normally, uses the full key store.
- On Android 13 and later the app asks for
POST_NOTIFICATIONSin context (M3). Incoming calls use a notification of categoryCATEGORY_CALLwith a full-screen intent where the user has allowed it, and a heads-up notification otherwise. NORMAL-prioritybackgroundpushes may be delayed by Doze; they are best-effort as on iOS.
13.5 Web (service worker)
- The browser decrypts the Web Push message and fires the service worker's
pushevent. The service worker MUST callshowNotificationwithin the event'swaitUntilfor every push; browsers may show their own generic notice, or revoke the subscription, when a push shows nothing. - It runs §13.1 within 10 s, using the fetch token from IndexedDB. For secure contexts it uses the notification key subset as §13.2 says, stored under the subset's own non-extractable wrapping key (08 §13.5), and unwraps nothing else. A browser in shared-computer mode has no push registration at all (§9.2 check 1, §12.5).
- Where §13.1 says "suppress", the service worker instead closes any notification for the record and shows nothing only if the browser allows it; otherwise it shows the fallback text with
silent: true. - Every notification has
tag= a value derived from (host,ctx) (calls: fromcallId), so a newer notification for the same context replaces the older one, anddata={h, r}sonotificationclickcan open the right context. - Calls show a notification with
requireInteraction: trueand actions "Answer" and "Decline". Web Push has no background pushes, so the home server sends every ring end to a Web Push registration as analertpush (§14.3) with the call'sTopic. For an answered or declined ring the push carries the ring record'sh: the service worker closes the call notification and, if the browser requires a notification for the push, shows a quiet one ("Call answered on another device" or "Call declined",silent: true). For a ring that timed out or was cancelled, thecall_missedpush (sametag) replaces it. When the call notification is clicked after the ring ended, the app shows "Call ended".
13.6 Desktop
Desktop apps don't register for push. While running, including minimized or in the system tray, they keep the home server's event WebSocket open and:
- show an operating-system notification for each
notification.createdthat isn'tsilent, unless the app's window is focused, following §13.1 steps D5 to D10 with the app's full state (it can decrypt with its normal key store). Step D6a applies with the app's own pins, and the sender rule of step D8 applies to every decrypted message shown in a notification; - ring for
call_ringrecords withsilent: falseusing the incoming-call window; asilentring record appears only as a missed call; - remove notifications on
notification.state_changedandnotification.updated.
Rings and in-app notices from two servers. A desktop or web client connected to both the hosting server and its home server receives a ring twice (call.ringing from the hosting server, 15 §13.1, and notification.created from the home server). It keeps at most one incoming-call window per (host, ctx, callId), opened by whichever arrives first. Because the hosting server doesn't know the user's settings, the client applies its synced settings (§7, notification.settings_changed) and the account's presence status to call.ringing and notify.triggered before alerting: when the outcome of §6.2 would be drop or silent (for example a muted DM, calls: false, or dnd), it shows only a silent in-app indicator, and the call appears as a missed call. A record with silent: true never rings.
A desktop app that isn't running receives nothing; its user sees the records when it starts (§8.5). A desktop app MUST send session.state with foreground: false when all its windows are hidden or minimized (03 §5.8), so that hosting servers send notify and its own home-server socket doesn't suppress pushes to the user's phone.
13.7 Fallback and minimal texts
When content can't or mustn't be shown, clients use these texts. They are this document's reference texts (PD-19-15): this document owns them, and 20 §19.2 governs their localisation, which keeps their meaning. The information each text uses is normative; a client MAY adjust wording only within 20 §19.2.
| Situation | Reference text |
|---|---|
| Record unavailable (D1, D2, D4 failure without cache) | "New notification" |
display.previews = none |
"New message", or "Incoming call" for calls |
mention |
"{Sender} mentioned you in #{channel}" (community name as subtitle) |
reply |
"{Sender} replied to you in #{channel}" |
mention_all |
"{Sender} mentioned everyone in #{channel}" |
dm_message, 1:1 |
"New message from {Sender}" |
dm_message, group |
"New message from {Sender} in {group name}" (or the participants' names when the group has no name) |
| Channel message without mention wording (D9) | "New message from {Sender} in #{channel}" |
count > 1 |
"{count} new messages from {Sender}", or "{count} new messages in #{channel}" when otherSenders > 0 |
call_ring |
"{Sender} is calling", or "Incoming video call from {Sender}" |
call_missed |
"Missed call from {Sender}" |
dm_request |
"New message request from {Sender} ({address})"; {address} is the sender's display form, domain always included (01 §6.6, §4.4 rule 3; a U-label only where 01 §4.3 allows) |
pairing_request |
"Open Sloppy Voice to answer a sign-in request". Tapping it opens the app, which shows the M5 approver prompt of 20; the notification itself names no device and no risk. |
account_alert |
"Open Sloppy Voice to review a change to your account", for every alert code. It names no warning, no device and no risk; tapping it opens the app, which shows the W4 surface of 20. |
test |
"Notifications are working" |
{Sender} is the sender's display name after the display-name check (01), with the domain appended when it differs from the context's domain (D-031). For kind: "webhook", {Sender} is the webhook's name followed by " (Webhook)"; the display-name check of 01 isn't applied, and the sender is never shown or linked as an account (11 §5.1). {channel} is ctxName after the check of §13.1 D10. Fallback texts never contain message content, never say that decryption failed, and never use security-warning wording: notifications aren't part of the warning catalogue (D-055), and 20 §2.1 rule 2 forbids expressing a security message through a notification. That is why the account_alert text only asks the user to open the app.
Why 19 owns these texts: 20 §1.2 leaves notification text to this document, and a text an extension must render with no network access has to be fixed in the app bundle. One owner avoids two documents each assuming the other wrote it.
13.8 Time budgets
| Platform and component | Platform limit (informative) | Budget this document sets | Then |
|---|---|---|---|
| iOS NSE | About 30 s; small memory budget | 20 s for §13.1; 5 s per request | Fallback text |
| iOS PushKit handler | Must report the call before returning | Report at once; caller details within 10 s | Keep the generic caller |
| Android FCM service | About 10–20 s | 8 s | Fallback text; MAY finish in an expedited job |
| Web service worker | Browser-dependent, typically about 30 s | 10 s | Fallback text |
| Every HTTP request | — | 5 s | Treated as a failure |
14. Call ringing
14.1 At the hosting server
15 §13 creates the ring and sends notify.event of kind call_ring to each target's home server, whatever the target's sessions are, never coalesced, on the high lane with expiresAt = that target's ring expiresAt (§5.1). A new ring of the same call (15 §13.3) sends a new call_ring with the new expiresAt. When a ring ends for a target, it sends call_ring_ended with the reason and that ring's expiresAt. Rings go only to active DM participants and never to a 1:1 participant who blocked the caller (12 §14).
14.2 At the home server: the ring
On an accepted call_ring (§5.6, §6.1):
- If the DM index entry is
requested, the call is recorded in the request (12) and nothing rings (§6.1). - Otherwise the settings decide
silentornotify(§6.2: rules H1 to H3 and H5 make a ring silent, H8 too). - The home server applies the tombstone and supersession rules of §6.3, then creates a
call_ringrecord withcall.state: "ringing"and emitsnotification.created. Connected desktop and web clients of the account show their incoming-call screen from that event (§13.6), even when they have no session at the hosting server, unless the record issilent. - For
notify, it pushes per device as §6.4 says: typecallto a device's registrations that havecall, or, for a device with none, typealertwithurgency: highto its registrations that havealert; never to devices with an attentive session at the home server. It remembers which devices and registrations it pushed the ring to. - If
call.expiresAthas already passed when the event is processed, the record is created withcall.state: "ended",endReason: "timeout", and the missed-call step of §14.3 runs instead of ringing.
14.3 At the home server: the end of a ring
On call_ring_ended, the home server finds the call_ring record for (host, ctx, call.callId, call.expiresAt) (§6.3). If it doesn't exist, the tombstone rule of §6.3 applies. If its call.state is already ended, nothing happens (a repeated or late end is harmless). Otherwise it sets call.state: "ended", endReason and endedAt, and then, by reason:
reason |
Record | Pushes, for each device that was pushed the ring (§14.2 step 4) |
|---|---|---|
answered, declined |
The ring record becomes read. |
A background push of the ring record, with the call's collapse key, to the device's registrations that have background; for a device with no registration that has background (a browser), an alert push of the ring record, with the call's collapse key as Topic, to its webpush registrations that have alert (§13.5). So devices stop ringing. |
timeout, cancelled |
The ring record becomes read. A call_missed record is created, silent if the ring was, unless an unread call_missed record for the same (host, ctx, callId) already exists (a ring again, 15 §13.3); that record is then updated (eventAt, updatedAt) and not pushed again. |
For a new, non-silent call_missed record: an alert push of it, with the call's collapse key, to the device's registrations that have alert (on iOS the APNs registration, not the PushKit one; it replaces the ringing notification where the platform collapses). |
A home server never sends a registration a push type it doesn't list (§6.4). In every case it emits notification.updated for the ring record (and notification.created or notification.updated for the missed call).
An answered reason reaches the user's own other devices this way too, so "answered on another device" stops their ringing. Devices connected to the hosting server also get call.ring_ended directly (15).
14.4 On the device
- Answer: the app opens a remote session at the hosting server if it hasn't one (06) and joins the call with
create: false(15 §13.2). If the call has ended, 15 answerscall.not_activeand the app shows "Call ended". - Decline:
POST {host}/v1/contexts/{ctx}/call/decline(15 §13.2), which needs a remote session. The app SHOULD do it within 10 s; if it can't, it stops ringing locally and the ring times out at the hosting server. - Local expiry: every device stops ringing at
call.expiresAton its own clock, whether or not acall_ring_endedarrives. - One call: a device already in a call on any server shows the ring as a waiting call; answering follows the client's one-call rule (D-067).
- Ringing is never a security prompt (15 §13.3). In a secure DM the incoming-call screen MAY show the closed lock only when SM-12 holds on this device: the main app holds current MLS state for the DM's group. Otherwise, and always in the PushKit handler and other extensions, which hold no MLS state, it shows no lock until the call is joined (00 §4.12.6).
15. Badges and read-state synchronization
15.1 Badge
- The badge of an account, for one device, is the number of its records in state
unreadwithsilent: falsethat are visible to that device (targetsnull or containing it), capped at 9,999. The home server returns it with every record fetch, list andnotification.*event, computed for the device of the session or fetch token that receives it (§16.1). - The app icon badge is the sum of the badges of every account signed in on the device, using the latest value known for each. Platforms that can't show a number (some Android launchers) show a dot when the sum is positive. Web clients use
navigator.setAppBadgewhere available. - The badge counts notifications (mentions, DM messages, calls, requests), not every unread message in every channel: the home server doesn't know channel read state, and counting every channel message would make the badge meaningless in large communities. In-app unread indicators come from 11's ReadState.
15.2 Read-state synchronization
Proposed decision PD-19-10. Read state reaches the home server from the user's own clients.
- When a client advances its read position in a context (11 §9.3) and, to its knowledge, the account has
unreadrecords for (host,ctx), it callsPOST {home}/v1/me/notifications/readwith{host, ctx, throughSeq: <new readSeq>}. It SHOULD send at most one such call per context every 2 s, plus one when the user leaves the context. - The home server marks the matching records
read, emitsnotification.state_changed, and sends abackgroundpush (with the record's collapse key,h= the newest record changed) to each registration of the account's other devices that was pushed one of those records and hasbackgroundintypes(never a Web Push registration, §9.1). It sends at most one such push per registration per 30 s; changes in between are covered by the next one or by the app's reconciliation (§8.5). - A device receiving such a push runs §13.1: the record is no longer
unread, so step D5 removes its notification and those of the same context whose records are no longerunread, and updates the badge. - Web Push registrations get no background pushes; a web client reconciles when it next runs, and its service worker closes stale notifications for a context when it handles the next push for that context.
Why: the client that reads already talks to the home server, so this costs one small request; an S2S path from every hosting server would add traffic for every read in every community. The hosting server's readSeq still lets a device drop a stale notification at display time (§13.1 D8).
15.3 Other state changes
| Change | Effect on records |
|---|---|
| DM request accepted, declined or blocked (12) | Its dm_request record → read |
| Ring answered or declined by this account | Ring record → read (§14.3) |
| Pairing session ended (08) | pairing_request record → read |
| Message deleted (§4.6) | Items removed; record → withdrawn when empty |
| User leaves a context or is removed from it | Nothing at the home server; the records expire (§8.4), and the event ticket stops working (§8.6) |
16. Events
16.1 Client events
| Type | Transport | Direction | Class | Stream | Timeline item | Payload d |
|---|---|---|---|---|---|---|
notify.triggered |
Client WebSocket | Hosting server → recipient's sessions | Ephemeral, targeted (03 §7.2 E5) | me at the hosting server |
— | §4.4 |
notification.created |
Client WebSocket | Home server → the account's sessions | Durable | me at the home server |
No | { "record": NotificationRecord, "badge": integer } |
notification.updated |
Client WebSocket | Home server → the account's sessions | Durable | me at the home server |
No | { "record": NotificationRecord, "badge": integer }: the full new state (ring ended, items withdrawn) |
notification.state_changed |
Client WebSocket | Home server → the account's sessions | Durable | me at the home server |
No | { "ids": [string], "state": string, "badge": integer }: records that moved to state; at most 100 IDs per event |
notification.settings_changed |
Client WebSocket | Home server → the account's sessions | Durable | me at the home server |
No | `{ "scope": "global" |
push.registration_removed |
Client WebSocket | Home server → the account's sessions | Durable | me at the home server |
No | `{ "id": string, "did": string, "reason": "gone" |
Rules:
- Records with non-null
targetsare reported to every session of the account (03 §7.2 D4 forbids skipping aseqfor some subscribers). For sessions of devices not intargets, the server sends the reduced payload{ "record": null, "id": string, "badge": integer }, which a client applies by ignoring it apart from the badge. badge, theidsofnotification.state_changed, andrecord.ticketare computed per receiving session, at delivery and again at replay, as 03 §7.2 D4 allows for viewer-dependent payloads:badgeis that session's device's badge (§15.1);idsomits records whosetargetsexclude that device (an event left with noidsis still delivered, withids: []); andrecord.ticketis null for a secure-context record when the device isn't enrolled (§8.1, PD-19-16).- Every payload is idempotent (03 §7.2 D8): it carries the full record, or the target state.
- A client treats unknown
state,scopeandreasonvalues as no change it needs to act on, apart from updating the badge.
{
"v": 1,
"t": "notification.state_changed",
"id": "01a2424c-6a00-7b11-8c22-3d4e5f607100",
"ctx": "me",
"seq": 812,
"ts": "2026-12-04T19:05:40.002Z",
"d": { "ids": ["01a2424b-7a3c-7d1e-9f00-1b2c3d4e5f60"], "state": "read", "badge": 2 }
}16.2 Server-to-server events
| Type | Origin → destination | Payload | Lane, orderKey, binding, expiresAt |
|---|---|---|---|
notify.event |
Hosting server → recipient's home server | §5.2 | §5.1 (06 §10.1) |
17. Error codes
All use the problem object of 03 §10.1. The tables below are the registry entries for this document's areas (03 §10.4).
17.1 notify.*
| Code | HTTP | retryable |
userAction |
data |
Meaning |
|---|---|---|---|---|---|
notify.ticket_invalid |
401 | false | none |
— | The credential at the event-ticket endpoint isn't a valid event ticket: missing, unknown, malformed or expired, or another kind of token (§8.6). The device falls back (§13.7). |
notify.access_ended |
403 | false | none |
— | The recipient no longer has access to the context (§8.6). |
notify.secure_preview |
400 | false | none |
— | S2S, as an EventResult error: a notify.event for a secure context carried a preview (§5.6). |
17.2 push.*
| Code | HTTP | retryable |
userAction |
data |
Meaning |
|---|---|---|---|---|---|
push.home_only |
403 | false | none |
— | Push registrations, records and settings exist only at the account's home server (§9.5). |
push.registration_invalid |
400 | false | none |
reason: transport, types, gateway_url, push_key, endpoint, keys |
The registration body is invalid (§9.2). |
push.gateway_not_allowed |
403 | false | contact_admin |
gateways (array of string) |
The server's listed policy doesn't include this gateway (§9.2). |
push.too_many_registrations |
409 | false | none |
max |
The device has maxPushRegistrationsPerDevice registrations. |
push.device_not_eligible |
403 | false | none |
— | Bot devices and devices in shared-computer mode can't register for push (§9.2 check 1). |
push.unauthenticated |
401 | true | none |
reason (as 06 §8.5) |
Gateway: the sv-push+jwt was refused (§11.5). |
push.home_blocked |
403 | false | none |
— | Gateway: this home server is blocked by the gateway's operator. |
push.key_invalid |
400 | false | none |
— | Gateway, per push: the push key can't be opened. |
push.home_mismatch |
403 | false | none |
— | Gateway, per push: the push key is bound to another home server. |
push.type_unsupported |
400 | false | none |
type |
Gateway, per push: the push type doesn't suit the key's platform. |
push.token_gone |
410 | false | none |
— | Gateway, per push: the platform reports the token invalid; the home server deletes the registration. |
push.upstream_unavailable |
503 | true | wait |
— | Gateway, per push: APNs or FCM is unavailable. |
push.app_unknown |
400 | false | none |
appId |
Gateway registration: the gateway doesn't serve this app in this environment. |
push.platform_unsupported |
400 | false | none |
platform |
Gateway registration: unknown or unsupported platform. |
17.3 notification.*
| Code | HTTP | retryable |
userAction |
data |
Meaning |
|---|---|---|---|---|---|
notification.level_unsupported |
400 | false | none |
level, allowed (array of string) |
The level isn't allowed for this setting or context kind (for example all for a channel) (§7). |
This document also uses core.* (03), address.non_canonical (01), and federation.event_invalid, federation.event_not_authorized (06).
18. Limits and timers
| Name | Value | Section |
|---|---|---|
| Notification window | 30 s per (recipient, context); deadline may fire up to 2 s late | §4.5 |
Message-kind notify.event rate |
≤ 20 per recipient in any sliding 60 s, per hosting server | §4.5 |
Items per notify.event |
1–20 | §5.2 |
Serialized notify.event |
≤ 8 KiB | §5.1 |
| Preview text | ≤ 140 Unicode scalar values | §4.8 |
ctxName, community.name |
≤ 100 scalar values (64 when shortened to fit) | §5.1, §5.2 |
| Withdrawal memory at the hosting server | 7 days; batching ≤ 5 s, ≤ 50 mids per event |
§4.6 |
| Event ticket | ≥ 128 random bits, ≤ 64 characters; valid 72 h; ≤ 30 uses per minute | §4.7 |
Ring notify.event expiresAt |
The ring's expiresAt (45 s after start, 15) |
§5.1 |
Ring-ended notify.event expiresAt |
ts + 60 s |
§5.1 |
| Ring-end tombstone at the home server | 120 s | §6.3 |
| Latency targets (95th percentile) | Trigger → notify.event handed to S2S: 1 s; notify.event accepted → push handed to gateway: 1 s |
§5.5, §6.4 |
| Records per account | 1,000 | §8.4 |
| Record retention | unread: 30 days; others: 7 days after the last change |
§8.4 |
ids per read request |
1–100 | §8.3 |
| Badge cap | 9,999 | §15.1 |
| Community settings entries | ≤ 1,000 per account | §7.2 |
| Context settings entries | ≤ 10,000 per account | §7.3 |
muteUntil |
≤ 366 days ahead | §7.2 |
maxPushRegistrationsPerDevice |
Default 4, floor 4 | §9.2 |
| Fetch token | ≥ 128 random bits, ≤ 64 characters; expires 60 days after issue, or earlier on rotation or when the registration ends | §9.3 |
| Push re-registration and fetch-token rotation | At least every 30 days | §9.4 |
| Registration failure limit | 3 consecutive rejected, or 7 days failing |
§9.4 |
| Test pushes | ≤ 5 per registration per hour; client waits 30 s | §9.2 |
| Push payload | Exactly 93 octets | §10.1 |
| Push key | 1–1,024 characters; gateway keeps retired keys ≥ 90 days | §11.2 |
ttlMs |
alert 24 h; call until the ring expires (≥ 1 s); background 1 h; at most 24 h |
§10.3, §11.3 |
| Gateway batch | 1–100 pushes, ≤ 256 KiB; payload ≤ 256 octets | §11.3 |
sv-push+jwt |
Lifetime ≤ 60 s; ≤ 4,096 octets | §11.4 |
| Gateway rate floor | ≥ 60 pushes per minute per push key, bursts of 20; ≥ 10 registrations per minute per IP | §11.2, §11.5 |
| Home → gateway | ≤ 4 concurrent requests per gateway; batch wait ≤ 50 ms; retry back-off min(2^(n−1), 300) s ± 20 % until ttlMs; connect 10 s, exchange 30 s |
§11.7 |
| VAPID JWT | exp ≤ 12 h ahead; old VAPID key kept ≤ 90 days |
§12.2, §12.4 |
| Background push coalescing | ≤ 1 per registration per 30 s | §15.2 |
| Read sync from clients | ≤ 1 per context per 2 s, plus one on leaving | §15.2 |
| Device budgets | iOS NSE 20 s; Android 8 s; web 10 s; 5 s per request; handled-ID memory 7 days; at most 10 extra record fetches in step D5 | §13 |
19. Registry additions
- JWS
typ(04 §6.3):sv-push+jwt. Object: push gateway request token. Signer class: Server (home server key, purposesign). Issuer claim matched tokid:iss.exp: Required. Maximum lifetime: 60 s. Maximum size: 4,096 bytes (this document's limit; at most 04's 8,192). Owner: 19. 04 §6.3 item 4 says a new type is added by a revision of 04; this entry asks for that revision. - HMAC label (04 §8.4):
sv1 push collapse. Primitive: HMAC. Input key:K_coll, a 32-byte random per-registration secret held by the home server. Message:"sv1 push collapse" || 0x00 || opaque(topic). Output: 32 bytes, truncated to 16 (04 §8.2 allows truncation to 16). Use: push collapse keys (§10.3). Owner: 19. Vectors: §20.1. - ServerMetadata
limits(02, 03 §16):maxPushRegistrationsPerDevice, default 4, floor 4. - ServerMetadata
endpoints.push(02): semantics ofgatewayPolicy,gatewaysandwebPushKeyas used in §9.2, §11 and §12. Server software defaultsgatewayPolicytoany(§11.1, D-093). No new members. - Authorization credentials (03 §3.1): two further opaque
Bearercredentials, listed in 03 §3.1. (1) Fetch token: issued by the account's home server with a push registration (§9.3); accepted only onGET /v1/me/notifications/{id}andPOST /v1/me/notifications/read(idsselector) at that home server; misuse gives 403core.forbidden, an invalid token 401core.unauthenticated. (2) Event ticket: issued by a hosting server insidenotify.event(§4.7); accepted only onGET /v1/me/notifications/eventsat that server; every failure gives 401notify.ticket_invalid. Neither is a session token; neither is refreshed; both obey 03 §3.2 rules 1, 3, 5 and 7. - Event types (03 §11): §16.1 and §16.2.
- Error codes (03 §10.4): §17.
- S2S event
notify.event(06 §10.1): the catalogue entry already exists; this document fills inexpiresAt(§5.1). - Notification kinds (owned here): §5.3. Kinds used by other documents:
dm_request,dm_message,call_ring(12);call_ring,call_ring_ended(15);pairing_request(08);account_alert(07 §15.2). - Gateway paths:
{gatewayUrl}/v1/registerand{gatewayUrl}/v1/push. 00 §7.3 lists{gatewayUrl}/v1/push; this entry asks the lead to list{gatewayUrl}/v1/…there, since only this document defines the gateway base URL. - Home-server paths (00 §7.3):
/v1/me/notifications/settings…and/v1/me/notifications/eventsare under this document's/v1/me/notifications…prefix./v1/me/notifications/eventsis served in the hosting role, for remote accounts, authenticated by an event ticket; this entry asks the lead to note that in 00 §7.3. - 00 Matrix G: this entry asks the lead to add to Matrix G that a home server that is a secure server discards insecure previews on receipt (rule H6, SM-10).
20. Test vectors
20.1 Collapse keys
K_coll (hex): 000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
| Vector | topic (UTF-8) |
HMAC message (hex) | HMAC-SHA256 output (hex) | collapseKey |
|---|---|---|---|---|
| 19-collapse-1 | call:01a2424b-6f00-7a10-8b20-3c4d5e6f7081 |
737631207075736820636f6c6c61707365002963616c6c3a30316132343234622d366630302d376131302d386232302d336334643565366637303831 |
c6962656f948cec9e3ef749d9fa259088a10fab91760c87b51cd854fb5de9875 |
xpYmVvlIzsnj73Sdn6JZCA |
| 19-collapse-2 | rec:01a2424b-7a3c-7d1e-9f00-1b2c3d4e5f60 |
737631207075736820636f6c6c6170736500287265633a30316132343234622d376133632d376431652d396630302d316232633364346535663630 |
40c09823954982d5d97e2e1a025c52bfdf51172c1522c8165a74d12efe32429d |
QMCYI5VJgtXZfi4aAlxSvw |
The message is the label, a zero byte, the one-byte length prefix (0x29 = 41 and 0x28 = 40), and the topic. Status: final (computed with Python cryptography 50 and the standard library hmac).
20.2 Push payload
Record h = 01a2424b-7a3c-7d1e-9f00-1b2c3d4e5f60, registration r = 01a24190-0c4e-7b8a-9d10-2e3f4a5b6c7d. The payload is exactly these 93 octets:
{"v":1,"h":"01a2424b-7a3c-7d1e-9f00-1b2c3d4e5f60","r":"01a24190-0c4e-7b8a-9d10-2e3f4a5b6c7d"}APNs body for an alert push with loc-key SV_NOTIFICATION:
{"aps":{"alert":{"loc-key":"SV_NOTIFICATION"},"mutable-content":1,"sound":"default"},"sv":{"v":1,"h":"01a2424b-7a3c-7d1e-9f00-1b2c3d4e5f60","r":"01a24190-0c4e-7b8a-9d10-2e3f4a5b6c7d"}}FCM HTTP v1 message for the same push (TTL 86,400 s):
{"message":{"token":"<FCM registration token>","data":{"sv":"{\"v\":1,\"h\":\"01a2424b-7a3c-7d1e-9f00-1b2c3d4e5f60\",\"r\":\"01a24190-0c4e-7b8a-9d10-2e3f4a5b6c7d\"}"},"android":{"priority":"HIGH","ttl":"86400s"}}}20.3 sv-push+jwt
Signer: the server key a.com#2026-12a of 06 §18.1 (RFC 8032 TEST 3 seed c5aa8df43f9f837bedb7442f31dcb7b166d38535076f094b85ce3a2e0b4458f7, public key fc51cd8e6218a1a38da47ed00230f0580816ed13ba3303ac5deb911548908025). Gateway base URL https://push.example.net/gw. iat = 1796408400 (2026-12-04T18:20:00Z).
Request: POST https://push.example.net/gw/v1/push. Body (232 octets, exactly as sent):
{"pushes":[{"pushKey":"pk1.AQ3vTq0b9Xc2mW8yLr5uZp1sKd4fHg7jNe6aBt0iVo2xQyRw","type":"alert","payload":{"v":1,"h":"01a2424b-7a3c-7d1e-9f00-1b2c3d4e5f60","r":"01a24190-0c4e-7b8a-9d10-2e3f4a5b6c7d"},"ttlMs":86400000,"urgency":"high"}]}bh = ASIAG67nKj2OLs5j85nfEpPVxyO029YjTqps8ZOYWoI
Header: {"alg":"EdDSA","typ":"sv-push+jwt","kid":"a.com#2026-12a"}
Payload: {"iss":"a.com","aud":"https://push.example.net/gw","htm":"POST","htu":"https://push.example.net/gw/v1/push","bh":"ASIAG67nKj2OLs5j85nfEpPVxyO029YjTqps8ZOYWoI","iat":1796408400,"exp":1796408460,"jti":"Wn4rT8yC1qL6vB0xK3mZ7g"}
Compact JWS:
eyJhbGciOiJFZERTQSIsInR5cCI6InN2LXB1c2grand0Iiwia2lkIjoiYS5jb20jMjAyNi0xMmEifQ.eyJpc3MiOiJhLmNvbSIsImF1ZCI6Imh0dHBzOi8vcHVzaC5leGFtcGxlLm5ldC9ndyIsImh0bSI6IlBPU1QiLCJodHUiOiJodHRwczovL3B1c2guZXhhbXBsZS5uZXQvZ3cvdjEvcHVzaCIsImJoIjoiQVNJQUc2N25LajJPTHM1ajg1bmZFcFBWeHlPMDI5WWpUcXBzOFpPWVdvSSIsImlhdCI6MTc5NjQwODQwMCwiZXhwIjoxNzk2NDA4NDYwLCJqdGkiOiJXbjRyVDh5QzFxTDZ2QjB4SzNtWjdnIn0.XTek08_sr41RHT1ciofAsuuD54FFDrfMiG9IQIOttUcDK3sEK9uFoHCENI8IIVEs9rF_P0KF92MQ1_ZiK1EtDgRoot-path gateway. The same signer, body and times, for a gateway whose base URL is https://push.example.net (registration gatewayUrl, no trailing slash). Request: POST https://push.example.net/v1/push. aud = normalize("https://push.example.net") = https://push.example.net/; htu = normalize("https://push.example.net" + "/v1/push") = https://push.example.net/v1/push (not …net//v1/push).
Payload: {"iss":"a.com","aud":"https://push.example.net/","htm":"POST","htu":"https://push.example.net/v1/push","bh":"ASIAG67nKj2OLs5j85nfEpPVxyO029YjTqps8ZOYWoI","iat":1796408400,"exp":1796408460,"jti":"Hq7sP2dX9vL0mC4nB8kR1w"}
Compact JWS:
eyJhbGciOiJFZERTQSIsInR5cCI6InN2LXB1c2grand0Iiwia2lkIjoiYS5jb20jMjAyNi0xMmEifQ.eyJpc3MiOiJhLmNvbSIsImF1ZCI6Imh0dHBzOi8vcHVzaC5leGFtcGxlLm5ldC8iLCJodG0iOiJQT1NUIiwiaHR1IjoiaHR0cHM6Ly9wdXNoLmV4YW1wbGUubmV0L3YxL3B1c2giLCJiaCI6IkFTSUFHNjduS2oyT0xzNWo4NW5mRXBQVnh5TzAyOVlqVHFwczhaT1lXb0kiLCJpYXQiOjE3OTY0MDg0MDAsImV4cCI6MTc5NjQwODQ2MCwianRpIjoiSHE3c1AyZFg5dkwwbUM0bkI4a1IxdyJ9.Io3z2VITqTBmGno9XrLGxrlT1u3qjDhOesxA8gGyl_ixoLY8gRfy1sDWCAd9HMz2vnx_ZUJYD4LLUpWrFaHiDQBoth vectors: status final (computed with Python cryptography 50; the first was re-verified).
Reject variants for gateway implementers (expected code push.unauthenticated with the reason shown): the same JWS presented with typ sv-s2s+jwt in a re-signed header (typ); presented to https://push.example.net/gw2/v1/push (audience); with one body octet changed (body_hash); verified at now = 1796408521 (expired); presented twice (replayed).
20.4 Settings evaluation
Global settings are the defaults of §7.1 unless stated. "ctx" and "community" are the per-context and per-community settings for the event's host and context.
| # | Event | Settings | Outcome | Rule |
|---|---|---|---|---|
| S1 | mention, channel |
Defaults | notify |
H9 |
| S2 | dm_message, 1:1 DM |
Defaults | notify |
H9 |
| S3 | mention, channel |
community level: "nothing" |
drop |
H3 |
| S4 | mention, channel |
community level: "nothing", ctx level: "mentions" |
notify |
ctx wins (H9) |
| S5 | mention_all, channel |
global everyone: false |
drop |
H4 |
| S6 | mention_all, channel |
global everyone: false, ctx everyone: true |
notify |
H9 |
| S7 | dm_message, group DM |
ctx level: "mentions" |
drop |
H4 |
| S8 | call_ring, 1:1 DM |
ctx muteUntil in the future |
silent |
H2 |
| S9 | call_ring, 1:1 DM |
global calls: false, ctx calls: true |
notify |
H9 |
| S10 | mention, channel |
presence dnd at the home server |
silent |
H8 |
| S11 | mention, insecure channel, preview present |
home server is a secure server | notify, preview discarded |
H6, H9 |
| S12 | dm_message, insecure DM, preview present |
global previews: "sender_only" |
notify, preview discarded |
H7, H9 |
| S13 | Aggregate mention with items [dm_message, mention], group DM |
ctx level: "mentions" |
notify with only the mention item, count 1 |
H4 per item |
| S14 | mention, channel |
global enabled: false |
drop |
H1 |
| S15 | Aggregate mention with items mention_all by Dave, then mention by Carol; channel |
global everyone: false |
notify with only Carol's mention item, count 1, otherSenders 0 |
H4 per item, recomputed |
| S16 | account_alert code W4a |
presence dnd, global enabled: false |
notify |
§6.5 (ignores H1 to H5 and, for W4a, H8) |
20.5 Coalescing trace
Recipient alice@a.com, no attentive session at b.com unless stated; context ch:…eeff; window 30 s.
| Time (s) | Event | Window state after | Sent |
|---|---|---|---|
| 0.0 | Mention by Carol, seq 91 |
open, deadline 30.0, pending [] |
notify.event items [91], count 1 |
| 4.2 | Mention by Dave, seq 93 |
pending [93] | — |
| 11.0 | Carol replies to Alice with ping: true, seq 96 (kind reply) |
pending [93, 96] | — |
| 30.0 | Deadline | open, deadline 60.0, pending [] |
notify.event kind mention (priority), items [93, 96], count 2, sender Carol (latest), otherSenders 1 |
| 41.0 | Mention by Carol, seq 99 |
pending [99] | — |
| 45.0 | Alice opens the app on her desktop (attentive session) and reads to seq 99 |
pending [99] | — |
| 60.0 | Deadline: attentive session present | idle |
Nothing (pending discarded) |
| 75.0 | Mention by Dave, seq 104, Alice still attentive |
open, deadline 105.0, pending [104] |
notify.triggered only |
| 105.0 | Deadline: Alice still attentive | idle |
Nothing (pending discarded) |
20.6 Web Push encryption
The Web Push body is RFC 8291 encryption of the 93-octet payload of §20.2. Implementations MUST first pass RFC 8291 Appendix A. A vector with this document's payload, with inputs: user-agent private key scalar 0x01 repeated to 32 octets on P-256; auth = 000102030405060708090a0b0c0d0e0f; application-server ephemeral private scalar 0x02 repeated to 32 octets; salt = 101112131415161718191a1b1c1d1e1f; record size 4,096. Expected output: TBD (196 octets; status tbd until computed with two independent implementations).
21. Security considerations
Push metadata. Push services (APNs, FCM, Web Push services) and gateways learn that an installation receives a wake-up, when, and of which push type. A call push reveals that a call is ringing, and its timing may be correlated with a call that a hosting server sees. They learn nothing else: the payload is the same fixed 93 octets for every kind and mode (§10.1), carries random-looking IDs only, and in Web Push is encrypted end to end to the browser. Generic alert text (loc-key) means even a failed extension shows nothing sensitive. Collapse keys are keyed hashes with a per-registration secret (§10.3). A party that sees both a hosting server's traffic and a push service's traffic can still correlate timing; this is inherent to push and is listed in 22. h and r are UUIDv7s (00 §7.6), so they reveal when the record and the registration were created; the first is about the push time, which the observer already knows, and the second adds little to the stable push key and platform token, which already link the pushes of one registration.
Gateway trust. A gateway can drop, delay or replay pushes, and its operator learns which home servers serve which of its app installations, and how often. It can't read content, forge records or change what a device displays: the device fetches every record from its home server with its own credential, so a forged or replayed h yields a 404 or an already-handled record (§13.1 D3, D4). A malicious gateway can deny notifications to its users; the app still works when opened. Push keys bind each registration to one home server (§11.2), so one home server can't reuse a push key issued for another, and home servers never hold raw platform tokens, which prevents cross-account linking by device token. Push keys do not protect a leaked platform token: /v1/register is unauthenticated, so whoever holds the token can register it for a server of their own and wake the device. The only protection is that the app keeps its platform tokens secret (§11.2), optionally helped by app attestation at the gateway. Such a forged push carries an unknown r, which the device suppresses where the platform allows (§13.1 D2); on iOS a forged call push briefly reports and ends a CallKit call (§13.3), because iOS requires every VoIP push to report one. The official gateway (D-093) serves every installation of the official apps, and servers deliver to it by default (gatewayPolicy any), so its operator, the project, learns this metadata for official-app installations across the federation: which home servers wake which installations, when, and with which push type, and nothing more. Its source is published (§11.1), but users still rely on the project to run it as published. An operator who doesn't want its users' wake-ups to pass through it can set listed without it, which leaves those users' official apps without background notifications; people who want to avoid it entirely can use an app build with its own gateway, the web client (Web Push, §12), or, where the app supports it, UnifiedPush (§12.6).
Home server. The home server sees which remote contexts notify its user, the senders, context names and timing, and the preview in insecure contexts. That is consistent with 00 §5.2: the home server already asserts its users everywhere. With an event ticket it could fetch the ciphertext of notified secure events; it can't decrypt them (SM-6). A home server that is a secure server never stores insecure previews (rule H6, SM-10).
Hosting server. A hosting server sees which of its users' events cause notifications to which home servers, and whether a recipient is attentive. It never sees settings, records, registrations or tokens (D-051). A malicious hosting server can send false or excessive notify.events; the legitimacy filter (§6.1) limits this to contexts where the user has a relationship with it, the rate cap and window (§4.5) bound honest servers, and the user's mute (§7) silences it entirely. It can lie in ctxName or sender.name; clients apply the display-name check to the sender and, for channels, to ctxName against ctxAddr (01, D-031, §13.1 D10), and show the sender's domain when it differs from the context's. It can also claim that a secure context is insecure, attach a preview, or serve plaintext content through the ticket endpoint; a device that has pinned the context as secure, or knows the DM as secure, ignores all of that (§13.1 D6a, D-056), so the hosting server can't put forged plaintext on the lock screen of a secure context. In a secure context it can't change who a decrypted message appears to come from: the displayed sender is the one whose key verified the SealedMessage (§13.1 D8).
Mention hints. In secure contexts the hosting server notifies on the cleartext mention hint (D-063), which a sender can falsify. A device that decrypts the message suppresses a notification the content doesn't support (§13.1 D9). Where it can't decrypt, the user may see a "mentioned you" fallback for a message that didn't mention them; that is a nuisance, not a disclosure.
Previews and the lock screen. Previews in insecure contexts are plaintext at the hosting server and the home server anyway. Decrypted secure content appears on the lock screen only on the user's own device and only with previews: "full". Users who share or lose their phone rely on the operating system's lock-screen settings and on previews (§7.1).
Event tickets and fetch tokens. Both are bearer credentials outside the normal session model. A ticket reads only the events it names, only while the recipient still has access, for 72 h, and gives ciphertext in secure contexts. It identifies the account, not a device, which is the bounded exception to SM-4 recorded in 00 §4.2 SM-4 (PD-19-16); the home server limits it by handing secure-context tickets only to enrolled devices. A fetch token reads and marks notification records only, but those records include insecure previews and event tickets, so a stolen fetch token reads the notified events too: insecure content in full, secure ciphertext only. It is rotated at least every 30 days and expires after 60 (§9.3), which bounds the exposure. Neither credential appears in URLs (03 §3.2). Servers store only hashes. A leaked extension store therefore exposes notification records, the notified insecure messages, and the history keys of recent epochs (the notification key subset), which together decrypt the notified secure messages of those epochs. That is the accepted cost of showing messages on the lock screen; 08 governs the subset's protection, and shared-computer browsers never register for push (§9.2).
The notification key subset. It holds K_hist of recent epochs in storage readable by a less isolated process. Anyone who extracts it can read the messages of those epochs, as anyone holding a member's device could. It contains no signing key, so it can't be used to send messages or to impersonate the user, and no MLS state, so it gives no access to future epochs.
Server-side request forgery. Gateway URLs and Web Push endpoints are chosen by clients. Home servers restrict them to https, public unicast addresses, no redirects and bounded timeouts, re-checked at every connection (§9.2, §11.7, §12.3), and MAY restrict gateways by policy (listed).
Denial of service. A burst of mentions to many users fans out as notify.events; 06's batching and lanes keep revocations (high lane) unaffected, and rings use the high lane without being delayed by message notifications. Gateways rate-limit per push key and per home server; home servers rate-limit settings and test endpoints.
No warnings. Notifications never carry security warnings (D-055, 20 §2.1 rule 2). A self-alert that must reach the user's phone uses an account_alert record whose notification text is neutral and only asks the user to open the app (§13.7, PD-19-15); the app then shows the W4 surface of 20. For W4a it ignores do-not-disturb (§6.5), because D-071's accepted risk relies on the victim learning of a reset at once.
22. Open questions
- "All messages" for channels. v1 offers channels only "Only @mentions" and "Nothing" (PD-19-11), because 11 has no per-message trigger for channels and settings live only at the home server. Supporting "All messages" would need hosting servers to send a
notifyfor every message to every opted-in member, which means telling hosting servers about that setting. Recommendation: keep v1 as specified. If users ask for it, add a per-channel opt-in kept at the hosting server (anotifysubscription), used only for small channels, in a later minor version. - Do-not-disturb and calls. PD-19-12 makes calls silent during
dnd, recording them as missed. Some people expect DM calls to break through do-not-disturb. Recommendation: keep calls silent indndfor v1, because operating-system focus modes already offer per-person exceptions, and one rule is easier to explain.
23. References
23.1 Normative
- RFC 2119, RFC 8174 — requirement key words
- RFC 3339 — timestamps; RFC 3986 — URIs; RFC 4648 — base64url; RFC 5234 and RFC 7405 — ABNF and case-sensitive strings
- RFC 8259 — JSON; RFC 7493 — I-JSON; RFC 9562 — UUIDs (UUIDv7); RFC 9457 — problem details; RFC 9110 — HTTP semantics
- RFC 7515 — JWS; RFC 7519 — JWT; RFC 8037 — EdDSA in JOSE; RFC 8032 — Ed25519; RFC 2104 — HMAC; RFC 6234 — SHA-256
- RFC 8030 — Generic Event Delivery Using HTTP Push (Web Push); RFC 8291 — Message Encryption for Web Push; RFC 8188 — Encrypted Content-Encoding for HTTP; RFC 8292 — VAPID; RFC 7518 — ES256
- RFC 9420 — MLS (variable-length integers for
opaque<V>) - W3C Push API; W3C Notifications API; W3C Service Workers; W3C Badging API
- Apple Push Notification service: Sending notification requests to APNs; UserNotifications framework (
UNNotificationServiceExtension); PushKit and CallKit (Apple Developer documentation) - Firebase Cloud Messaging HTTP v1 API (Google documentation)
- Sloppy Voice documents: 00 (overview and conventions), 01 (addresses, display-name check), 02 (discovery, ServerMetadata
endpoints.push, key continuity), 03 (transport, foreground sessions, events, errors), 04 (JWS profile, labels, Ed25519 rules), 05 (devices, revocation, account deletion), 06 (S2S requests, event delivery, audiences), 08 (notification key subset, platform key storage, pairing), 11 (triggers, mention hints, read state, presence), 12 (DM index, requests, DM calls), 14 (SealedMessage, notification extension), 15 (ringing)
23.2 Informative
- UnifiedPush specification (Web Push–compatible distributors for Android)
- Apple, "Handling notifications and notification-related actions"; "Responding to VoIP Notifications from PushKit"; the
com.apple.developer.usernotifications.filteringentitlement - Android developer documentation: FCM message priority, Doze and App Standby, notification runtime permission, full-screen intents
- RFC 9420 §16 — MLS security considerations (forward secrecy and stored keys)
- Sloppy Voice documents 09 (community list), 10 (
mention_everyone, anti-spam rule for requests), 20 (copy for notifications, incoming calls and settings), 21 (operations and monitoring), 22 (threat model) spec/DECISIONS.md— decision log