Protocol guide
Federation and remote sessions
How a client opens, renews and extends sessions at servers other than its home server, and how servers authenticate requests, deliver events, fan out revocations and apply blocks.
Specification: 06 Federation
Sloppy Voice federates like e-mail, but a client talks directly to every server whose communities, channels or DMs it uses (06 §1.1). The home server is never in the chat or media path of a remote context. It does two jobs for its users: it vouches for them to other servers, once per remote server per hour per device, and it tells other servers when a device or account is revoked (06 §2.1).
This page has two halves:
- Client side (every client that uses a server other than its home server): getting a HomeAssertion, signing a DeviceProof, opening, renewing, extending and ending remote sessions, and handling their errors.
- Server side (server implementers): S2S request tokens, event delivery, audience tracking and revocation fan-out, federation blocks and outage behaviour.
Server implementers need both halves, because the hosting server is the verifier of everything in the first half.
The pieces
| Mechanism | Lifetime | Single use | Bound to |
|---|---|---|---|
HomeAssertion (sv-assert+jwt) |
≤ 300 s | Yes, at the audience | One account, one device, one remote server |
DeviceProof (sv-devproof+jwt) |
≤ 60 s | Yes | The assertion's jti, the audience, the device signing key (DSK) |
| Remote session | 1 h, renewable; extendable to 24 h after the last verification while the home server is unreachable | — | One account and device at one remote server |
S2S request token (sv-s2s+jwt) |
≤ 60 s | Yes, at the destination | Method, target URI, body hash, destination |
| S2S event | Retried for 24 h | Deduplicated by ID | Origin and destination |
(06 §2.2)
The assertions are short and single use so that a leaked one is worth at most one session at one server. Enrolled devices of secure accounts add a DeviceProof so that a copied assertion alone can't open a session with secure access.
A typical first contact between alice@a.com and b.com looks like this:
CLIENT alice@a.com
(1) POST {a.com}/v1/federation/assertions {aud: "b.com"} home session
<- HomeAssertion (+ IdentityState)
(2) sign DeviceProof with the DSK (enrolled devices only)
(3) POST {b.com}/v1/federation/sessions {assertion, deviceProof, deviceCertificate, identityState}
<- RemoteSession {token, expiresAt}
(4) HTTPS commands and the event WebSocket at b.com use the remote session tokenAll federation JWS objects use NumericDate seconds for iat and exp and allow ±60 s of clock skew. A verifier rejects an object whose iat is more than 60 s in the future, whose exp is 60 s or more in the past, or whose lifetime exceeds its maximum; any nbf claim is rejected (06 §3.3). Servers should keep their clocks within 1 s of NTP time, because a server with a wrong clock fails to verify its peers and fails to be verified by them.
Opening a remote session
Resolve the server first
Resolve the remote domain yourself and learn its canonical domain before you ask for an assertion (06 §6.10 rule 2). Native clients run the resolution procedure of Discovery; web clients go through {home}/v1/resolve (GET /v1/resolve) or DNS-over-HTTPS.
Create a session lazily: when the user first opens a context there, follows a link, joins a call or subscribes on the WebSocket. You may create sessions at start-up for servers on the user's community list and for the hosting servers of DM index entries in state active. Don't contact the hosting server of a message request the user hasn't accepted, or of a declined or blocked entry, because contacting it would tell that server the user saw the request (06 §6.10 rule 1). Keep at most one creation request in flight per remote server.
Get a HomeAssertion
Ask your home server for an assertion with POST /v1/federation/assertions. Only a home session (Authorization: Bearer <home access token>) or a bot token (Authorization: Bot <bot token>) can call it (06 §4.1).
POST /sv/v1/federation/assertions HTTP/1.1
Host: a.com
Authorization: Bearer <home access token>
Content-Type: application/json
{ "aud": "b.com" }aud is 1–253 octets. Send the canonical domain you resolved; the home server also accepts an alias, a U-label or mixed case and converts it. The response:
{
"assertion": "eyJhbGciOiJFZERTQSIsInR5cCI6InN2LWFzc2VydCtqd3QiLCJraWQiOiJhLmNvbSMyMDI2LTEyYSJ9.eyJpc3MiOiJhLmNvbSIs…",
"aud": "b.com",
"expiresAt": "2026-12-04T18:25:00.000Z",
"identityState": "eyJhbGciOiJFZERTQSIsInR5cCI6InN2LWlkc3RhdGUrand0Iiwia2lkIjoiYS5jb20jMjAyNi0xMmEifQ.eyJpc3MiOiJhLmNvbSIs…"
}identityState is the account's current IdentityState. It is always present when the assertion's sec is secure and should be present otherwise.
Check aud. If the response's aud differs from the canonical domain you resolved, don't present the assertion. Re-resolve once, and if the two still differ, treat the server as unreachable (06 §6.10 rule 2).
Note
POST /v1/federation/assertions and POST /v1/federation/sessions ignore Idempotency-Key and never store responses, because a replayed response would hand out a single-use assertion twice or keep a session token in clear (06 §4.1). Retrying is safe anyway: each retry gets a fresh assertion.
The errors you can get from the home server (06 §4.1):
| Condition | Status and code |
|---|---|
| Missing or invalid home session or bot token | 401 core.unauthenticated |
| A remote session token issued by this server | 403 auth.home_session_required |
Account in upgrade_required |
403 security.upgrade_required |
| Account suspended (including a server-scope ban, or a bot whose owner is suspended) | 403 account.suspended |
aud malformed |
400 core.invalid_request |
aud names the home server itself |
400 federation.audience_is_home |
aud can't be resolved, or isn't served by the server it resolves to |
The discovery.* code of the failure, for example 404 discovery.domain_not_served |
| Peer blocked by the home server's policy | 403 federation.blocked |
| Peer suspended | 503 discovery.peer_suspended |
| Rate limit | 429 core.rate_limited |
A home server allows each device of a user account at least 120 assertions per hour with bursts of at least 30; a client that opens twenty communities at start-up and renews each hourly needs about twenty an hour. Bots are limited per bot account, 120 per hour by default (06 §4.6).
What is inside the assertion
You don't parse the assertion to use it, but you need its jti, enr, dkf and aud to sign a DeviceProof, and the claims explain most verification errors. Decoded header and payload for an enrolled device (test vector TV-1, 06 §4.4):
{ "alg": "EdDSA", "typ": "sv-assert+jwt", "kid": "a.com#2026-12a" }
{
"iss": "a.com",
"sub": "alice@a.com",
"aud": "b.com",
"iat": 1796408400,
"exp": 1796408700,
"jti": "Kc1o2Q8bTzR3fLw9yH0aVg",
"kind": "user",
"inc": "sLGys7S1tre4ubq7vL2-vw",
"sec": "secure",
"did": "q2bS9xVg3m0yJpQe1vT0Aw",
"enr": true,
"isv": 17,
"igen": 1,
"ikf": "kPrK_qmxVWaYVA9wwBF6Iuo3vVzz7TxHCTwXBygrS4k",
"dkf": "FtIu-VbGrfe_KB6CH7GNwODB72MNxj_ml11dEvO-7kk"
}| Claim | Meaning |
|---|---|
iss |
The home server's canonical domain. |
sub |
The account's canonical address; its domain must equal iss. |
aud |
The remote server's canonical domain; never equal to iss. |
jti |
At least 16 random bytes, base64url, 22–86 characters. Single use at the audience. |
kind |
user or bot, so the remote server can show the bot badge without a lookup. |
inc |
The account's incarnation, 16 bytes (22 base64url characters). A reused address gets a new inc. |
sec |
insecure or secure. |
did |
The device ID, 22 base64url characters. |
enr |
true when this is an enrolled device of a secure account. Always false when sec is insecure. |
isv |
The ver of the IdentityState the claims came from, so the remote server can tell when the IdentityState you relayed is stale. |
igen, ikf, dkf |
Identity generation, identity-key thumbprint and DSK thumbprint. Present exactly when enr is true. |
name |
Optional display name, 1–128 octets, to save a profile lookup. |
(06 §4.3) The home server derives sec, enr, igen, ikf, dkf, isv and inc from the account's current IdentityState, not from the device record, so the assertion always agrees with what the remote server will check (06 §4.2). An insecure account's assertion (TV-3) has no igen, ikf or dkf:
{
"iss": "a.com", "sub": "bob@a.com", "aud": "sloppyvoice.com",
"iat": 1796408400, "exp": 1796408700, "jti": "m3VQd0c8Hn1xT6pZr2yLkA",
"kind": "user", "inc": "wMHCw8TFxsfIycrLzM3Ozw", "sec": "insecure", "did": "Tq9wE1rY5uI3oP7aS2dF4g", "enr": false, "isv": 3
}See HomeAssertion for the full claim table and grammar.
Sign a DeviceProof
Secure contexts only
Only when the assertion has enr: true. For any other assertion, send no DeviceProof.
Sign a DeviceProof immediately before the session request, with the DSK whose thumbprint is the assertion's dkf (06 §5.3):
{ "alg": "EdDSA", "typ": "sv-devproof+jwt", "kid": "FtIu-VbGrfe_KB6CH7GNwODB72MNxj_ml11dEvO-7kk" }
{ "aud": "b.com", "ajti": "Kc1o2Q8bTzR3fLw9yH0aVg", "iat": 1796408401, "exp": 1796408461 }kidis the DSK thumbprint (dkf).audequals the assertion'saud.ajtiis the assertion'sjti. Binding to the assertion'sjtiinstead of a server nonce saves a round trip, and thejtiis already single use and unpredictable.expisiat + 60. The whole object must fit in 1,024 octets.
Never sign a DeviceProof for an assertion you didn't request yourself, or whose aud differs from the canonical domain you resolved. A retry with a new assertion needs a new DeviceProof. On the web the DSK stays inside the key Worker, which signs the DeviceProof's signing input (06 §5.3; see Client requirements).
Create the session
Send POST /v1/federation/sessions to the remote server, without an Authorization header. The assertion in the body authenticates the request (06 §6.1).
POST /server/v1/federation/sessions HTTP/1.1
Host: chat.b.com
Content-Type: application/json
{
"assertion": "eyJhbGciOiJFZERTQSIsInR5cCI6InN2LWFzc2VydCtqd3QiLCJraWQiOiJhLmNvbSMyMDI2LTEyYSJ9.eyJpc3Mi…",
"deviceProof": "eyJhbGciOiJFZERTQSIsInR5cCI6InN2LWRldnByb29mK2p3dCIsImtpZCI6IkZ0SXUtVmJH…",
"deviceCertificate": "eyJhbGciOiJFZERTQSIs…",
"identityState": "eyJhbGciOiJFZERTQSIsInR5cCI6InN2LWlkc3RhdGUrand0Iiwia2lkIjoiYS5jb20jMjAyNi0xMmEifQ.eyJpc3Mi…",
"client": "example-client/1.4.0"
}| Member | When |
|---|---|
assertion |
Always. |
deviceProof |
When the assertion has enr: true; absent otherwise. |
deviceCertificate |
When the assertion has enr: true. The IdentityState lists only the DSK thumbprint, so the server needs the DeviceCertificate to get the key itself. |
identityState |
Recommended whenever sec is secure; it saves the server a fetch. |
client |
Optional client software identifier, 1–128 printable ASCII characters. |
The body must not exceed 64 KiB: a larger body gets 413 core.too_large, and a malformed one or one missing a required member gets 400 core.invalid_request (06 §6.1). An enrolled device sends the request within the DeviceProof's 60 s (06 §6.10 rule 3).
A new session answers 201 with a RemoteSession:
{
"sessionId": "0193a1f2-0c4d-7e5f-8a6b-7c8d9e0f1a2b",
"token": "rs_Q2hhdC5iLmNvbSBzZXNzaW9uIHRva2VuIGV4YW1wbGU",
"tokenType": "Bearer",
"state": "active",
"account": { "addr": "alice@a.com", "name": "Alice", "kind": "user", "inc": "sLGys7S1tre4ubq7vL2-vw", "security": "secure" },
"device": { "did": "q2bS9xVg3m0yJpQe1vT0Aw", "enrolled": true },
"secureAccess": "full",
"createdAt": "2026-12-04T18:20:01.204Z",
"verifiedAt": "2026-12-04T18:20:01.204Z",
"expiresAt": "2026-12-04T19:20:01.204Z",
"renewAfter": "2026-12-04T19:10:01.204Z",
"extendableUntil": "2026-12-05T18:20:01.204Z"
}| Member | Meaning |
|---|---|
sessionId |
UUIDv7, stable across renewals and extensions. |
token, tokenType |
Only in create and renew responses, never from GET. tokenType is always Bearer. |
state |
active or extended. Treat an unknown value as active. |
account.security, device.enrolled |
The server's current view; they decide which SM-4 doors you pass. |
secureAccess |
full, existing_only (extended session) or none. Treat an unknown value as none. |
expiresAt |
When the session ends unless renewed or extended: verifiedAt + 3,600 s after a create or renew, later after an extension. |
renewAfter |
expiresAt − 600 s. |
extendableUntil |
verifiedAt + 24 h, the latest expiresAt an extension can reach. |
(06 §6.2)
The remote server creates a session for every assertion that passes verification, whatever the account's security state. SM-4 is enforced per action, so an insecure user can still reach a secure channel's door, see gate card G1, and continue in the same session after upgrading (06 §6.1).
What the remote server checks
The remote server runs steps V1–V17 in order, after the Authorization check, and stops at the first failure (06 §6.3). The order tells you which check an error comes from. A failure is 401 federation.assertion_invalid with the listed data.reason unless the row names another code; for expired, not_yet_valid and lifetime the problem also carries data.serverTime, which shows clock skew (06 §16).
| Step | Check | Failure (data.reason, or the code) |
|---|---|---|
| V1 | JWS of at most 4,096 octets; header alg = EdDSA, typ = sv-assert+jwt, kid, and no other header member |
401 federation.assertion_invalid (malformed, alg, typ) |
| V2 | Required claims with the right types; known kind and sec; canonical base64url; inc is 16 octets |
claims |
| V3 | iss is a lowercase A-label; the kid domain equals iss |
kid |
| V4 | aud is this server's canonical domain |
400 address.non_canonical for an alias of this server, otherwise 401 federation.wrong_audience with data.expected |
| V5 | Times, maximum lifetime 300 s | expired, not_yet_valid, lifetime |
| V6 | sub is at iss and passes 01's canonical checks |
400 address.non_canonical (reason subject) |
| V7 | sec, enr, igen, ikf, dkf are consistent |
security_claims |
| V8 | deviceProof and deviceCertificate present when enr is true |
401 federation.device_proof_required |
| V9 | Resolve iss; its canonicalDomain equals iss. A suspended issuer continues with the keys in its pin only |
503 federation.issuer_unreachable if unresolvable; 400 address.non_canonical for an alias as iss |
| V10 | Get the key from the pinned key set and verify the signature | key_unknown, key_status, signature; 503 discovery.peer_suspended for a suspended issuer and a key outside the pin |
| V11 | The issuer isn't blocked, checked against the name iss and the resolved peer |
403 federation.blocked |
| V12 | Choose the IdentityState and check it against the assertion | 409 federation.identity_mismatch, 503 federation.issuer_unreachable or 503 discovery.peer_suspended |
| V13 | Verify the DeviceCertificate and DeviceProof | 401 federation.device_proof_invalid |
| V14 | No server-scope ban matches sub |
403 moderation.banned |
| V15 | (sub, did) not marked revoked, (sub, inc) not marked deleted, and for a suspended (sub, inc) an iat later than the mark's suspendedAt |
401 federation.session_ended, data.reason device_revoked, account_deleted or admin |
| V16 | Insert (iss, jti) into the replay cache |
401 federation.assertion_replayed |
| V17 | Create or renew the session, atomically with a final V15 check | — |
V1–V8 use only local data and run before any network activity, so junk never makes the server resolve a domain a stranger chose. The block check V11 comes after the signature so that only the blocked peer itself, never a third party forging its name, learns of the block. The replay insert V16 comes last, so an attacker holding a copied assertion who fails an earlier step can't burn the real client's jti.
Choosing the IdentityState (V12). The server takes the verified, unexpired IdentityState with the highest ver among the one you presented and the one it stored. If there is none, or its ver is below the assertion's isv, it fetches GET /v1/users/{local}/identity from the issuer with a 10 s timeout. A failed fetch fails an enrolled assertion with 503 federation.issuer_unreachable; an unenrolled one continues on the assertion's sec alone, because the same home server signs both (06 §6.3.1). While the issuer is suspended the server fetches nothing: an enrolled assertion that needs a fetch fails with 503 discovery.peer_suspended, and an unenrolled one continues. A presented IdentityState that fails verification is discarded, not fatal.
The checks against the IdentityState are that sec and inc match and, for an enrolled device, that igen, the identity-key thumbprint, kind and the device entry (did with the same dkf, not revoked) match. If a check fails against an IdentityState the server didn't fetch during this verification (the one you presented or the one it stored), it fetches once and checks again before answering 409 federation.identity_mismatch with data.reason sec, inc, igen, identity_key, kind or device (06 §6.3.2).
Note
The §16 error table lists the federation.identity_mismatch reasons without inc, but 06 §6.3.2, §17.4 and test vector TV-7 #17 all use it. Accept all six values.
Checking the device (V13). The DeviceCertificate must verify under the identity key, and its sub, did, igen and DSK thumbprint must match the assertion (data.reason device_certificate). The DeviceProof must have the right header (device_proof), a valid signature by that DSK (device_proof), aud and ajti matching (device_proof_binding), and valid times with a 60 s maximum lifetime (device_proof_expired) (06 §6.3.3).
Using and renewing the session
Using the token
The token is opaque; don't parse it. It holds at least 128 random bits, and servers should prefix it with rs_ so secret scanners recognize it (06 §6.4).
- Send
Authorization: Bearer <token>on every HTTPS command at that server. - Put it in
session.helloon the event WebSocket (Event WebSocket). - Never put it in a URL or a log. Store it like a home token, in the platform's secure storage (06 §6.10 rule 8).
Silent renewal
A session lasts 1 h from its last verification. Renew it at a random moment between expiresAt − 600 s and expiresAt − 300 s (06 §6.10 rule 4); the randomness keeps many clients from renewing at once.
- Get a new assertion from your home server, and a new DeviceProof if
enristrue. - Send
POST /v1/federation/sessionswith the same body shape as creation, plusAuthorization: Bearer <current token>. Send the header only while the current token is unexpired by your own clock; otherwise send a creation request without it (06 §6.1). - A renewal answers 200 with a new
tokenfor the samesessionId. The old token keeps working for 60 s so requests already in flight succeed (06 §6.4). - Send session.reauth with the new token on every WebSocket you have open at that server (03 §5.13). Sockets stay open across renewals; a socket's authentication deadline is the
expiresAtof the token last accepted on it.
If a renewal fails with 401 core.token_expired, federation.session_ended or core.unauthenticated, send the same body again at once without the header. The server checks the header before the assertion, so the assertion is still unused, and the DeviceProof is still good if you are within its 60 s (06 §6.1).
The assertion's sub, inc and did must equal the session's, or the renewal fails with 400 core.invalid_request (06 §6.1).
Note
The spec doesn't say whether the assertion's jti is already consumed when a renewal fails for a sub, inc or did mismatch (06 §6.1). Get a fresh assertion before trying again.
Renewal re-derives account.security, device.enrolled and secureAccess from the new assertion. A session's enrolled flag becomes true only through a create or renew that passes the DeviceProof check; events and fetches can only lower access, because raising access needs proof from the device itself (06 §7.2).
Secure contexts only
When the device becomes enrolled (pairing, recovery or turning on encryption), renew at every remote server at once, so that gate cards G1 and G2 resume the actions they interrupted (06 §6.10 rule 6; see Secure accounts).
Concurrent sessions, inspecting and signing out
A server keeps at most 4 live sessions per (account, did). A fifth ends the one with the oldest verifiedAt with reason replaced. One device normally holds one session per server; the allowance stops two browser tabs on one device from ending each other's sessions in a loop (06 §6.4). A server must allow at least 30 session creations and renewals per minute per account and 600 per minute per issuing domain, and may refuse more with 429 core.rate_limited (06 §6.9).
- GET /v1/federation/sessions/current returns the RemoteSession without
token. Use it after a restart to learnexpiresAtandstate. - DELETE /v1/federation/sessions/current ends the session with reason
signed_outand returns 204. Call it on every remote server when the user signs out of the device. You may also call it when the user leaves the last context they use there; ending a session doesn't change memberships.
Both fail with 401 core.token_expired for an expired token and 401 federation.session_ended for an ended one (06 §6.5).
When the home server is down
If you can't get an assertion because your home server is down, ask the remote server to extend the session. The remote server checks for itself that your home server is unreachable (06 §6.6).
From the client side (06 §6.10 rule 5):
- When the assertion request fails with a network error, a timeout or HTTP 5xx, retry every 60 s.
- Once fewer than 900 s remain on the session and at least two attempts at least 30 s apart have failed, call POST /v1/federation/sessions/current/extend.
- While the session is
extended, try your home server every 300 s (±30 s jitter) and renew as soon as an assertion is available.
POST /server/v1/federation/sessions/current/extend HTTP/1.1
Host: chat.b.com
Authorization: Bearer rs_Q2hhdC5iLmNvbSBzZXNzaW9uIHRva2VuIGV4YW1wbGU
Content-Type: application/json
{ "reason": "home_unreachable" }reason must be home_unreachable; any other value gets 400 core.invalid_request. The remote server then works through these steps in order:
| Situation | Answer |
|---|---|
| More than 900 s remain | 409 core.conflict with retryAfterMs set to the time until 900 s remain |
expiresAt already equals extendableUntil |
409 federation.extension_limit; the session stays valid until expiresAt |
| The home domain is suspended | 503 discovery.peer_suspended; suspension is a security event, not an outage, and never earns an extension |
| The probe reaches the home server | 409 federation.home_reachable |
| The probe shows the account deleted or the device no longer valid | The session ends with reason account_deleted or device_revoked; 401 federation.session_ended |
| Otherwise | 200 with the RemoteSession (no token; the token doesn't change), state = extended, expiresAt = min(now + 3,600 s, extendableUntil) |
Extensions are limited to one per session per 300 s; further requests fail with 429 core.rate_limited (06 §6.9). A granted extension also moves the authentication deadline of every socket of the session to the new expiresAt, so you don't need session.reauth.
The probe. The remote server sends GET {home base}/v1/users/{local}/identity for the session's account, with no Authorization header and a 10 s timeout, so the outcome depends only on the home server (06 §6.6). Probing the account's own IdentityState rather than /meta exercises the home server's API and also shows whether the device is still valid.
| Probe outcome | Classification |
|---|---|
| DNS failure, connection refused or reset, TLS failure, timeout | Unreachable |
| HTTP 500–599 | Unreachable |
| HTTP 429 | Reachable |
| HTTP 200 with a valid IdentityState | Reachable; if the session's enrolled device is no longer listed active with the same dkf and igen, the device is no longer valid |
HTTP 200 with an IdentityState that fails verification (after one unknown-kid refetch) |
Reachable, and the administrator is alerted |
| HTTP 410 with identity.account_deleted, or 404 with identity.not_found | The account is gone |
| Any other 4xx, or a 3xx | Unreachable, and logged; a bare 404 from a misrouted proxy is an outage, not a deletion |
| Anything else | Reachable |
An unreachable result may be reused for every session of that home domain for 60 s, which avoids a probe storm during an outage. A reachable result is never reused for another account.
Note
06 §6.6 step 5 ends a session whose device the probe shows as no longer valid with reason device_revoked, while §7.2 uses device_revoked only when revoked lists the device and identity_changed otherwise. Both reasons are retryable, so a client handles them the same way.
If the probe reaches the home server but your client can't, the extension is refused and the session ends after its hour; the user sees "Can't reach your server" (06 §20, OQ-06-2).
What an extended session can do
While a session is extended, nobody can confirm the account's current state, so the remote server keeps existing conversations working and refuses new secure admissions (06 §7.3):
| Action | Allowed while extended |
|---|---|
| Reading and posting in insecure contexts you are already a member of | Yes |
| Joining an insecure channel, or an insecure server's community | Yes |
| Reading and posting in a secure context where the device already has a leaf; committing pending server proposals; manual history shares; staying in a secure call | Yes |
| Anything that admits a new leaf or a new secure membership: external commits (including resync), being added by Welcome, joining a secure channel or a secure server's community, creating a secure DM | No: 503 federation.home_unreachable |
| Anything else that needs an IdentityState validated within the last 300 s that the server can't get | No: 503 federation.home_unreachable |
secureAccess is existing_only for an enrolled extended session and none otherwise.
When a session ends
A remote server ends a session for these triggers (06 §6.8):
| Trigger | reason |
Deadline | retry |
|---|---|---|---|
device.revoked accepted for the session's device |
device_revoked |
60 s | true |
identity.changed accepted and the device is no longer valid |
identity_changed |
60 s | true |
account.deleted accepted, or the probe got an explicit deletion answer |
account_deleted |
60 s | false |
A verified assertion or IdentityState shows a different inc |
account_deleted |
60 s | false |
account.suspended accepted |
admin |
60 s | true |
| The account's home domain becomes blocked | blocked |
60 s | false |
| The issuer key that verified the last assertion is revoked | key_revoked |
60 s | true |
| A moderation action of 10 that ends sessions | moderation |
As 10 specifies | As 10 specifies |
A fifth concurrent session for the same (account, did) |
replaced |
Immediately | false |
DELETE …/sessions/current |
signed_out |
Immediately | false |
| The administrator ends it | admin |
Immediately | true |
A session that runs out ends with expired, or extension_limit when an extension was refused at the limit (06 §6.7).
Ending a session invalidates all its tokens, revokes its voice leases (the participant is cut within 4 s) and stops event delivery to it. On each of its WebSockets the server then (06 §6.7):
- sends the federation.session_ended event;
- sends session.closing with
reasonsession_ended,reconnectfalse and a problem object:core.token_expiredwhen the session ran out,federation.session_endedfor every other ending; - closes with code 4004.
{
"v": 1,
"t": "federation.session_ended",
"id": "0193a1f5-77aa-7bcd-8e0f-1a2b3c4d5e6f",
"ctx": "me",
"ts": "2026-12-04T18:31:12.004Z",
"d": { "sessionId": "0193a1f2-0c4d-7e5f-8a6b-7c8d9e0f1a2b", "reason": "identity_changed", "retry": true }
}The event is ephemeral (no seq). Requests made with the token afterwards fail with 401 federation.session_ended, whose data.reason and data.retry carry the same values; the problem object's retryable equals data.retry, and its userAction is retry when data.retry is true and none otherwise. Treat an unknown reason as admin.
With retry: true, create a new session silently, at most 3 times per 10 minutes per server (06 §6.10). An ended session never comes back; continuing always means a new session.
Not every identity change ends a session. When identity.changed leaves the device valid (another device was added, or an insecure account turned on encryption), the server keeps the session and updates account.security, device.enrolled and secureAccess (06 §7.2).
Client error handling
The per-code actions of 06 §6.10 rule 7 are what a client follows. Don't derive behaviour from the retryable and userAction flags alone; some pairings are unusual (federation.extension_limit is retryable: false with userAction: wait).
| Error | Client action |
|---|---|
federation.assertion_replayed, federation.wrong_audience, federation.device_proof_required, federation.identity_mismatch |
Get a fresh assertion and retry once at once; if that fails, back off from 1 s, doubling to 60 s. |
federation.assertion_invalid, federation.device_proof_invalid |
Back off as above and record a diagnostic. If it persists for 10 min, show the server as unreachable. |
federation.issuer_unreachable, discovery.peer_suspended, federation.home_unreachable |
Retry with back-off; show a status line. |
federation.home_reachable |
Retry the assertion request at once; if your home server still can't be reached, let the session expire and show "Can't reach your server". |
federation.extension_limit |
Let the session expire; keep trying the home server. |
federation.blocked |
Don't retry. Show that the servers don't connect. |
federation.session_ended |
Follow retry. |
core.token_expired |
Create a new session silently. |
account.suspended, security.upgrade_required from the home server |
Stop creating remote sessions and show the home account's state. |
Note
A sub that fails V6 is described both as 400 address.non_canonical and as federation.assertion_invalid with reason subject (06 §6.3). Handle both.
None of this asks the user anything (06 §15). Federation is invisible when it works; the only states users see are quiet status lines such as "Your server (a.com) isn't responding. You can keep chatting where you're already connected." or "Your server doesn't connect with b.com." 06 §15 lists the intended meanings and document 20 owns the exact copy (Client requirements). Name servers by canonical domain in display form (the U-label where Addresses allows it). Never show raw error codes, keys, jti values or token details; those go to diagnostics.
Secure access at a remote server
A hosting server enforces SM-4 for remote users from the session's account.security and device.enrolled. For the same account state the result must be identical to what a home session gets (06 §7.1).
| Door | Requirement | Refusal |
|---|---|---|
| Joining the community of a secure server | security = secure |
403 security.account_required |
| Opening a secure context: timeline, SealedMessages, attachments, read state, manual history shares | secure and enrolled |
403 security.account_required, else 403 security.device_not_enrolled |
| Any MLS Delivery Service operation of a secure context | As above, plus the leaf's credential checks | As above, or the code of 13 |
| Joining or staying in a call of a secure context | As above | As above |
| Acting in an existing secure DM, or creating the MLS group of one | As above | As above |
| Anything in an insecure context | Any valid session | — |
security.account_required is checked first. A secure account on an unenrolled device can therefore join a secure server's community but can't open any channel there.
DM membership is decided from the participants' IdentityStates, not by a door check on the added person's session. Adding an insecure account to a secure group DM fails with security.would_downgrade; a 1:1 DM with an insecure participant is created insecure (06 §7.1; see Direct messages).
Server-to-server requests
The rest of this page is for server implementers.
Which requests are S2S
An S2S endpoint takes exactly one Authorization: Bearer <sv-s2s+jwt> header and nothing else that authenticates. In v1 these are (06 §8.1):
| Endpoint | Owner | Purpose |
|---|---|---|
| POST /v1/federation/events | 06 | Event ingest |
| POST /v1/federation/keypackages/claim | 13 | KeyPackage claims forwarded by a claimer's home server |
| POST /v1/community/membership-check | 09 | Membership lookup for 12's auto-accept rule |
| GET /v1/reports/{id}/evidence/{mid} | 10 | Evidence of a forwarded report, fetched by the receiving home server for 30 days |
| GET /v1/reports/{id}/evidence/{mid}/attachments/{attachmentId} | 10 | Attachment blob of forwarded evidence |
S2S endpoints refuse home, remote and bot tokens with 401 federation.s2s_unauthenticated (data.reason missing), and client endpoints never accept an S2S token in place of a session. The requests other than event ingest are synchronous: the response carries the result, and their owners, not the event machinery, specify retries (06 §10.2). An authenticated S2S request that names a subject or origin outside the sender's authority, such as a claimant not homed at iss, gets 403 federation.not_authorized with data.field (06 §16).
The public lookups (discovery, /v1/users/{local}/identity, /v1/users/{local}/profile, /v1/addresses/{local}) need no authentication. A server may attach an S2S token to them to get per-peer rate limits instead of per-IP limits; a receiver that doesn't verify it, or fails to, ignores the header and never answers 401 because of it (06 §8.1, §10.3). The extension probe never carries a token.
Note
06 §8.1 allows an S2S token on "the GET lookups of §10.3", which include /.well-known/sloppyv and /meta, while §10.3 says "the /v1/ lookups". Attaching it only to /v1/ lookups satisfies both.
Signing keys
HomeAssertions and S2S tokens are signed with an active server key of purpose sign from the signer's ServerMetadata. The header kid is <canonical-domain>#<keyId>, and its domain must equal iss (06 §3.2). Verifiers get the key through 02's serverKey(iss, kid, "sign", iat), which uses only the pinned key set, refetches metadata for an unknown kid at most once per 60 s per domain, never accepts a revoked or mls-external-sender key, and accepts a retired key only for tokens whose iat is no later than its retiredAt (±60 s). Because every assertion and S2S token is signed fresh, this never rejects a legitimate token, and it stops a retired key from minting new ones during the 7 days or more it stays published. Lookup failures map to data.reason key_unknown (discovery.unknown_key) and key_status (discovery.key_unusable). See Discovery and Cryptography.
When a remote server learns that a peer's sign key is revoked, it ends within 60 s every live session whose last assertion was verified with that key, with reason key_revoked, because whoever stole the key could have minted assertions for any of the peer's accounts (06 §6.2).
Token claims
TV-4, an event batch from a.com to b.com (06 §8.2, §18.5):
{ "alg": "EdDSA", "typ": "sv-s2s+jwt", "kid": "a.com#2026-12a" }
{
"iss": "a.com",
"aud": "b.com",
"htm": "POST",
"htu": "https://chat.b.com/server/v1/federation/events",
"bh": "nUYsWv7XP5CecrdPm9G1P7rzc5lz5guolB9PeaYkCPI",
"iat": 1796408400,
"exp": 1796408460,
"jti": "8yQwV2nC5kL0pR7tX3zJ1g"
}| Claim | Meaning |
|---|---|
iss |
Sender's canonical domain. |
aud |
Destination's canonical domain. |
htm |
HTTP method, upper case. |
htu |
Full target URI, normalized (below). |
bh |
Base64url SHA-256 of the request content. Present exactly when the request has content. |
iat, exp |
exp ≤ iat + 60; senders use exactly iat + 60. |
jti |
At least 16 random bytes. Single use at the destination. |
The token must fit in 4,096 octets. Binding method, URI and body gives the property of HTTP message signatures with one JWS library (06 §2.2). See S2SRequestToken.
Normalizing the target URI
Sender and receiver both compute normalize(uri) and compare octet for octet (06 §8.3):
- Parse as an absolute URI. The scheme must be
https, with no userinfo. Drop any fragment. - Lowercase the scheme and host; a domain host is a lowercase A-label.
- Remove port 443.
- An empty path becomes
/. - In path and query, upper-case the hex digits of every percent-encoding and decode every percent-encoded unreserved character (
ALPHA / DIGIT / "-" / "." / "_" / "~"). - In the path only, decode
%3Ato:, because context references contain a colon that clients and servers may encode. - Remove dot segments.
- Reassemble as
scheme "://" host [":" port] path ["?" query].
A sender puts normalize(target) in htu and should send the request to exactly that URI, without dot segments and with context references unencoded.
Examples from TV-6 (06 §18.7):
| Input | normalize(input) |
|---|---|
https://Chat.B.com:443/server/v1/federation/events |
https://chat.b.com/server/v1/federation/events |
https://chat.b.com/server/v1/../v1/federation/./events |
https://chat.b.com/server/v1/federation/events |
https://chat.b.com/server/v1/contexts/dm%3aq83vEjRWeJA/x |
https://chat.b.com/server/v1/contexts/dm:q83vEjRWeJA/x |
https://chat.b.com/server/v1/a%7eb%2fc?x=%7e%2f%3a |
https://chat.b.com/server/v1/a~b%2Fc?x=~%2F%3A (%3A is decoded in the path only, never in the query) |
https://a.com |
https://a.com/ |
https://BÜCHER.example/sv/v1/federation/events |
https://xn--bcher-kva.example/sv/v1/federation/events |
http://a.com/sv/v1/federation/events |
Error: scheme isn't https |
https://user@a.com/sv/v1/federation/events |
Error: userinfo present |
Warning
The receiver builds the expected value from its own configured public base URL plus the request-target exactly as it arrived on the wire, before any decoding by the framework: normalize(origin(baseUrl) + request-target). Never use the Host header. Behind a path-rewriting reverse proxy, reconstruct the public request-target the sender used (06 §8.3). Binding the full URI means a token for /server on a shared host can't be used against /server2. A trailing slash makes the URI differ (TV-7 #12 gives reason uri).
Body hash
bh covers the request content after any transfer and content coding is removed. Senders should not apply a content coding to S2S requests. Serialize the JSON body once, hash those exact octets, and send the same octets; re-serializing changes whitespace or member order and breaks the hash (TV-7 #13). A request with no content has no bh (06 §8.4).
Verification at the receiver
Steps R1–R14 run in order; failures are 401 federation.s2s_unauthenticated with the given data.reason unless stated (06 §8.5):
| Step | Check | data.reason |
|---|---|---|
| R1 | Exactly one Authorization: Bearer header, ≤ 4,096 octets |
missing, malformed |
| R2 | Header alg, typ, kid only |
alg, typ, malformed |
| R3 | Required claims, canonical base64url | claims |
| R4 | iss lowercase A-label equal to the kid domain |
kid |
| R5 | aud is this server's canonical domain |
audience |
| R6 | htm equals the method |
method |
| R7 | htu equals the expected normalized URI |
uri |
| R8 | bh matches the content, or is absent with no content |
body_hash |
| R9 | Times, maximum lifetime 60 s | expired, not_yet_valid, lifetime |
| R10 | Resolve iss; its canonicalDomain equals iss. A suspended issuer continues with the keys in its pin only |
issuer_not_canonical; 503 federation.issuer_unreachable if unresolvable |
| R11 | Get the key | key_unknown, key_status; 503 discovery.peer_suspended for a suspended issuer and a key outside the pin |
| R12 | Signature | signature |
| R13 | iss not blocked |
403 federation.blocked |
| R14 | Insert (iss, jti) into the replay cache |
replayed |
R1–R9 use only local data and run before any network activity. A 401 also carries WWW-Authenticate: Bearer realm="<canonical domain>", error="invalid_token". A request that passes is from the peer iss; the handler uses iss as the origin and never trusts an origin named in the body.
Replay caches
A server keeps two replay caches, one for HomeAssertion jti values (V16) and one for S2S token jti values (R14), each keyed by (iss, jti) and kept until exp + 60 s (06 §8.6).
- The caches are shared and updated atomically across every node and process of the server; otherwise one node accepts what another already consumed.
- If a cache is unavailable, fail closed with 503 core.unavailable. Never accept without the check.
- Senders create a new token with a new
jtifor every attempt, retries included. - After a restore from backup or any other loss of cache contents, refuse for 360 s every assertion and S2S token whose
iatis earlier than the moment serving resumed (300 s longest lifetime plus 60 s skew): 401federation.assertion_replayedfor assertions, 401federation.s2s_unauthenticatedwithdata.reasonreplayedfor S2S tokens. Honest clients and senders retry with fresh tokens. See Running a server.
Transport rules
- HTTPS to the peer's base URL from discovery, WebPKI validation, TLS 1.2 or later (TLS 1.3 recommended).
- Never follow redirects; a 3xx is a failed attempt.
- Never connect to loopback, link-local, unspecified, multicast, private-use or otherwise non-global addresses unless the administrator allowed the range. Check the address actually connected to, after DNS resolution, so DNS rebinding can't bypass it. Federation lets any stranger make your server fetch URLs.
Content-Type: application/jsonon every request with content.- Timeouts: 10 s to connect including TLS, 30 s for the whole exchange.
- Reuse connections (HTTP/2 or later recommended) and keep at most 8 concurrent requests per peer.
- Responses aren't signed; their authenticity rests on TLS to the pinned base URL.
- Send a
User-Agentnaming the server software and version, with no user data. - Receivers allow each authenticated peer at least 10 requests per second sustained, bursts of 50, on
/v1/federation/events, and answer 429 withRetry-Afterbeyond that.
Event delivery
The batch
Every S2S event, of every type and from every origin, goes to POST {base}/v1/federation/events in a batch of 1 to 100 events (06 §9.1). When origin and destination are the same server, it delivers internally with the same semantics.
POST /server/v1/federation/events HTTP/1.1
Host: chat.b.com
Authorization: Bearer eyJhbGciOiJFZERTQSIsInR5cCI6InN2LXMycytqd3QiLCJraWQiOiJhLmNvbSMyMDI2LTEyYSJ9.…
Content-Type: application/json
{
"events": [
{
"id": "0193a1f0-6b2c-7d4e-8f90-0a1b2c3d4e5f",
"t": "device.revoked",
"ts": "2026-12-04T18:20:00.000Z",
"orderKey": "alice@a.com",
"d": { "sub": "alice@a.com", "did": "Yx3kP0aL9qR2sT5uV8wZ1A", "revokedAt": "2026-12-04T18:20:00.000Z",
"igen": 1, "ver": 18, "state": "eyJhbGciOiJFZERTQSIs…" }
}
]
}The S2SEvent envelope (06 §9.2):
| Member | Meaning |
|---|---|
id |
UUIDv7 from the origin, unique among everything it sends. Retries reuse it. |
t |
Event type. |
ts |
Creation time, RFC 3339 with milliseconds, UTC. |
orderKey |
Optional, 1–256 characters. Same key, same origin and destination: delivered in creation order. |
expiresAt |
Optional. After it, the origin stops trying and a receiver ignores the event. |
d |
Payload, defined by the type's owner. |
The envelope carries no origin; the origin is always the token's iss. Events aren't signed individually, and a server never forwards another server's event to a third as though it came from the original origin. One serialized event must fit the destination's maxFederationEventBytes (default and floor 131,072 octets, advertised in ServerMetadata limits), the whole body must fit the destination's maxRequestBytes, and no two events in a batch may share an id (06 §9.3, §17.3). The limit of 100 events per batch is fixed and not advertised.
The response is 200 with one EventResult per event, in request order:
{
"results": [
{ "id": "0193a1f0-6b2c-7d4e-8f90-0a1b2c3d4e5f", "status": "accepted" }
]
}status |
Meaning | Sender action |
|---|---|---|
accepted |
Durably stored or applied | Done |
duplicate |
Received earlier, whatever the outcome then | Done |
ignored |
Unknown type, past expiresAt, or a subject the receiver doesn't know |
Done |
rejected |
Permanently refused; carries error |
Drop, log, run the owner's give-up hook |
deferred |
Temporarily refused; may carry retryAfterMs |
Retry later |
Treat an unknown status, and any event missing a matching result, as deferred (06 §9.3). Whole-request outcomes:
| Response | Sender action |
|---|---|
| 400 federation.batch_invalid | Resend each event alone, once; drop any that still gets 400 |
401 federation.s2s_unauthenticated |
Retry with back-off; keys may be propagating |
403 federation.blocked |
Drop every queued event for that destination; pause it for 24 h |
413 core.too_large |
Split and resend; drop a single event that gets 413 |
429, 5xx, 503 discovery.peer_suspended, 503 federation.issuer_unreachable, network error, timeout |
Retry the whole batch with back-off, honouring Retry-After |
| Anything else | Retry with back-off until the events' 24 h end |
Receivers should answer within 10 s by storing events durably and processing them asynchronously; deadlines such as the 60 s of revocation processing still apply.
Receiver processing
For each event, in array order (06 §9.4):
- Validate the envelope (
idis UUIDv7,twell formed,tsno more than 300 s in the future,dan object, size within limit). Failure:rejectedwith federation.event_invalid or federation.event_too_large. expiresAtpassed:ignored.tsmore than 25 h old:rejectedwith federation.event_expired.(iss, id)in the dedupe store:duplicate.- An earlier event in this batch with the same
orderKeywas deferred:deferred. - Unknown
t:ignored. - Check the type's subject binding. Failure:
rejectedwith federation.event_not_authorized, or the owner's code. - Check every address and domain in
dfor canonical form (failure:rejectedwithaddress.non_canonical), then validatedas the owner specifies (failure:rejectedwithfederation.event_invalidor the owner's code). An event about an account or context of the receiver's that doesn't exist isignored. - Store or apply the event and insert
(iss, id)into the dedupe store atomically:accepted. On a temporary failure,deferredwith no dedupe entry.
You should record non-deferred outcomes of steps 1–8 in the dedupe store too, so a resend gets duplicate (TV-7 #16 shows both behaviours). Each (iss, id) is processed at most once. Keep dedupe keys for at least 48 h; together with the 25 h age limit, no event inside its retry window can be processed twice (06 §9.5).
Ordering, retries and lanes
Ordering (06 §9.6). There is no global order. For one (origin, destination, orderKey), the origin doesn't send an event while an earlier one with the same key is unacknowledged, and lists such events in creation order within a batch. The receiver completes processing of accepted events with the same key in the order it accepted them, even across batches and asynchronous processing. rejected, ignored and duplicate count as acknowledged. Payload owners still make processing robust to reordering, for example with IdentityState ver.
Queues (06 §9.7). The origin keeps two durable queues per destination, one per lane, and enqueues each event in the same transaction as the change that causes it (an outbox), so a crash can't lose it. An action that causes an S2S event, such as a device revocation, doesn't report success before the event is durably enqueued.
Back-off. An attempt fails when the whole request fails or every result is deferred. After a failed attempt the next waits
delay(n) = min(2^(n−1), 3600) seconds × u, u uniform in [0.8, 1.2]where n counts consecutive failures. A larger Retry-After or retryAfterMs replaces it. A successful attempt resets n and flushes the queue; individually deferred events wait delay(k) by their own deferral count while the rest of the lane continues. The nominal schedule (TV-8) is attempts at 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1,023, 2,047 and 4,095 s, then every 3,600 s up to 83,295 s: 35 attempts. No attempt starts after ts + 24 h, or after expiresAt if earlier; the event is dropped, logged and passed to the owner's give-up hook.
Lanes (06 §9.8):
| Lane | Event types | Batching | Concurrency per destination |
|---|---|---|---|
high |
identity.changed, device.revoked, account.deleted, account.suspended; notify.event expiring within 120 s of ts (call rings); discovery.metadata_changed with urgent: true |
Sent at once; may batch only events already queued | 2 requests |
normal |
Everything else | May wait up to 250 ms to fill a batch | 2 requests |
The lanes are independent, so revocations reach audiences within about 10 s even while a peer is digesting a burst of notifications. Ordering applies within a lane only.
Event catalogue
The S2S event types in v1 (06 §10.1). Payloads belong to their owners; lane, orderKey and subject binding are normative here.
| Type | Origin → destination | Owner | Lane | orderKey |
Subject binding |
|---|---|---|---|---|---|
| identity.changed | Home → audiences | 07 | high | d.sub |
Domain of d.sub = iss |
| device.revoked | Home → audiences | 07 | high | d.sub |
Domain of d.sub = iss |
| account.deleted | Home → audiences | 05 | high | d.addr |
Domain of d.addr = iss |
| account.suspended | Home → audiences | 05 | high | d.addr |
Domain of d.addr = iss |
| account.profile_changed | Home → audiences | 05 | normal | d.addr |
Domain of d.addr = iss |
| dm.request | Hosting → recipient's home | 12 | normal | d.ctx |
d.host = iss; recipient at the receiver; then 12's host check (dm.host_mismatch) |
| dm.response | Recipient's home → hosting | 12 | normal | d.ctx |
Domain of d.recipient = iss |
| dm.entry_updated | Hosting → participant's home | 12 | normal | d.ctx |
Recipient at the receiver; applies only to an existing DM index entry for (iss, d.ctx) |
| notify.event | Hosting → recipient's home | 19 | normal, or high for rings | d.recipient |
d.host = iss; recipient at the receiver |
| report.forwarded | Forwarding server → reported account's home | 10 | normal | d.reportId |
d.origin = iss; d.target at the receiver |
| discovery.metadata_changed | Any server → recent S2S peers and audience peers | 02 | high if d.urgent, else normal |
None | None; the receiver refetches the metadata of iss only |
A binding fails (rejected, federation.event_not_authorized) only when an origin-naming member doesn't equal iss, or a subject the event is delivered to isn't at the receiver's canonical domain. A subject at the receiver's domain that doesn't exist, or a context it doesn't know, gets ignored, so a probing peer can't learn which accounts exist.
Where a payload carries the account's incarnation, the receiver applies the event only to that incarnation. An event naming a non-current inc for one of the receiver's own accounts is ignored; for another server's account, an older incarnation's event touches only that incarnation's records, and a newer one triggers the incarnation-change procedure below.
Audiences and revocation fan-out
The audience set
For every account it homes, a home server tracks the peers that must hear about revocations, identity changes, suspension and deletion of that account (06 §11.1):
| Source | Added when | Removed when |
|---|---|---|
assertion |
An assertion is issued with that aud |
30 days after the last such issuance |
dm_index |
The account's DM index has an entry, in any state, hosted at that peer | No such entry remains |
community_list |
The account's community list contains the peer | The entry is removed |
The community list is included because a member who hasn't opened a community for 30 days still has leaves in its secure channels until the 90-day eviction; listing the server lets it remove a revoked device's leaves promptly. DM entries count in every state: a requested entry because the Welcome carried by dm.request already made the recipient's devices group members before Accept, a declined entry because a declined 1:1 participant keeps their leaves, and a closed entry because a closed 1:1 DM can reopen. The home server itself is never in the set, because it applies the effects locally; a peer it blocks gets only the revocation and deletion events that 06 §12.5 allows, for 30 days. A new account at a reused address starts with an empty set. A home server should support at least 10,000 audience peers per account. The audience set is a record of where a user goes, so it is used only for fan-out, the user's own view and 19's notify.event legitimacy check (06 §14.2).
Triggers and fan-out
| Trigger | Event | Sent for |
|---|---|---|
| Identity generation or security state changes, or the device set grows: upgrade, re-upgrade, reset, downgrade, device registration | identity.changed |
Every account |
| A device record is revoked (lost device, user or admin revocation, shared-computer timeout, sign-out that removes the record) | device.revoked |
Every account, insecure accounts and bots included |
| Account deleted | account.deleted |
Every account |
| Account suspended | account.suspended |
Every account, bots included |
| Public profile changed | account.profile_changed |
Every account |
(06 §11.2) device.revoked goes out for insecure accounts too, because it is the only way to end a stolen insecure phone's remote sessions before their hour runs out. Delisting a device is announced by device.revoked alone, whose state member carries the new IdentityState. Audiences process every event idempotently and in any order, using IdentityState ver to discard stale state.
The home server (06 §11.3):
- enqueues the event for every audience peer in the same transaction as the change;
- starts sending within 1 s;
- sends to at least max(32, ⌈P / 50⌉) peers concurrently, where P is the number of audience peers;
- aims for every reachable audience to acknowledge within 10 s in 95 % of fan-outs;
- retries unreachable peers for 24 h.
What an audience does
Within 60 s of accepting the event (06 §11.4):
| Event | Duties |
|---|---|
device.revoked |
End every session of (account, device) with device_revoked, which revokes its voice leases. Mark the device revoked. Start removal of the device's leaves in every MLS group it hosts. |
identity.changed |
If inc changed, apply the incarnation-change procedure instead. Otherwise get the new IdentityState (from the payload or by fetching, retrying up to 60 s), invalidate the cached one, update or end each session by 06 §7.2, and start removal of leaves that are no longer valid. Admit no new leaf until the new IdentityState is in hand. |
account.deleted |
For incarnation d.inc only: end every session with account_deleted, mark (account, inc) deleted, start removal of every leaf, process memberships and data as 05 and 09 specify, and delete cached profile and IdentityState data. |
account.suspended |
End every session with admin. Mark (account, inc) suspended with d.suspendedAt. Don't remove leaves, memberships or data; suspension is reversible and restoration sends no event. |
Marks. Revoked, deleted and suspended marks are kept for at least 1 h after the event is accepted, which outlasts any assertion issued before the revocation (300 s) plus skew. Without them, an assertion issued just before a revocation could open a fresh one-hour session afterwards. V15 refuses assertions that hit a mark; for a suspension, only assertions whose iat is not later than suspendedAt, so a restored account works again at once. Record the mark even when the subject is unknown to you (answer ignored): an assertion collected for your server before the revocation may not have been used yet.
Audiences never forward these events. Every home server informs its own audiences, and hosting servers inform group members through MLS (MLS and sealed messages).
Exposure bounds
| Situation | How long a revoked device keeps access |
|---|---|
| Audience reachable | About 10 s for delivery plus 60 s to act; voice cut within 4 s of lease revocation |
| Audience unreachable from the home server, session live | The shorter of the session's remaining life (≤ 1 h) and the delivery time plus 60 s; the device can't renew, because its home server refuses it an assertion |
| Home server unreachable from the audience, session extended | Up to 24 h after the last verification |
| No session at the peer | Nothing to fetch; stale leaves removed when the event arrives, or by 90-day eviction |
(06 §11.5) The 24 h case is the accepted price of keeping people online during home outages; see Security model.
Incarnation changes
Every account has an immutable inc. A local part registered again after deletion gets a new inc, so (address, inc) names exactly one account ever (06 §11.6). Key every record about another server's account on (canonical address, inc): sessions, marks, memberships, roles, overwrites, timeouts, mutes, DM participation, MLS leaves and timeline sender records. Bans are the exception; they match the address alone.
When you verify an assertion or IdentityState whose inc differs from your records for that address, before acting on it and within 60 s:
- process the old incarnation's records as if
account.deletedhad arrived for it; - treat the new incarnation as an account you have never seen.
This protects the new holder of a reused address from inheriting the earlier person's memberships, roles and DMs when your server missed account.deleted. An incarnation seen replaced never becomes current again: an IdentityState that names it fails with state_rollback (07), and an assertion that names it fails V15 with account_deleted.
Note
06 §11.6 says an assertion naming a replaced incarnation fails V15, but V15 relies on deleted marks that §11.4 keeps for at least 1 h and §14.1 says should not exceed 7 days. The spec doesn't say what stops an old-incarnation assertion after the mark expires.
Federation policy and blocks
Model
A server's federation policy has a mode and a list of blocks (06 §12.1):
open(default): federate with every peer except blocked ones.allowlist(optional to implement): federate only with listed peers, never with blocked ones. A server without it rejectsallowlistwith 501 core.unsupported_feature,data.feature"federation_allowlist".
Blocks are keyed by canonical domain and cover every alias through resolution. Matching never uses the domains list a peer publishes about itself, because any server can list any domain there; trusting it would let a hostile server slip past an allowlist, or make a block on it silently block innocent peers (06 §12.3, §19).
blocked(name, peer):
N := { name }
if peer is resolved:
N := N ∪ { peer.canonicalDomain }
for b in blocks:
for n in N:
if n = b.domain: return true
if b.includeSubdomains and n ends with "." + b.domain: return true
if peer is resolved and mode = allowlist and peer.canonicalDomain ∉ allows:
return true
return falseThe pre-resolution check applies blocks only, so an alias of an allowed peer isn't refused before it is resolved. Unresolved blocks are re-resolved at least every 24 h and rewritten under the canonical domain; two blocks that end up on one domain merge.
Administration
These endpoints need a session (home, or remote for a remote admin) of an account holding the admin role. Others get 403 core.forbidden with data.missingRole: "admin" (06 §12.4; see Roles and moderation).
| Request | Response |
|---|---|
| GET /v1/federation/policy | 200 FederationPolicy |
PATCH /v1/federation/policy with {"mode": "allowlist", "allows": ["c.com"]} (either member optional) |
200 FederationPolicy |
GET /v1/federation/blocks?cursor=&limit= |
200 {"items": [FederationBlock], "nextCursor": …} |
| PUT /v1/federation/blocks/{domain} | 201 (new) or 200 (updated) FederationBlock |
| DELETE /v1/federation/blocks/{domain} | 204; 404 core.not_found if absent |
PUT /server/v1/federation/blocks/spam.example HTTP/1.1
Host: chat.b.com
Authorization: Bearer <admin session token>
Content-Type: application/json
{ "includeSubdomains": true, "note": "Bulk message requests, 2026-12-01" }{
"domain": "spam.example",
"resolved": true,
"includeSubdomains": true,
"note": "Bulk message requests, 2026-12-01",
"createdAt": "2026-12-04T18:40:00.000Z",
"createdBy": "admin@b.com"
}PUTresolves{domain}, so an alias is accepted, and stores the block under the canonical domain; an unresolvable domain is stored withresolved: falseand matches by name until resolution succeeds.DELETEaccepts an alias the same way.- A server should support these endpoints so that generic admin tools work, and must enforce blocks whatever interface sets them.
noteis private, at most 500 characters, and never sent to any peer.- Blocking one of the server's own domains fails with 400
core.invalid_request. - Creating, updating or deleting a block writes
federation_blockedorfederation_unblockedto the audit log in the same transaction, withrestricted: trueand without the note. - A server never publishes its policy or blocks in ServerMetadata and never tells a peer it was blocked, except through
federation.blockedanswers to that peer's own requests.
Note
06 §12.2 says allows is empty in open mode, but the spec doesn't say whether a PATCH that sets mode: "open" clears allows, or whether allows may be set while the mode is open.
Effects
When X blocks Y, or Y is outside X's allowlist, X applies every effect below; effects on existing state take place within 60 s of the block being created (06 §12.5):
| Area | Effect at X |
|---|---|
| Assertions | X issues none with aud = Y (403 federation.blocked). |
| New remote sessions | X refuses assertions issued by Y (403 federation.blocked). |
| Existing sessions | Y's accounts' sessions end with reason blocked, which revokes their voice leases. |
| Inbound S2S | Every authenticated request from Y (events, KeyPackage claims, membership checks) gets 403 federation.blocked (R13). |
| Outbound S2S | Queues for Y are dropped and nothing new is enqueued, except: for 30 days X keeps sending identity.changed, device.revoked and account.deleted about accounts whose audience set had Y with source assertion when the block was created, so Y can end their sessions and remove their leaves. X stops at once if Y answers 403 federation.blocked. X claims no KeyPackages from Y. |
| Memberships | Kept, so unblocking restores them, but Y's accounts can't connect; Y's leaves are removed from X's MLS groups with reason federation_blocked, not shown as a moderation action. |
| DMs hosted at X | X refuses to create a DM or group DM that includes an account of Y (403 federation.blocked). In existing ones Y's participants are cut off; X's users can still post to the participants who aren't blocked. |
| DMs hosted at Y | X's users can't get assertions for Y; clients show those DMs as unavailable. |
| DMs at a third server | X may answer ignored to dm.request or notify.event whose inviter or sender is at Y. X's clients should show Y's participants as unavailable. |
| DM requests | dm.request from Y is refused with 403; Y drops it. |
| Content | Stored messages that mention or quote Y's users are unchanged. |
| Public lookups | Unaffected; X may rate-limit requests it can attribute to Y. |
When Y gets 403 federation.blocked on an S2S request, it drops every queued event for X and should pause deliveries to X for 24 h, then try again with the next event. Unblocking restores federation for new requests; nothing is replayed, and Y's users' devices rejoin secure groups silently by external commit.
A federation block stops all federation with a peer. A domain ban only keeps a domain's accounts out of a community, while DMs, revocations and notifications continue. Use a ban for unwanted members and a block for an abusive server.
Outages
(06 §13)
| Down or unusable | Chat in existing contexts | New contexts elsewhere | New secure joins | Revocations reach audiences | Notifications to the user |
|---|---|---|---|---|---|
| Home server | Yes, ≤ 24 h by extension | No | No | No (sent when back, if within 24 h) | Queued ≤ 24 h |
| One hosting server | Elsewhere yes; there, queued | Yes | Yes, elsewhere | Yes, except to it (queued) | From it: no |
| Link between two servers | Yes | Usually | Usually | Queued | Queued |
| Peer suspended | Its users here: while its pinned keys verify. Our users there: until session expiry | Not with it | Not with it | From it: yes. To it: held | From it: yes. To it: held |
Hosting server down. The client keeps outgoing messages with their client-generated IDs and retries at 1 s doubling to 60 s, then every 60 s while the app runs, and creates a new session when the server answers if the old one expired. Other servers queue events for it for 24 h. When it comes back it treats every cached IdentityState as needing revalidation before admitting new leaves.
Partition between servers. The remote server verifies assertions with cached metadata and keys and with the IdentityState the client presents, so session creation usually works. It fails with 503 federation.issuer_unreachable only without usable cached keys, or when it needs an IdentityState it can't get. If the session needs an extension, the probe fails and the extension is granted, still within 24 h.
Key-set suspension. When discovery suspends a peer because its key set changed without continuity, a server trusts only the keys in its pin (06 §13.4):
- the home server refuses assertions for the suspended peer (503
discovery.peer_suspended); - sessions for the peer's accounts are created and renewed only with assertions that verify under a pinned key, and are never extended;
- inbound S2S requests that verify under a pinned key are accepted, and
identity.changed,device.revokedandaccount.deletedfrom them are processed, so revocations from the real key holder are never delayed; - outbound S2S to the peer is held in the queue, with the 24 h clock running;
- users see "b.com is temporarily unreachable", never a security warning; the administrator resolves it as Discovery describes.
What servers keep
A remote server stores about another server's user only what it needs to serve them: address, inc, display name and kind; the latest verified IdentityState; session records with token hashes, never tokens; and revocation marks. HomeAssertions and DeviceProofs aren't kept beyond verification. It never asks for or stores a user's OIDC identities, e-mail addresses, push tokens or other servers' session tokens, and never forwards what it learned about a remote user to a third server outside protocol messages. 06 §14 gives the retention limit for each item, for both remote and home servers.
Test vectors
06 §18 has complete, reproducible vectors built from RFC 8032 keys. Use them before testing against a live peer:
- TV-1 and TV-2: an enrolled HomeAssertion and its DeviceProof, in compact form.
- TV-3: an insecure account's assertion.
- TV-4 and TV-5: S2S tokens in both directions, with exact bodies and
bhvalues. - TV-6: target-URI normalization.
- TV-7: 17 verification outcomes, from a successful session to
replayed,uri,body_hashandincmismatches. - TV-8: the retry schedule.