Status Draft. Protocol version 1 (sv1) of the Sloppy Voice v2 product
Date 2026-12-04
Depends on 00 (overview and conventions), 02 (discovery, ServerMetadata, server keys, pinning), 03 (transport, envelope, errors), 04 (JWS profile, Ed25519 rules), 05 (accounts, device records, home sessions)
Referenced 01 (canonical addresses, display of domains), 07 (IdentityState, certificates, identity.changed and device.revoked payloads), 09 (community membership, membership check), 10 (admin role, bans, report.forwarded), 12 (dm.request, dm.response, dm.entry_updated, DM index), 13 (MLS removal, KeyPackage claims), 15 (voice leases), 19 (notify.event), 20 (copy), 21 (operations)
Decisions used D-002, D-004, D-016, D-017, D-019, D-021, D-022, D-025, D-026, D-027, D-028, D-029, D-030, D-032, D-033, D-035, D-037, D-040, D-048, D-049, D-050, D-051, D-058, D-059, D-062, D-065, D-066, D-069, D-071, D-074, D-086
Owns HomeAssertion (sv-assert+jwt); DeviceProof (sv-devproof+jwt); S2S request token (sv-s2s+jwt); /v1/federation/assertions, /v1/federation/sessions…, /v1/federation/events, /v1/federation/blocks…, /v1/federation/policy; the RemoteSession object and its lifetimes; the S2S event envelope, delivery, retry and deduplication; the S2S event catalogue index; audience tracking and revocation fan-out timings; federation blocks and policy; the federation.* error codes and events

Conformance. This document is normative for the Server class (both the home-server and hosting-server roles) and for every client class that talks to a server other than its home server (Full client, Web client, Bot client) (00 §1.5). The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" are to be interpreted as described in BCP 14 (RFC 2119, RFC 8174) when, and only when, they appear in all capitals. Grammars use ABNF (RFC 5234). Wire examples are JSON (RFC 8259) and follow 00 §7. Examples are informative unless the text says otherwise; where an example and the normative text disagree, the normative text wins. Rationale notes start with "Rationale:" and are informative. Blocks that start with "Proposed decision:" record design choices made here that are not yet in spec/DECISIONS.md.

1. Scope

1.1 What this document covers

Sloppy Voice federates like e-mail, but a client talks directly to every server whose contexts it uses (D-004). Federation is therefore two things:

  1. Vouching. A home server vouches for one of its accounts and devices to one remote server with a short-lived, single-use, audience-bound HomeAssertion. An enrolled device of a secure account binds that assertion to its device signing key with a DeviceProof. The remote server verifies both and opens a remote session (§4 to §7).
  2. Server-to-server (S2S) traffic. Servers send each other authenticated requests and events: revocations, DM requests, notifications and forwarded reports. Every S2S request carries a request-bound sv-s2s+jwt token (§8). Events go to one ingest endpoint with at-least-once delivery, retries and deduplication (§9, §10).

This document also specifies how a home server tracks each account's audiences and fans revocations out to them (§11), federation blocks (§12), outage behaviour (§13), and what servers may keep about users of other servers (§14).

1.2 What it does not cover

Topic Owner
Address syntax, canonicalize(), the MUST-canonical field list 01
Discovery, ServerMetadata, server keys, key lookup and usability, key status lifecycle, KeyRotation, delegation evidence, pinning and suspension, caching, discovery.metadata_changed payload 02
The envelope, WebSocket, error object, core.* codes, pagination, rate-limit headers 03
The JWS profile and strict Ed25519 verification 04
OIDC login, home sessions, account states, device records, revocation orchestration, account.deleted, account.suspended and account.profile_changed payloads 05
IdentityCertificate, DeviceCertificate, IdentityState and its verification, identity.changed and device.revoked payloads 07
Community membership and join gates, the membership check S2S endpoint 09
The admin role, bans (including domain bans), report.forwarded payload 10
dm.request, dm.response and dm.entry_updated payloads, DM index, DM hosting rule 12
MLS removal procedure, KeyPackage claims (/v1/federation/keypackages/claim) 13
Voice-lease revocation 15
notify.event payload 19
Exact user-facing copy 20

1.3 Terminology

Terms from 00 §2 are used exactly. This document adds:

Term Definition
Peer Another server, identified by its canonical domain, with which a server exchanges S2S requests or events, or whose accounts hold remote sessions on it.
Origin The server that creates an S2S event. It is always the iss of the S2S token that carries the event.
Destination The server an S2S request or event is sent to. It is always the aud of the S2S token.
S2S event One item of server-to-server news, wrapped in the envelope of §9.2 and delivered through POST {base}/v1/federation/events.
Audience (of an account) A peer that the account's home server must tell about revocations, identity changes and deletion of that account (§11).
Replay cache A server's store of consumed jti values (§8.6).
Dedupe store A receiver's store of S2S event IDs it has processed (§9.5).
Lane One of two independent per-destination delivery queues, high or normal (§9.8).
Probe The request a remote server makes to an account's home server to decide whether that home server is reachable (§6.6).
Extended session A remote session kept alive past the end of its last verified hour because its home server is unreachable (§6.6).
Federation policy A server's list of federation blocks, and optionally an allowlist (§12).

2. Federation model

2.1 Parties and flows

  CLIENT alice@a.com (device q2bS…)
     |  (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}
     |-------------------------------------------------------------> b.com verifies (§6.3):
     |                                                                 resolves a.com (02), checks keys,
     |<------------------------------------------------------------- aud, times, jti, DeviceProof, IdentityState
     |  RemoteSession {token, expiresAt}                              
     |  (4) HTTPS commands and the event WebSocket at b.com use the remote session token (03)
     |
  a.com (home server)                              b.com (hosting server)
     |   S2S: POST {b.com}/v1/federation/events   (sv-s2s+jwt per request)
     |------------------------------------------------>  identity.changed, device.revoked, account.deleted
     |<------------------------------------------------  dm.request, notify.event, report.forwarded
     |   S2S: POST {a.com}/v1/federation/keypackages/claim (13)

The home server is never in the chat or media path of a remote context (00 §3.2). It is consulted only to obtain an assertion (once per remote server per hour, per device), and it pushes revocations to its accounts' audiences.

2.2 Design summary

Mechanism Lifetime Single use Bound to Section
HomeAssertion ≤ 300 s Yes, at the audience One account, one device, one audience §4
DeviceProof ≤ 60 s Yes (bound to one assertion) The assertion's jti, the audience, the device signing key §5
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 §6
S2S request token ≤ 60 s Yes, at the destination Method, target URI, body hash, destination §8
S2S event Retried for 24 h Deduplicated by ID Origin and destination §9

Rationale: short single-use assertions keep the damage of a leaked assertion to one session at one server (D-062). Binding enrolled devices to their DSK means a stolen assertion alone can't open a session with secure access. Request-bound S2S tokens give the property of RFC 9421 signatures with one JWS library (D-027).

3. Peers and federation signing keys

3.1 Resolving a peer

Whenever this document says a server resolves a domain, it runs the server resolution procedure of 02 for that domain, including its caching, delegation-evidence recording and key-set pinning. The result is the peer's base URL, its ServerMetadata and its pin (02 §10), whose state is pinned or suspended. While a peer's pin is suspended, 02's resolution fails with discovery.peer_suspended; §13.4 says what may still be done with the keys in the pin. A server MUST treat a domain as the same peer as another domain exactly when their ServerMetadata canonicalDomain values are equal.

A server resolves peer domains that come from untrusted input: assertion iss, S2S token iss, assertion requests, DM participants and event payloads. Therefore:

  • A server MUST NOT connect, for federation or discovery, to an IP address that is loopback, link-local, unspecified, multicast, private-use (RFC 1918, RFC 4193) or otherwise marked not globally reachable in the IANA special-purpose address registries (RFC 6890), unless its administrator has explicitly allowed that address range. The check MUST be applied to the address actually connected to, after DNS resolution, so a DNS answer that changes between checks can't bypass it.
  • A server MUST NOT follow HTTP redirects on any S2S request (§8.7).

Rationale: federation lets any stranger make a server fetch URLs. Without this rule a hostile peer could point its discovery record at an internal service (server-side request forgery).

3.2 Which keys sign federation objects

HomeAssertions and S2S request tokens are signed with a server key from the signer's ServerMetadata keys whose purpose is sign (02). The signer MUST use a key whose status is active. The JWS header kid is the full server key ID, <canonical-domain>#<keyId> (00 §7.6), and its domain part MUST equal the token's iss.

A verifier obtains the key with 02's key lookup serverKey(iss, kid, "sign", iat) (02 §11.6). That lookup uses only keys in the verifier's pin for iss, refetches metadata for an unknown kid at most once per 60 s per domain, and applies 02's usability rules unchanged (purpose sign only, so an mls-external-sender key is never accepted here; status next, active or retired; never a revoked key). Its failures map to this document's data.reason values: discovery.unknown_key to key_unknown, and discovery.key_unusable to key_status.

Retired keys. 02 §11.6 (step 5, PD-02-16) accepts a retired key only for a JWS whose iat is at most the key's retiredAt (±60 s). Because every HomeAssertion and S2S request token is signed afresh (§4.2, §8.6), 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 (D-030).

3.3 Common time rules

All federation JWS objects use NumericDate seconds for iat and exp and allow ±60 s of clock skew (00 §7.7). These are the comparisons of 04 §6.6, which governs. A nbf claim is rejected on every type of this document (04 §6.6). A verifier, with now its own clock:

  • MUST reject the object if iat > now + 60;
  • MUST reject it if exp ≤ now − 60;
  • MUST reject it if exp ≤ iat or if exp − iat exceeds the object's maximum lifetime (300 s for a HomeAssertion, 60 s for a DeviceProof and an S2S request token).

Servers SHOULD keep their clocks synchronized with NTP to within 1 s.

4. HomeAssertion

4.1 Obtaining an assertion

POST {home}/v1/federation/assertions
Authorization: Bearer <home access token>      (or: Bot <bot token>)
Content-Type: application/json

{ "aud": "b.com" }

Only a home session (05) or a bot token may call this endpoint. A remote session token that this server issued is refused with 403 auth.home_session_required, as on 05's home-only endpoints; any other unknown token gets 401 core.unauthenticated (03).

No Idempotency-Key replay. This endpoint and POST /v1/federation/sessions (§6.1) are exempt from 03's Idempotency-Key rules (03 §14.2). A server MUST ignore the header on them and MUST NOT store their responses. Replaying a stored response would hand out a single-use assertion twice (§4.2) or keep a session token in clear (§6.2). Retrying is safe anyway: each retry asks for a fresh assertion, and each session request carries a fresh assertion.

Request body.

Member Type Required Meaning and constraints
aud string Yes The domain of the remote server the client wants to use. 1–253 octets. The client SHOULD send the canonical domain it learned from its own resolution; the home server also accepts an alias, a U-label or mixed case and converts it (step 3 below).

Response body (200).

Member Type Required Meaning
assertion string Yes The HomeAssertion, a JWS compact serialization (§4.3).
aud string Yes The canonical domain placed in the assertion's aud claim.
expiresAt string Yes The assertion's exp as an RFC 3339 timestamp.
identityState string Conditional The account's current IdentityState JWS (07). MUST be present when the assertion's sec is secure (D-004). SHOULD be present otherwise.
{
  "assertion": "eyJhbGciOiJFZERTQSIsInR5cCI6InN2LWFzc2VydCtqd3QiLCJraWQiOiJhLmNvbSMyMDI2LTEyYSJ9.eyJpc3MiOiJhLmNvbSIs…",
  "aud": "b.com",
  "expiresAt": "2026-12-04T18:25:00.000Z",
  "identityState": "eyJhbGciOiJFZERTQSIsInR5cCI6InN2LWlkc3RhdGUrand0Iiwia2lkIjoiYS5jb20jMjAyNi0xMmEifQ.eyJpc3MiOiJhLmNvbSIs…"
}

Errors.

Condition Status and code
Missing or invalid home session or bot token 401 core.unauthenticated (03)
A remote session token issued by this server 403 auth.home_session_required (05)
The account is in state upgrade_required (SM-3) 403 security.upgrade_required
The account is in state suspended (05) 403 account.suspended (05)
aud is malformed 400 core.invalid_request
aud names this server (any of its domains) 400 federation.audience_is_home
aud can't be resolved, or isn't served by the server it resolves to The discovery.* code that 02 defines for the failure, for example 404 discovery.domain_not_served
The peer is blocked by this server's federation policy (§12) 403 federation.blocked
The peer is suspended (02 §10.4, §13.4) 503 discovery.peer_suspended (02)
Rate limit exceeded (§4.6) 429 core.rate_limited

4.2 Issuance procedure

The home server MUST perform these steps in order.

  1. Authenticate the caller and identify the account A and the device d that the home session or bot token belongs to (05). The device record MUST be active.
  2. Check account state. A MUST be in the active state (05). An account in upgrade_required gets security.upgrade_required, and a suspended account gets account.suspended. This covers an account under a server-scope ban (10 §9.3) and a bot whose owner is suspended (05 §11.8).
  3. Normalize aud. Lowercase it and convert it to an A-label as 01 specifies for domains. If the result is one of this server's own domains, fail with federation.audience_is_home.
  4. Pre-check the policy on the name as given (§12.3). A match fails with federation.blocked.
  5. Resolve the domain (§3.1). If the peer is suspended, fail with discovery.peer_suspended. Let C be the peer's canonicalDomain. If C is this server's canonical domain, fail with federation.audience_is_home. Check the policy again against the resolved peer (§12.3).
  6. Derive the security claims from the account's current IdentityState S (07), the one with the highest ver:
    • sec = S.sec;
    • enr = true exactly when S.sec is secure and d is listed active in S.devices and not in S.revoked; otherwise false;
    • when enr is true: igen = S.igen; ikf = the RFC 7638 thumbprint of the identity key in S.idc; dkf = the dkf of d's entry in S.devices;
    • isv = S.ver.
    • inc = S.inc, the account's incarnation (05 §11.1, D-086).
  7. Create the claims of §4.3 with iat = now, exp = iat + 300, and a fresh jti of 16 bytes from a cryptographically secure generator (22 base64url characters).
  8. Sign with an active sign key (§3.2).
  9. Record the audience (A, C, now) durably before responding (§11.1).
  10. Respond with the assertion, C, expiresAt and S.

The home server MUST create a new assertion, with a new jti, for every request, and MUST NOT cache or reuse assertions. It MUST NOT issue an assertion for any account it doesn't home.

Rationale: resolving aud at the home server means the assertion always names the canonical domain (D-032), even when the user typed an alias, and keeps web clients on the same semantics as native ones (D-029). Deriving enr from IdentityState rather than from the device record keeps the assertion consistent with what the remote server will check.

4.3 Claims

The JWS header is {"alg": "EdDSA", "typ": "sv-assert+jwt", "kid": "<home canonical domain>#<keyId>"} and follows 04's JWS profile.

Claim Type Required Meaning and constraints
iss string Yes The home server's canonical domain (lowercase A-label).
sub string Yes The account's canonical address (01). Its domain part MUST equal iss.
aud string Yes The remote server's canonical domain. MUST NOT equal iss.
iat integer Yes Issue time, NumericDate.
exp integer Yes Expiry, NumericDate. iat < exp ≤ iat + 300. Issuers SHOULD use exactly iat + 300.
jti string Yes Assertion ID: at least 16 random bytes, base64url, 22–86 characters (jti rule, §4.5). Single use at the audience.
kind string Yes user or bot, the account kind (05).
inc string Yes The account's incarnation (05 §11.1, D-086): 16 bytes, base64url without padding (22 characters). It MUST equal the inc of the IdentityState the claims were derived from. Remote servers key their records about the account on (sub, inc) (§11.6).
sec string Yes The account security state: insecure or secure.
did string Yes The device ID (05), 22 base64url characters.
enr boolean Yes true when the device is an enrolled device (§4.2 step 6). MUST be false when sec is insecure.
isv integer Yes The ver of the IdentityState the claims were derived from. At least 1.
igen integer When enr is true The identity generation. MUST be absent when enr is false.
ikf string When enr is true RFC 7638 SHA-256 thumbprint of the identity key, base64url (43 characters). MUST be absent when enr is false.
dkf string When enr is true RFC 7638 SHA-256 thumbprint of this device's DSK, base64url (43 characters). MUST be absent when enr is false.
name string No The account's display name (01), 1–128 octets of UTF-8. Lets the remote server show the name without a profile lookup.

Unknown values. A verifier MUST reject an assertion whose kind or sec has a value not listed here. It MUST ignore claims it doesn't know, except that an object containing nbf is rejected (04 §6.6, §3.3).

Proposed decision: Besides its identity and device claims, the HomeAssertion carries kind (required), isv (required) and name (optional); 00 HP-7 lists them too. Rationale: kind lets every server show the bot badge in insecure contexts (Matrix F) without a lookup; isv lets the remote server detect a stale IdentityState relayed by the client and fetch the current one; name saves a profile lookup on every first contact. The required claim inc is D-086 and is listed in 00 HP-7.

Rationale for enr with sec: SM-4 has two doors, the account door (secure account) and the device door (enrolled device). Two separate claims let the remote server answer both without an IdentityState fetch for unenrolled devices.

4.4 Example

Header and payload, decoded (the full compact form is test vector TV-1, §18):

{ "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"
}

An insecure account's assertion (TV-3) carries 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
}

4.5 Grammar

jti           = 22*86b64url-char          ; >= 16 random octets, base64url, no padding
did           = 22b64url-char             ; 16 octets (05)
inc           = 22b64url-char             ; 16 octets, account incarnation (05)
thumbprint    = 43b64url-char             ; SHA-256 RFC 7638 thumbprint (ikf, dkf)
b64url-char   = ALPHA / DIGIT / "-" / "_"
server-kid    = canonical-domain "#" key-id
key-id        = 1*32( ALPHA / DIGIT / "." / "_" / "-" )
canonical-domain = <lowercase A-label domain name as defined in 01>
jws-compact   = 1*b64url-char "." 1*b64url-char "." 1*b64url-char

Base64url values MUST be the canonical encoding of their octets: decoders MUST reject padding, characters outside the alphabet, and non-zero unused bits in the final character.

4.6 Limits

  • A serialized HomeAssertion MUST NOT exceed 4,096 octets.
  • A home server MUST allow each device of a user account at least 120 assertions per hour with bursts of at least 30, and MAY refuse more with core.rate_limited. Rationale: a client that opens twenty communities at start-up and renews each hourly needs about twenty an hour.
  • Bot accounts are limited per bot account, across all their tokens and devices, by 05 §15.7 (default 120 per hour). A server MAY grant a bot more, as 05 allows.

5. DeviceProof

5.1 Purpose

An enrolled device proves that it is the device named in the assertion by signing a DeviceProof with its DSK (D-062). Without it, anyone who copied the assertion in its 300 s life could open a session with secure access.

5.2 Claims

The JWS header is {"alg": "EdDSA", "typ": "sv-devproof+jwt", "kid": "<dkf>"}, where kid is the RFC 7638 thumbprint of the device's DSK (00 §7.13).

Claim Type Required Meaning and constraints
aud string Yes The remote server's canonical domain. MUST equal the assertion's aud.
ajti string Yes The assertion's jti.
iat integer Yes Creation time, NumericDate.
exp integer Yes iat < exp ≤ iat + 60. Clients SHOULD use exactly iat + 60.

A serialized DeviceProof MUST NOT exceed 1,024 octets. Verifiers MUST ignore unknown claims, except that an object containing nbf is rejected (04 §6.6).

5.3 Creation

A client whose assertion has enr: true MUST create a DeviceProof immediately before it sends the session request (§6.1), and MUST sign it with the DSK whose thumbprint is the assertion's dkf. It MUST NOT sign a DeviceProof for an assertion it didn't request itself or whose aud differs from the canonical domain it resolved for the remote server. A DeviceProof is used once; a retry with a new assertion needs a new DeviceProof.

On web clients the DSK stays inside the key Worker (D-065); the Worker signs the DeviceProof's signing input.

{ "alg": "EdDSA", "typ": "sv-devproof+jwt", "kid": "FtIu-VbGrfe_KB6CH7GNwODB72MNxj_ml11dEvO-7kk" }
{ "aud": "b.com", "ajti": "Kc1o2Q8bTzR3fLw9yH0aVg", "iat": 1796408401, "exp": 1796408461 }

Rationale: binding to ajti rather than to a server nonce saves a round trip. The assertion's jti is already single use and unpredictable, so the pair can't be replayed.

6. Remote sessions

6.1 Creating or renewing a session

POST {remote}/v1/federation/sessions
Content-Type: application/json
[Authorization: Bearer <current remote session token>]     (renewal only)

This endpoint is public in the sense of 03 §3.2 rule 6 (the assertion in the body authenticates the caller) and is exempt from Idempotency-Key replay (§4.1).

Request body.

Member Type Required Meaning and constraints
assertion string Yes A HomeAssertion whose aud is this server's canonical domain.
deviceProof string When the assertion has enr: true The DeviceProof (§5). MUST be absent otherwise; a server ignores it if present.
deviceCertificate string When the assertion has enr: true The device's DeviceCertificate JWS (07). The server needs it because IdentityState lists only the DSK thumbprint, not the key.
identityState string No The IdentityState JWS returned with the assertion. RECOMMENDED whenever the assertion's sec is secure: it saves the server a fetch.
client string No Client software identifier, 1–128 printable ASCII characters, as in session.hello (03).

The request body MUST NOT exceed 64 KiB.

Proposed decision: The session request carries the device's DeviceCertificate. Rationale: IdentityState lists each device as {did, dkf, plat, since}; the remote server needs the DSK itself to verify the DeviceProof, and the DeviceCertificate also lets it check the chain to the identity key without another fetch.

Renewal or creation. A request without an Authorization header creates a new session. A request with a remote session token of this server that is valid and not ended is a renewal of that session: the assertion's sub, inc and did MUST equal the session's, or the server fails with 400 core.invalid_request. A request whose Authorization header isn't valid fails before any check of §6.3, as 03 §3.2 rule 6 requires: 401 core.token_expired for an expired token, 401 federation.session_ended for an ended session, and 401 core.unauthenticated otherwise.

A client MUST send the header only while the token is unexpired by its own clock (expiresAt), and otherwise sends a creation request. If a renewal fails with one of those 401 codes, the client sends the same body again at once without the header. The assertion is still unused, because the header is checked before the assertion, so this costs no new assertion as long as the DeviceProof is still valid.

Response. 201 Created for a new session, 200 OK for a renewal. The body is a RemoteSession object (§6.2) including token.

{
  "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"
}

Errors. Every failure is an RFC 9457 problem object (00 §7.9).

Condition Status and code
Body malformed, required member missing, too large 400 core.invalid_request / 413 core.too_large
Authorization header present but not a valid, live session token of this server 401 core.token_expired, federation.session_ended or core.unauthenticated (above)
Assertion fails a structural, signature, time or claim check 401 federation.assertion_invalid (data.reason, §6.3)
Assertion names an alias of this server, or an alias as iss/sub 400 address.non_canonical (01)
Assertion is for another server 401 federation.wrong_audience
jti already consumed 401 federation.assertion_replayed
Enrolled assertion without DeviceProof or DeviceCertificate 401 federation.device_proof_required
DeviceProof or DeviceCertificate invalid 401 federation.device_proof_invalid
Assertion and IdentityState disagree after a fresh fetch 409 federation.identity_mismatch
The issuer's metadata, keys or IdentityState can't be obtained 503 federation.issuer_unreachable
The issuer is suspended and the assertion can't be verified under its pinned keys alone (02 §10.4, §13.4) 503 discovery.peer_suspended (02)
The issuer is blocked (§12) 403 federation.blocked
The account has a server-scope ban here (10 §9.3) 403 moderation.banned (10)
The device or account was revoked, deleted or suspended (§11.4, V15) 401 federation.session_ended (data.reason device_revoked, account_deleted or admin, data.retry as in §6.8)
Rate limit exceeded (§6.9) 429 core.rate_limited

A remote server MUST create a session for every assertion that passes §6.3, whatever the account's security state. SM-4 is enforced per action, not at session creation (§7).

Rationale: an insecure user must be able to reach a secure channel's door to see G1, and the G1 flow resumes the same session after the upgrade.

6.2 The RemoteSession object

Member Type Required Meaning
sessionId string Yes UUIDv7 assigned by the remote server. Stable across renewals and extensions.
token string Only in create and renew responses The opaque access token (§6.4). Never returned by GET.
tokenType string Only with token Always Bearer.
state string Yes active or extended (§6.7). A client treats an unknown value as active.
account object Yes addr (canonical address), name (display name: the assertion's name if it passes 01's display-name check, else the prepared local part (01 §6.4, §6.5: the failing name is dropped)), kind (user or bot), inc (the account's incarnation, from the assertion, D-086), security (insecure or secure, the server's current view).
device object Yes did, and enrolled (boolean, the server's current view).
secureAccess string Yes full (may enter secure contexts), existing_only (an extended session: may continue in secure contexts where the device already has a leaf, but not join new ones, §7.3), or none. In state active it is full when account.security is secure and device.enrolled is true, and none otherwise; in state extended, §7.3 applies. A client treats an unknown value as none.
createdAt string Yes When the session was created.
verifiedAt string Yes When an assertion was last verified for it (creation or renewal).
expiresAt string Yes When the session ends unless renewed or extended.
renewAfter string Yes expiresAt − 600 s. The client SHOULD renew after this time (§6.10).
extendableUntil string Yes verifiedAt + 24 h, the latest expiresAt an extension can reach.

Server-side record. The remote server keeps, per session: the fields above; the SHA-256 hash of each live token (never the token itself); the assertion's iss, inc, igen, ikf, dkf and isv; the kid of the server key that verified the last assertion; the jti (in the replay cache only, §8.6); client; lastSeenAt; and the count of extensions. §14 limits what else it may keep.

Revoked issuer keys. When a remote server learns that a peer's sign key is revoked (02 §11.7), it MUST, within 60 s, end every live session whose last assertion was verified with that key, with reason key_revoked (§6.8). The clients silently create new sessions with assertions signed by the peer's new key. Rationale: whoever stole the key could have minted assertions for any of the peer's accounts; the sessions they opened would otherwise last until expiresAt.

6.3 Verification algorithm

The remote server MUST perform these checks in this order, after the Authorization check of §6.1. A check that fails stops processing with the stated error and data.reason value. Steps V1–V8 need only local data and MUST be completed before any network activity, including resolution.

Step Check Failure (federation.assertion_invalid unless stated; data.reason)
V1 Parse assertion as a JWS compact serialization of at most 4,096 octets; header per 04: alg = EdDSA, typ = sv-assert+jwt, kid present, and no header member other than alg, typ and kid (04 §6.2; any other member, including crit, fails malformed). malformed, alg, typ
V2 Payload is a JSON object with every required claim of §4.3, each of the right type; kind and sec have known values; base64url values are canonical, and inc decodes to exactly 16 octets. claims
V3 iss is a lowercase A-label domain; the kid domain part equals iss. kid
V4 aud equals this server's canonical domain. If aud is one of this server's alias domains: 400 address.non_canonical. Any other value: 401 federation.wrong_audience. as stated
V5 Times per §3.3, maximum lifetime 300 s. expired, not_yet_valid, lifetime
V6 sub is an address whose domain part equals iss and that passes 01 §7.5 checks 1 to 5 (local part unchanged by minimalPrepare; the full profile is never run, 01 AD-8). Failure: 400 address.non_canonical. subject
V7 Security claims are consistent: sec = insecure ⇒ enr = false; enr = true ⇔ igen, ikf and dkf are all present; enr = true ⇒ sec = secure. security_claims
V8 If enr is true: deviceProof and deviceCertificate are present. 401 federation.device_proof_required
V9 Resolve iss (§3.1). Unresolvable: 503 federation.issuer_unreachable. Suspended: continue with the keys in the pin only (§13.4). The metadata (or pin) canonicalDomain MUST equal iss; otherwise 400 address.non_canonical (an alias as iss). as stated
V10 Obtain the key (§3.2) and verify the signature with 04's strict Ed25519 rules. For a suspended issuer, a key that isn't in the pin fails with 503 discovery.peer_suspended. key_unknown, key_status, signature
V11 The issuer isn't blocked by this server's federation policy (§12.3), checked against the name iss and the resolved peer. 403 federation.blocked
V12 Choose the IdentityState S (§6.3.1) and check it against the assertion (§6.3.2). 409 federation.identity_mismatch, 503 federation.issuer_unreachable or 503 discovery.peer_suspended
V13 If enr is true: verify the DeviceCertificate and DeviceProof (§6.3.3). 401 federation.device_proof_invalid
V14 No active ban of scope server (10 §9.3) matches sub. Community-scope bans, including domain bans, don't affect session creation; 09 and 10 enforce them at community and channel access, and the session stays usable for DMs hosted here (10 §9.4). 403 moderation.banned (10)
V15 (sub, did) isn't marked revoked, (sub, inc) isn't marked deleted, and, if (sub, inc) is marked suspended, the assertion's iat is later than the mark's suspendedAt (§11.4, §11.6). 401 federation.session_ended, data.reason device_revoked, account_deleted or (suspended) admin, data.retry as in §6.8
V16 Atomically insert (iss, jti) into the replay cache with expiry exp + 60 s. If it is already present: 401 federation.assertion_replayed. as stated
V17 Create or renew the session (§6.4) and respond. The creation or renewal is atomic with a final check of the V15 marks, so a revocation accepted while the request was being verified can't be missed. If the server holds records for sub under an inc other than the assertion's, it first applies §11.6 to them, in the same transaction. —

The replay-cache insertion (V16) is the last check, so a party that holds a copied assertion but can't pass V8–V15 can't burn the legitimate client's jti. It MUST be atomic across every node that serves this server.

Rationale for the order: the local checks V1–V8 stop junk before the server resolves any domain an unauthenticated stranger chose. The policy check V11 comes after the signature so that only the blocked peer itself, never a third party forging its name, learns of a block from a federation.blocked answer (§12.4). Resolving a blocked peer costs little, because 02 caches the result.

6.3.1 Choosing the IdentityState

The server keeps, per remote account, the verified IdentityState with the highest ver it has seen (07). To choose S:

  1. If the request carries identityState, verify it as 07 specifies (signature by a sign key of iss, typ, sub and iss equal to the assertion's, not expired). An IdentityState that fails verification is discarded; it doesn't fail the request by itself.
  2. Let S be the verified, unexpired IdentityState with the highest ver among the presented one and the stored one.
  3. If there is no such S, or S.ver < isv, fetch GET {iss base}/v1/users/{local}/identity (07) with a 10 s timeout and verify the result. If the fetch fails and the assertion has enr: true, fail with 503 federation.issuer_unreachable. If the fetch fails and enr is false, continue without S. While the issuer is suspended (§13.4) the server makes no fetch: an enrolled assertion that needs one fails with 503 discovery.peer_suspended, and an unenrolled one continues without S.
  4. Store S if its ver is higher than the stored one.

6.3.2 Checking the assertion against the IdentityState

If S is available:

  • S.sec MUST equal sec.
  • S.inc MUST equal inc (D-086).
  • If enr is true: S.igen MUST equal igen; the RFC 7638 thumbprint of the identity key in S.idc MUST equal ikf; S.idc's kind MUST equal kind; S.devices MUST contain an entry with did equal to the assertion's did and dkf equal to its dkf; S.revoked MUST NOT list that did.

If a check fails and S wasn't fetched from the home server during this verification, the server fetches once (step 3 of §6.3.1, ignoring isv) and repeats the checks. If they still fail, it answers 409 federation.identity_mismatch with data.reason set to sec, inc, igen, identity_key, kind or device. When a 07 verification failed, data.identityReason carries 07's identity check result (07 §10.6), for diagnostics only.

When enr is false and no S is available, the server relies on the assertion's sec, which the same home server signs.

Freshness. A successful check with enr: true sets the validated-at time of S to the assertion's iat, as 07 §13.1 specifies. An IdentityState the server fetched itself during this verification is validated at the time of the fetch. Nothing else in this procedure sets a validated-at time.

Rationale: the home server signs both the assertion and the IdentityState, so for an unenrolled device a second fetch would add latency and no trust. For an enrolled device the IdentityState is what lists the device, which is the dual-control rule of D-033.

6.3.3 Checking the device

When enr is true:

  1. Verify deviceCertificate as 07 specifies, under the identity key in S.idc. Its sub MUST equal the assertion's sub, its did the assertion's did, its igen the assertion's igen, and the RFC 7638 thumbprint of its dsk MUST equal dkf. Failure: data.reason = device_certificate. When a 07 verification failed, data.identityReason carries 07's identity check result (07 §10.6), for diagnostics only.
  2. Parse deviceProof (at most 1,024 octets): alg = EdDSA, typ = sv-devproof+jwt, kid = dkf, and no header member other than alg, typ and kid (04 §6.2). Failure: data.reason = device_proof.
  3. Verify its signature with the DSK from the DeviceCertificate, using 04's strict Ed25519 rules. Failure: device_proof.
  4. aud MUST equal this server's canonical domain and ajti MUST equal the assertion's jti. Failure: device_proof_binding.
  5. Times per §3.3 with maximum lifetime 60 s. Failure: device_proof_expired.

6.4 Tokens, lifetimes and renewal

Token. The access token is an opaque string chosen by the remote server:

session-token = 1*512( ALPHA / DIGIT / "-" / "." / "_" / "~" )

It MUST contain at least 128 bits from a cryptographically secure generator. Servers SHOULD prefix it with rs_ so secret scanners can recognize it. Clients MUST NOT parse it. It is presented as Authorization: Bearer <token> on every HTTPS command and in session.hello on the WebSocket (03). It MUST NOT appear in URLs or logs.

Lifetime. On creation and on each renewal the server sets verifiedAt = now and expiresAt = now + 3,600 s (D-062). The session state becomes active.

Renewal. A renewal (§6.1) that passes §6.3 issues a new token for the same sessionId. The previous token stays valid for 60 s after the renewal, so requests already in flight succeed, and then stops working. WebSocket connections are bound to the session and stay open across renewals: after each renewal the client MUST send session.reauth with the new token on each of its sockets at this server (03 §5.13). A socket's authentication deadline is the expiresAt of the token last accepted on it (03 §5.3); for the previous token that is the end of its 60 s overlap. Renewal re-derives account.security, device.enrolled and secureAccess from the new assertion, so a device that was enrolled after the session started gets secure access by renewing. A renewal also records the kid that verified the new assertion (§6.2).

Concurrent sessions. A remote server MUST keep at most 4 live sessions per (account, did). Creating a fifth ends the one with the oldest verifiedAt, with reason replaced (§6.8).

Rationale: one device normally holds one session per server. A small allowance avoids two instances on one device (for example two browser tabs) ending each other's sessions in a loop.

6.5 Inspecting and ending a session

GET {remote}/v1/federation/sessions/current with the session token returns the RemoteSession object without token (200). It lets a client learn expiresAt and state after a restart.

DELETE {remote}/v1/federation/sessions/current with the session token ends the session with reason signed_out and returns 204. A client SHOULD call it on every remote server when the user signs out of the device, and MAY call it when the user leaves the last context it uses there. Ending a session doesn't change memberships.

POST {remote}/v1/federation/sessions/current/extend is specified in §6.6.

All three fail with 401 core.token_expired for an expired token and 401 federation.session_ended for an ended session.

6.6 Extension while the home server is unreachable

When a client can't obtain a fresh assertion because its home server is down, it asks the remote server to extend the session. The remote server checks for itself that the home server is unreachable (D-062).

POST {remote}/v1/federation/sessions/current/extend
Authorization: Bearer <current remote session token>
Content-Type: application/json

{ "reason": "home_unreachable" }
Member Type Required Meaning
reason string Yes home_unreachable. A server rejects other values with 400 core.invalid_request.

Procedure at the remote server.

  1. The session MUST be live (not expired, not ended).
  2. If more than 900 s remain before expiresAt, fail with 409 core.conflict and retryAfterMs set to the time until 900 s remain.
  3. If expiresAt already equals extendableUntil (= verifiedAt + 24 h), fail with 409 federation.extension_limit. The session stays valid until expiresAt.
  4. If the account's home domain is suspended (02 §10.4), fail with 503 discovery.peer_suspended. Suspension is a security event, not an outage, and never earns an extension.
  5. Probe the home server (below). If it is reachable, fail with 409 federation.home_reachable. If the probe shows that the account is gone or the session's device is no longer valid, end the session (§6.8) with reason account_deleted or device_revoked and fail with 401 federation.session_ended.
  6. Otherwise set expiresAt = min(now + 3,600 s, extendableUntil), set state = extended, increment the extension count, and answer 200 with the RemoteSession object (without token; the token doesn't change). The server also moves the authentication deadline of every socket of the session to the new expiresAt (03 §5.13 item 1).

The probe. The remote server sends GET {home base}/v1/users/{local}/identity (07) for the session's account, using its cached discovery result for the home domain (stale cache use as 02 allows), with a 10 s overall timeout. The probe MUST NOT carry an Authorization header (§8.1), so that its outcome depends only on the home server. The remote server classifies the outcome:

Outcome Classification
DNS failure, connection refused or reset, TLS failure, timeout Unreachable
HTTP 500–599 Unreachable
HTTP 429 Reachable: the home server is up and will fan out revocations; the client gets an assertion once the home server's limits allow
HTTP 200 with an IdentityState that fails verification Run 02's unknown-kid refetch if the key was unknown, and verify again. If it still fails: Reachable, and the administrator is alerted. Never Unreachable.
HTTP 200 with a valid IdentityState Reachable. The server stores it if newer. If the session's device was enrolled and the IdentityState no longer lists it active with the same dkf and igen, the device is no longer valid.
HTTP 410 application/problem+json with code identity.account_deleted, or 404 with code identity.not_found (07 §11.9) The account is gone
Any other 4xx, or a 3xx Unreachable, and logged for the administrator. A bare 404 from a misrouted proxy or a half-deployed home server is an outage, not a deletion.
Any other response Reachable

An unreachable result for a home domain MAY be reused for every session of that domain for 60 s. A reachable result MUST NOT be reused for another account.

Rationale: probing the account's own IdentityState, rather than only /meta, exercises the home server's API and at the same time tells the remote server whether the device is still valid. Only the home server's explicit answers end a session: 07 treats identity.account_deleted as positive evidence of deletion, and the response comes over TLS from the pinned base URL. Sharing only negative results avoids a probe storm during an outage without letting one account's fresh answer stand in for another's.

6.7 Session state machine

State Event Action Next state
(none) Create request passes §6.3 Issue token; verifiedAt = now; expiresAt = now + 1 h active
active Renewal passes §6.3 New token; old token valid 60 s more; expiresAt = now + 1 h active
active Extension granted (§6.6) expiresAt = min(now + 1 h, extendableUntil) extended
extended Extension granted As above extended
extended Renewal passes §6.3 New token; verifiedAt = now; expiresAt = now + 1 h active
active, extended expiresAt passes Invalidate tokens; close WebSockets as below, with problem core.token_expired (ended: expired)
active, extended Extension refused at the limit and expiresAt passes As above (ended: extension_limit)
active, extended Any end trigger of §6.8 Invalidate tokens; close WebSockets as below, with problem federation.session_ended (ended)

Closing WebSockets. When a session ends or expires, the server, on each of its WebSocket connections: sends the federation.session_ended event (§6.8), which carries the retry hint; then sends 03's session.closing with reason session_ended, reconnect false, and the problem object named above; then closes with code 4004 (03 §5.10). The client acts on federation.session_ended and retry; 03's close-code handling gives the same result for clients that only know 03.

An ended session never comes back. A client that wants to continue creates a new session.

6.8 Ending sessions

A remote server MUST end a session, within the stated time, when:

Trigger reason Deadline Client retries?
device.revoked for the session's did accepted (§11.4) device_revoked 60 s Yes; the home server will refuse the revoked device, which then signs in again
identity.changed accepted, and the session's enrolled device is no longer valid under the new IdentityState (§11.4) identity_changed 60 s Yes
account.deleted accepted, or a probe got the home server's explicit deletion answer (§6.6) account_deleted 60 s No
A verified HomeAssertion or IdentityState shows a different inc for the session's account (§11.6) account_deleted 60 s No
account.suspended accepted (05 §11.8, §11.4) admin 60 s Yes (the home server then refuses the assertion with account.suspended, and the client stops as §6.10 says)
The account's home domain becomes blocked (§12) blocked 60 s No
The issuer key that verified the session's last assertion is revoked (§6.2) key_revoked 60 s Yes
A moderation action of 10 that ends sessions (for example a ban) moderation As 10 specifies As 10 specifies
A fifth concurrent session for the same (account, did) replaced Immediately No (the newer session is in use)
DELETE …/sessions/current signed_out Immediately No
The administrator ends it admin Immediately Yes

Ending a session means: invalidating all its tokens at once; closing its WebSocket connections as §6.7 describes; revoking its voice leases through 15, so the participant is cut within the 4 s of HP-15; and stopping delivery of any further events to it. Requests made with its token afterwards fail with 401 federation.session_ended, with data.reason set to the reason and data.retry set as in the table. The problem object's retryable equals data.retry, and its userAction is retry when data.retry is true and none otherwise.

federation.session_ended event (ephemeral, no seq, ctx = me):

Member of d Type Required Meaning
sessionId string Yes The ended session.
reason string Yes One of the reasons above, or expired or extension_limit (§6.7). A client treats an unknown value as admin.
retry boolean Yes Whether the client should silently try to create a new session.
{
  "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 }
}

Updating, not ending: when identity.changed leaves a session's device valid (for example another device was added, or an insecure account turned on encryption), the server keeps the session and updates its account.security, device.enrolled and secureAccess from the new IdentityState (§7.2).

6.9 Limits

Limit Value
Session request body 64 KiB
HomeAssertion / DeviceProof / DeviceCertificate / IdentityState sizes 4,096 / 1,024 / 2,048 / 32,768 octets (DeviceCertificate and IdentityState limits as 07 §4.1 defines them)
Live sessions per (account, did) 4
Session creations and renewals A server MUST allow at least 30 per minute per account and at least 600 per minute per issuing domain, and MAY refuse more with core.rate_limited
Extensions At most one per session per 300 s; further requests fail with core.rate_limited
Replay-cache retention Until the assertion's exp + 60 s

6.10 Client behaviour

The client rules below are normative for every client class.

  1. Lazily, once. A client creates a remote session when it first needs a server (opening a context, following a link, joining a call, or subscribing on the WebSocket). It 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 (12 §9.2). It MUST NOT contact the hosting server of a message request the user hasn't accepted, or of a declined or blocked entry (D-049). It MUST NOT have more than one creation request in flight per remote server.
  2. Resolve first. It resolves the remote domain itself (02; web clients through {home}/v1/resolve or DNS-over-HTTPS, D-029), learns the canonical domain, and requests the assertion with that aud. If the aud in the assertion response differs from what it resolved, it MUST NOT present the assertion; it re-resolves once, and if the two still differ it treats the server as unreachable.
  3. Sign promptly. An enrolled device signs the DeviceProof and sends the session request within the DeviceProof's 60 s.
  4. Renew silently. The client renews at a random moment between expiresAt − 600 s and expiresAt − 300 s, and after any federation.session_ended with retry: true. Renewal needs a new assertion and, for enrolled devices, a new DeviceProof. After each renewal it sends session.reauth with the new token on its sockets at that server (03 §5.13).
  5. Home unreachable. If the assertion request fails with a network error, a timeout or HTTP 5xx, the client retries every 60 s. Once fewer than 900 s remain on the session and at least two attempts at least 30 s apart have failed, it calls …/sessions/current/extend. While the session is extended it tries its home server every 300 s (±30 s random jitter) and renews as soon as an assertion is available.
  6. After enrolment. When the device becomes enrolled (pairing, recovery or turning on encryption, 08), the client renews its session at every remote server at once, so that gate cards G1 and G2 resume their interrupted actions (00 §4.12.2).
  7. Error handling.
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 (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 Wait and retry with back-off; show the status line of §15.
federation.home_reachable Retry the assertion request at once; if the home server still can't be reached from the client, 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 (§15).
federation.session_ended Follow retry (in the event, or data.retry in the problem object); with retry: true create a new session silently, at most 3 times per 10 minutes per server.
core.token_expired Create a new session silently.
account.suspended (which also covers a server-scope ban, 10 §9.3), security.upgrade_required from the home server Stop creating remote sessions and show the home account's state (05, G1).
  1. No prompts. None of these steps asks the user anything (00 §4.12.5). Session tokens are stored like home tokens in the platform's secure storage (08) and are never logged.

7. Enforcing SM-4 at remote servers

7.1 The doors

A hosting server enforces SM-4 for remote users from the session's current account.security and device.enrolled, which come from the HomeAssertion's sec and enr claims and are kept current from IdentityState (§7.2). For home sessions it uses the account and device records of 05 and 07; the results MUST be identical for the same account state.

Door (owner of the endpoint) Requirement Refusal
Joining the community of a secure server (09) security = secure 403 security.account_required
Opening a secure context: timeline, SealedMessages, attachments, members' read state, manual history shares (09, 11, 14) security = secure and enrolled 403 security.account_required, else 403 security.device_not_enrolled
Any MLS Delivery Service operation of a secure context: GroupInfo, commits, Welcome, proposals (13) As above, plus the leaf's credential checks of 07 and 13 As above, or the code of 13
Joining or staying in a call of a secure context (15) As above As above
Acting in an existing secure DM or group DM from this session, or creating the MLS group of one (12, 13) As above As above
Anything in an insecure context Any valid session —

A server checks security.account_required before security.device_not_enrolled. A secure account on an unenrolled device may join a secure server's community but can't open any channel there (SM-4, Matrix A row A7).

Whether an account may be added to a DM or group DM, and the resulting mode, is decided by 12 from the participants' IdentityStates (D-050), 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 (SM-9, D-069), and the adder's client offers "Start a new group without encryption". A 1:1 DM with an insecure participant is created insecure, not refused (SM-8).

7.2 Changes during a session

The session's view of the account is a snapshot that the server MUST update whenever it stores a newer verified IdentityState for the account, whether from identity.changed, a fetch, a probe or another session's request:

New IdentityState shows Session was Result
A different inc (a new account at the address, D-086) Any Session ended, reason account_deleted (§11.6)
sec = insecure (downgrade) Enrolled Session ended, reason identity_changed
sec = insecure Not enrolled security = insecure, secureAccess = none
sec = secure, same igen, device still active with the same dkf Enrolled No change
sec = secure, different igen, or device not active, or device revoked Enrolled Session ended, reason device_revoked if revoked lists the session's device, otherwise identity_changed
sec = secure Not enrolled (account upgraded, or device still unenrolled) security = secure; enrolled stays false until the client renews with a DeviceProof

A session's enrolled flag becomes true only through a create or renew request that passes §6.3.3. Events and fetches can only lower a session's access or end it.

Rationale: raising access needs proof from the device itself; lowering it needs only the home server's word, which is the safe direction.

7.3 Extended sessions

While a session is extended, its home server can't confirm anything, so the remote server limits it:

Action Allowed while extended?
Reading and posting in insecure contexts the account is already a member of Yes
Joining an insecure channel, or the community of an insecure server Yes
Reading and posting in a secure context where the device already has a leaf; committing pending server proposals (13); creating and fetching manual history shares (14); staying in a secure call Yes
Anything that admits a new leaf or a new secure membership for the device: external commits (including resync), being added by Welcome, joining a secure channel, joining a secure server's community, creating a secure DM No: 503 federation.home_unreachable
Anything else for which 07 or 13 needs an IdentityState validated within the last 300 s that the server can't obtain No: 503 federation.home_unreachable

secureAccess is existing_only for an enrolled extended session and none otherwise.

Rationale: new joins in secure contexts rely on the hosting server's Authentication Service check against a fresh IdentityState (D-035). During a home outage nobody can give it one, so the safe answer is to keep existing conversations working and refuse new secure admissions until the home server is back.

8. Server-to-server requests

8.1 Which requests are S2S

An S2S endpoint is an endpoint its owning document designates as server-to-server. In v1 these are:

Endpoint Owner Purpose
POST {base}/v1/federation/events 06 Event ingest (§9)
POST {base}/v1/federation/keypackages/claim 13 KeyPackage claims forwarded by a claimer's home server
POST {base}/v1/community/membership-check 09 Membership lookup for the auto-accept rule of 12
GET {base}/v1/reports/{id}/evidence/{mid} 10 Evidence of a forwarded report, fetched by the receiving home server for 30 days (10 §10.8)
GET {base}/v1/reports/{id}/evidence/{mid}/attachments/{attachmentId} 10 Attachment blob of forwarded evidence (10 §10.8)

Every request to an S2S endpoint MUST carry exactly one Authorization: Bearer <sv-s2s+jwt> header and nothing else that authenticates. An S2S endpoint MUST refuse home session tokens, remote session tokens and bot tokens with 401 federation.s2s_unauthenticated (data.reason = missing); 06 owns S2S authentication, so this code takes the place of the generic core.unauthenticated of 03 §3.2 rule 4 on S2S endpoints. A client endpoint MUST NOT accept an S2S token as a substitute for a session.

Public lookups. The public lookups of §10.3 need no authentication. As 03 §3.2 rule 8(a) records, a server MAY present an S2S token on the GET lookups of §10.3 (07 §11.2 gives authenticated peers a higher rate limit). The receiver MAY verify it (§8.5) and, if it verifies, apply its per-peer limits instead of its per-IP limits. A receiver that doesn't verify it, or whose verification fails, MUST ignore the header and answer as for an unauthenticated request; it MUST NOT answer 401 because of it. The probe of §6.6 never carries a token.

A document that adds an S2S endpoint designates it as such in its own path space (00 §7.3), states that it uses this section, and lists it here through the lead.

8.2 Token claims

The JWS header is {"alg": "EdDSA", "typ": "sv-s2s+jwt", "kid": "<sender canonical domain>#<keyId>"} (§3.2).

Claim Type Required Meaning and constraints
iss string Yes The sender's canonical domain (D-027).
aud string Yes The destination's canonical domain.
htm string Yes The HTTP method in upper case, for example POST.
htu string Yes The full target URI of the request, normalized as in §8.3 (scheme, host, port if not 443, path and query; never a fragment).
bh string When the request has content Base64url (no padding) of the SHA-256 of the request content (§8.4). MUST be absent when the request has no content.
iat integer Yes NumericDate.
exp integer Yes iat < exp ≤ iat + 60. Senders SHOULD use exactly iat + 60.
jti string Yes At least 16 random bytes, base64url (§4.5). Single use at the destination.

A serialized S2S token MUST NOT exceed 4,096 octets. Receivers MUST ignore unknown claims, except that an object containing nbf is rejected (04 §6.6).

{ "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"
}

8.3 Normalizing the target URI

Sender and receiver both compute normalize(uri) and compare the results octet for octet:

  1. Parse uri as an absolute URI (RFC 3986). The scheme MUST be https. There MUST be no userinfo. Drop any fragment.
  2. Lowercase the scheme and the host. A host that is a domain name is written as a lowercase A-label (01).
  3. Remove the port if it is 443.
  4. If the path is empty, set it to /.
  5. In the path and the query: write the hexadecimal digits of every percent-encoding in upper case, and decode every percent-encoded octet that is an unreserved character (ALPHA / DIGIT / "-" / "." / "_" / "~").
  6. In the path only, also decode %3A to :. (Context references contain a colon, which clients and servers may percent-encode, 00 §7.3.)
  7. Remove dot segments from the path (RFC 3986 §5.2.4).
  8. Reassemble as scheme "://" host [":" port] path ["?" query].

A sender MUST put normalize(target) in htu. It SHOULD send the request to exactly that URI, without dot segments and with context references unencoded.

The receiver builds the expected value from the scheme, host and port of its own configured public base URL (02), not from the Host header, followed by the request-target exactly as it appeared on the wire (the RFC 9112 origin-form, or the HTTP/2 and HTTP/3 :path pseudo-header), before any decoding by the server framework: normalize(origin(baseUrl) + request-target). The request-target already contains the base URL's path (for example /server/v1/federation/events). Behind a reverse proxy that rewrites paths, the server reconstructs the public request-target, the one the sender used.

Rationale: binding the full normalized URI, rather than only the path, means a token for one server on a shared deployment (00 §3.4: /server and /server2 on one host) can't be used against the other, and normalization keeps harmless encoding differences from breaking verification.

8.4 Body hash

bh is computed over the request content: the octets of the message body after any transfer coding and any content coding have been removed (RFC 9110 §6.4, §8.4). Senders SHOULD NOT apply a content coding to S2S requests. A request has content when its content is one octet or longer.

Because every S2S body is JSON, the sender MUST serialize the body once, hash those exact octets, and send the same octets.

8.5 Verification at the receiver

Step Check Failure (federation.s2s_unauthenticated unless stated; data.reason)
R1 Exactly one Authorization: Bearer header carrying at most 4,096 octets. missing, malformed
R2 JWS header per 04: alg = EdDSA, typ = sv-s2s+jwt, kid present, and no header member other than alg, typ and kid (04 §6.2; any other member, including crit, fails malformed). alg, typ, malformed
R3 All required claims present with the right types; jti and bh canonical base64url. claims
R4 iss is a lowercase A-label domain and the kid domain part equals it. kid
R5 aud equals this server's canonical domain. audience
R6 htm equals the request method. method
R7 normalize(htu) equals the expected value of §8.3. uri
R8 Content present ⇒ bh present and equal to the hash of the content; content absent ⇒ bh absent. body_hash
R9 Times per §3.3 with maximum lifetime 60 s. expired, not_yet_valid, lifetime
R10 Resolve iss (§3.1). Unresolvable: 503 federation.issuer_unreachable. Suspended: continue with the keys in the pin only (§13.4). The metadata (or pin) canonicalDomain MUST equal iss (D-027). issuer_not_canonical
R11 Obtain the key (§3.2). For a suspended issuer, a key that isn't in the pin fails with 503 discovery.peer_suspended. key_unknown, key_status
R12 Signature, with 04's strict Ed25519 rules. signature
R13 iss isn't blocked by this server's federation policy (§12.3), checked against the name iss and the resolved peer. 403 federation.blocked
R14 Atomically insert (iss, jti) into the replay cache with expiry exp + 60 s; if present, fail. replayed

Steps R1–R9 need only local data and MUST be completed before any network activity, including resolution.

A request that passes is authenticated as coming from the peer iss. Its handler MUST use iss as the request's origin and MUST NOT trust any origin named in the body instead.

A 401 response carries WWW-Authenticate: Bearer realm="<this server's canonical domain>", error="invalid_token" (03 §3.3) in addition to the problem object.

Rationale for the order: the cheap local checks come first, so junk never makes the server resolve a domain a stranger chose. Comparing htm, htu and bh before the signature is safe, because a mismatch is a failure either way. The policy check comes after the signature so that only the blocked peer itself learns of a block (§12.4). The replay check is last so an attacker can't fill the cache with unverified tokens.

8.6 Replay caches

A server keeps two replay caches: HomeAssertion jti values (§6.3 V16) and S2S token jti values (R14), each keyed by (iss, jti). Each entry lives until the token's exp + 60 s. The caches MUST be shared and updated atomically across every node and process that serves the server. If the cache is unavailable, the server MUST fail closed with 503 core.unavailable, never accept without the check.

Senders MUST create a new token, with a new jti, for every attempt, including retries of the same request.

After a restore from backup, or any other loss of replay-cache contents, a server MUST, for 360 s after it resumes serving (the longest token lifetime, 300 s, plus 60 s of skew), refuse every HomeAssertion and S2S token whose iat is earlier than the moment serving resumed: 401 federation.assertion_replayed for assertions, and 401 federation.s2s_unauthenticated with data.reason replayed for S2S tokens (21 §11.6.4 step 6). Honest clients and senders retry with fresh tokens (§6.10, §8.6).

8.7 Transport rules for S2S requests

  • HTTPS to the peer's base URL from discovery, with WebPKI certificate validation for its host, TLS 1.2 or later (TLS 1.3 RECOMMENDED) (00 §7.3).
  • No redirects. A 3xx response is a failed attempt.
  • Content-Type: application/json for every request with content.
  • Timeouts: 10 s to connect (including TLS), 30 s for the whole exchange.
  • Senders SHOULD reuse connections (HTTP/2 or later RECOMMENDED) and SHOULD NOT open more than 8 concurrent requests to one peer.
  • Responses aren't signed. Their authenticity rests on TLS to the pinned base URL (02).
  • Senders SHOULD send a User-Agent that names the server software and version, and MUST NOT put user data in it.
  • Receivers MUST allow each authenticated peer at least 10 requests per second sustained, with bursts of 50, on /v1/federation/events, and answer 429 core.rate_limited with Retry-After beyond their limits (00 §7.11).

9. S2S event delivery

9.1 The ingest endpoint

POST {base}/v1/federation/events
Authorization: Bearer <sv-s2s+jwt>
Content-Type: application/json

Every S2S event, of every type and from every origin, is delivered through this one endpoint. A request carries a batch of 1 to 100 events from one origin to one destination.

When origin and destination are the same server (for example a DM hosted on the recipient's own home server), the server delivers the event internally, with the same semantics (deduplication, subject binding, owner processing) and without HTTP.

9.2 The S2S event envelope

Member Type Required Meaning and constraints
id string Yes Event ID: a UUIDv7 (lowercase, hyphenated) generated by the origin. Unique among all events the origin ever sends. Retries of the event reuse it.
t string Yes Event type, <area>.<name> (00 §7.5), from the catalogue (§10) or a later registration.
ts string Yes When the origin created the event, RFC 3339 with milliseconds, UTC.
orderKey string No 1–256 characters. Events from one origin to one destination with equal orderKey are delivered in creation order (§9.6). Absent: no ordering.
expiresAt string No RFC 3339. After this time the origin stops trying and a receiver ignores the event.
d object Yes The payload, defined by the owner of t.

The envelope carries no origin: the origin is always the S2S token's iss. Events aren't signed individually; payloads embed signed objects (such as an IdentityState) where their owners require it. A server MUST NOT forward another server's S2S event to a third server as though it came from the original origin.

A serialized event (the envelope object, including d) MUST NOT exceed the destination's maxFederationEventBytes (§17.3: default 128 KiB, floor 128 KiB).

9.3 Request and response

Request body.

Member Type Required Meaning
events array of S2S event Yes 1–100 events. The whole body MUST NOT exceed the destination's maxRequestBytes (03). No two events in one batch may share an id.
{
  "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…" }
    }
  ]
}

(07 defines the device.revoked payload; the state JWS is abbreviated here.)

Response body (200). One result per event, in the same order as the request.

Member Type Required Meaning
results array Yes Exactly one EventResult per request event, same order.

EventResult:

Member Type Required Meaning
id string Yes The event's id.
status string Yes accepted, duplicate, ignored, rejected or deferred (below). A sender treats an unknown value as deferred.
error object When rejected; MAY with deferred An RFC 9457 problem object (00 §7.9).
retryAfterMs integer No With deferred: the earliest useful retry.
status Meaning Sender action
accepted Durably stored or applied. Processing will complete. Done.
duplicate Already received earlier (any earlier outcome). Done.
ignored Valid but not applicable: unknown event type, past expiresAt, or about a subject the receiver doesn't know. Done.
rejected Permanently refused; retrying won't help. Drop; log; call the owner's give-up hook (§9.7).
deferred Temporarily refused. Retry the event later (§9.7).
{
  "results": [
    { "id": "0193a1f0-6b2c-7d4e-8f90-0a1b2c3d4e5f", "status": "accepted" }
  ]
}

If results is missing, too short, or doesn't match the request's IDs in order, the sender treats every event without a matching result as deferred.

Whole-request outcomes.

Response Meaning Sender action
200 Per-event results As above
400 federation.batch_invalid The batch as a whole is malformed (not JSON, events missing or empty, more than 100 events, duplicate IDs) Resend each event alone, once; an event that still gets 400 is dropped
401 federation.s2s_unauthenticated Token refused Retry with back-off; keys may be propagating
403 federation.blocked The destination blocks the origin Drop every queued event for that destination; pause the destination for 24 h (§12.5)
413 core.too_large Batch too large Split the batch and resend; a single event that gets 413 is dropped
429, 5xx, 503 discovery.peer_suspended, 503 federation.issuer_unreachable, network error, timeout Temporary Retry the whole batch with back-off, honouring Retry-After
Any other status Unexpected Retry with back-off until the events' 24 h end

Receivers SHOULD answer within 10 s. They achieve this by storing events durably and processing them asynchronously; processing deadlines set elsewhere (such as the 60 s of §11.4) still apply.

9.4 Receiver processing

For each event, in array order, the receiver:

  1. Validates the envelope: id is a UUIDv7, t matches <area>.<name>, ts is a valid timestamp no more than 300 s in the future, d is an object, and the serialized event fits maxFederationEventBytes. Failure: rejected with federation.event_invalid or federation.event_too_large.
  2. If expiresAt has passed: ignored.
  3. If ts is more than 25 h in the past: rejected with federation.event_expired.
  4. If (iss, id) is in the dedupe store: duplicate.
  5. If an earlier event in this batch with the same orderKey was deferred: deferred (§9.6).
  6. If t is unknown: ignored (00 §7.8).
  7. Checks the subject binding of the event type (§10.1). Failure: rejected with federation.event_not_authorized, or with the code the owner defines for the same failure (§10.1).
  8. Every address and domain in d passes 01 §7.5 checks 1 to 5, and check 6 for addresses at the receiver's own server (01 §7.6); failure: rejected with address.non_canonical. Then validates d as the type's owner specifies. Failure: rejected with federation.event_invalid, or with a code the owner defines. An event about an account or context of the receiver's that doesn't exist is ignored (§10.1).
  9. Durably stores or applies the event and inserts (iss, id) with its outcome into the dedupe store, atomically: accepted. On a temporary failure (storage unavailable, a dependency down): deferred, without a dedupe entry.

Outcomes of steps 1–8 other than deferred also SHOULD be recorded in the dedupe store, so a resend gets duplicate.

The receiver MUST process each (iss, id) at most once. Processing is idempotent from the origin's point of view: whatever happened the first time, a resend returns duplicate.

9.5 Deduplication

  • The dedupe key is (origin canonical domain, event id).
  • A receiver MUST keep each key for at least 48 h after it first received the event.
  • Together with the 25 h age limit of §9.4 step 3, this guarantees that no event inside its retry window can be processed twice.
  • A receiver MAY also store a hash of the event and log a reused ID whose content differs; it still answers duplicate.

Rationale: senders give up 24 h after ts (§9.7). Rejecting anything older than 25 h means a receiver never has to remember IDs for longer than 25 h plus the skew; 48 h leaves a wide margin for clock errors.

9.6 Ordering

  1. Events carry no global order. A receiver MUST NOT assume that events with different orderKey values, or without one, arrive in creation order.
  2. For one (origin, destination, orderKey), the origin delivers events in creation order: it MUST NOT send an event while an earlier event with the same key to the same destination is unacknowledged (no final status yet), and within one batch it lists such events in creation order.
  3. A receiver processes events with the same orderKey in batch order, and once it defers one, it defers every later event with that key in the batch.
  4. A receiver MUST complete the processing of accepted events with the same (origin, orderKey) in the order it accepted them, across batches, even when it processes events asynchronously after storing them.
  5. A rejected, ignored or duplicate event counts as acknowledged and doesn't block later events with its key.
  6. Payload owners SHOULD make processing robust to reordering anyway, for example with version numbers (IdentityState ver) that let a receiver discard stale information.

The catalogue (§10.1) states each type's orderKey.

9.7 Retries, back-off and giving up

Queues. An origin keeps, per destination, two durable queues, one per lane (§9.8). An event is enqueued in the same transaction as the change that causes it (an "outbox"), so a crash can't lose it. An action whose effect includes an S2S event (for example a device revocation) MUST NOT report success to its caller before the event is durably enqueued.

Back-off. Back-off is kept per destination and lane. An attempt fails when the whole request fails, or when no event in it was acknowledged (every result deferred). An attempt in which at least one event was acknowledged (accepted, duplicate, ignored or rejected) succeeds. After a successful attempt, each deferred event waits delay(k) before it is sent again, where k counts how many times in a row that event has been deferred; later queued events with the same orderKey wait behind it (§9.6), while the rest of the lane continues. After a failed attempt, the next attempt for the affected events waits

delay(n) = min(2^(n−1), 3600) seconds × u,   u uniform in [0.8, 1.2]

where n counts the consecutive failed attempts (1 after the first failure). Retry-After or retryAfterMs, if larger, replaces the delay. A successful attempt resets n to 0 for that destination and lane, and the queue is flushed at once. New events for a destination that is backing off wait for its next attempt.

Nominal schedule (without jitter), counting from an event's creation if its destination is down the whole time: 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, at 7,695 s, 11,295 s, … up to 83,295 s: 35 attempts in total.

Giving up. The origin MUST NOT start an attempt for an event after ts + 24 h, or after its expiresAt if earlier. Such an event is dropped and logged, and the origin runs the give-up hook of its type's owner, if the owner defines one (§10.1).

Durability. Queued events survive restarts. A server that is itself down for longer than 24 h drops what it couldn't send in time when it comes back.

9.8 Lanes and batching

Lane Event types Batching Concurrency per destination
high identity.changed, device.revoked, account.deleted, account.suspended; notify.event with an expiresAt 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: a backlog or back-off in the normal lane never delays the high lane. The ordering rule (§9.6) applies within a lane only: two events with the same orderKey in different lanes (for example a call ring and a message notification for the same recipient) are not ordered relative to each other, and their owners MUST NOT depend on such an order.

Rationale: revocations must reach audiences within about 10 s (§11.3) even while a peer is digesting a burst of notifications or DM requests.

10. S2S catalogue index

10.1 Event types

This index lists every S2S event type registered in v1. The payload (d) of each is defined only by its owner. The columns other than "Payload owner" are normative here. Owners that register further types MUST add them here, through the lead ("Registering more types" below).

Type Origin → destination Payload owner Lane orderKey Subject binding the receiver MUST check expiresAt Give-up hook
identity.changed Home server → each audience of the account (§11) 07 high d.sub The domain of d.sub equals iss None None: IdentityState expiry (≤ 24 h) bounds staleness
device.revoked Home server → each audience 07 high d.sub The domain of d.sub equals iss None None
account.deleted Home server → each audience (§11.1) (05 §16) 05 high d.addr The domain of d.addr equals iss None None
account.suspended Home server → each audience of the account (§11) 05 high d.addr The domain of d.addr equals iss None None: a remote session still ends at its next renewal, at most 1 h later (05 §11.8)
account.profile_changed Home server → each audience 05 normal d.addr The domain of d.addr equals iss None None: losing it is harmless (05 §17.4)
dm.request Hosting server → each recipient's home server 12 normal d.ctx d.host equals iss; d.recipient is at the receiver's canonical domain. Then the host legitimacy check of 12 §8.4 step 3, whose failure code is dm.host_mismatch None 12 re-sends the invitation at the next content event (12 §15)
dm.response Recipient's home server → hosting server 12 normal d.ctx The domain of d.recipient equals iss (12 §8.5). A ctx the receiver doesn't host: ignored None None
dm.entry_updated Hosting server → a participant's home server 12 normal d.ctx d.recipient is at the receiver's canonical domain. The receiver applies it only to an existing DM index entry for (iss, d.ctx) (12 §8.6); otherwise ignored None None
notify.event Hosting server → recipient's home server 19 normal; high when it expires within 120 s of ts d.recipient d.host equals iss; d.recipient is at the receiver's canonical domain. 19 §5.6 and §6.1 add legitimacy checks whose failure is ignored Set by 19 (for example for call rings) None: a missed notification is dropped
report.forwarded Forwarding server (the hosting server, or the reporter's home server, 10 §10.10) → the reported account's home server 10 normal d.reportId d.origin equals iss; d.target is at the receiver's canonical domain (10 §10.9) None None
discovery.metadata_changed Any server → the peers it exchanged S2S requests with in the last 30 days, and every audience peer of its accounts (§11.1) (02 §16.1) 02 high when d.urgent is true, otherwise normal None None beyond authentication: the receiver refetches the metadata of iss only, and takes no value from d (02 §16.1) None None

How bindings are checked. A context is identified by the pair (hosting server, ctx), and for every event that a hosting server sends about one of its contexts, the hosting server is iss. A receiver therefore never has to recompute a hosting rule to check a binding: it compares the origin-naming member of d (host, origin, or the domain of a subject address) with iss, and checks that the addresses the event is delivered to are at the receiver's canonical domain. Where an owner defines a further legitimacy check (such as 12's recomputation of a dm: reference), the owner's procedure and code apply.

Binding failures and unknown subjects. A binding fails, with rejected and federation.event_not_authorized, only when an origin-naming member doesn't equal iss, or when a subject the event is delivered to is not at the receiver's canonical domain. An owner-defined code for the same failure (for example dm.host_mismatch) takes precedence over federation.event_not_authorized. A subject that is at the receiver's canonical domain but doesn't exist, or a context the receiver doesn't know, yields ignored, not rejected, so that a probing peer can't learn which accounts exist from the answers. There is no exception: 12 answers a dm.request for a missing or deleted recipient with ignored (12 §8.4 step 2), and the hosting server learns of deletions through account.deleted.

Incarnations (D-086). An event names an account by canonical address. Where its payload also carries the account's incarnation (d.inc of 05's account.* events, the IdentityState in 07's events, recipientInc in 12's events, targetInc in 10's report.forwarded), the receiver applies the event only to that incarnation. An event whose incarnation for an account homed at the receiver isn't that account's current inc is answered ignored, like an unknown subject. For another server's account, an older incarnation's event touches only records of that incarnation, and a newer one triggers §11.6.

Registering more types. A document MAY define further S2S event types in its own areas (00 §7.5) through 03's event-type registry. Its definition MUST state the payload, origin and destination, lane, orderKey, subject binding, expiresAt use and give-up hook, and the lead adds it to this index. A receiver that doesn't know the type answers ignored, so new types are additive.

10.2 S2S requests that are not events

Request Origin → destination Owner
POST {base}/v1/federation/keypackages/claim A claimer's home server → the target account's home server 13
POST {base}/v1/community/membership-check A recipient's home server → a community on the recipient's community list 09
GET {base}/v1/reports/{id}/evidence/{mid} The reported account's home server → the forwarding server 10
GET {base}/v1/reports/{id}/evidence/{mid}/attachments/{attachmentId} The reported account's home server → the forwarding server 10

These are authenticated as in §8 and are synchronous: their response carries the result. They are not retried by the event machinery; their owner specifies retries.

10.3 Public lookups used in federation

Lookup Owner Notes for federation
GET https://<fqdn>/.well-known/sloppyv, GET {base}/meta, GET {base}/v1/resolve 02 Discovery, keys, pinning.
GET {base}/v1/users/{local}/identity 07 IdentityState of any account. Used in §6.3.1 and as the probe of §6.6. A hosting server caches it at most until its exp and follows 07's 300 s freshness rule for admissions.
GET {base}/v1/users/{local}/profile 05 Display data of a remote account. A server SHOULD cache it for no more than 24 h.
GET {base}/v1/addresses/{local} 01 What an address names.

These are public, CORS-enabled and rate-limited by their owners (00 HP-7). A server MAY attach an S2S token to the /v1/ lookups to obtain per-peer limits, under the rules of §8.1; the probe of §6.6 never carries one.

11. Audience tracking and revocation fan-out

11.1 The audience set

For each account it homes, a home server MUST maintain the account's audience set: the peers (by canonical domain) that must hear about revocations, identity changes and deletion of the account. A peer is in the set while at least one of these sources holds:

Source Added when Removed when
assertion The home server issues a HomeAssertion for the account with that aud (§4.2 step 9) 30 days after the last such issuance
dm_index The account's DM index (12) has an entry, in any state, whose hosting server is that peer (12 §9.2) No such entry remains
community_list The account's community list (09) contains the peer The entry is removed

The home server itself is never in the set: it applies the effects locally. A peer blocked by the home server's policy (§12) gets only what §12.5 allows: the revocation and deletion events, for 30 days after the block.

Rationale for requested entries: in a secure DM, the Welcome carried by a dm.request already made the recipient's devices members of the group at the hosting server before the user accepts (12 §8.2), so that server must hear when one of those devices is revoked. The recipient's client still contacts no hosting server before Accept (D-049, §6.10). Declined and closed entries count too: a declined 1:1 participant keeps their leaves (12 §6.3), and a closed 1:1 DM can reopen (12 §13.4).

An audience record holds only the account, the peer's canonical domain, the time of the last assertion and the set of sources. A home server SHOULD support at least 10,000 audience peers per account. An audience set belongs to one account: a new account at a reused address (D-086) starts with an empty set, and a deleted account's set is used only to send its account.deleted (05 §16.2 step 7).

Proposed decision: The audience set MUST also include the servers on the account's community list (09); 00 HP-7 includes them too. Rationale: assertion recipients of the last 30 days and DM hosts alone would miss a community the member hasn't opened for 30 days. Such a member still has leaves in its secure channels until the 90-day eviction (D-059); including the community list lets those hosting servers remove the leaves of a reset or revoked device promptly. The cost is a few more events per revocation.

11.2 Triggers

Trigger (defined by) Event Sent for
The identity generation, security state or device set grows (07 §12.1): upgrade, re-upgrade, reset, downgrade, device registration identity.changed Every account, whatever its security state
A device record is revoked (05): a lost device, a revocation by the user or an admin, the shared-computer timeout, a sign-out that removes the device record device.revoked Every account, including insecure accounts and bots
The account is deleted (05) account.deleted Every account
The account is suspended: by the operator, by a server-scope ban of the local account (10 §9.3), or because a bot's owner is suspended (05 §11.2, §11.8) account.suspended Every account, bots included
The account's public profile changes (05 §17.4) account.profile_changed Every account

Delisting a device is announced by device.revoked alone; its state member carries the new IdentityState (07 §12.2). Audiences MUST process every event idempotently and in any order, using IdentityState ver to discard stale state.

Proposed decision: device.revoked is sent for every device revocation of every account, insecure accounts included. Rationale: an insecure user's stolen phone also holds remote sessions; revocation fan-out is the only way to end them before their hour runs out (D-017). 07's payload must therefore not require an identity-key DeviceRevocation.

11.3 Fan-out

  1. The home server MUST enqueue the event for every audience peer in the same transaction as the triggering change (§9.7), on the lane §10.1 gives (high for the revocation and deletion events).
  2. It MUST start sending within 1 s of the change.
  3. It MUST send to different peers concurrently: at least max(32, ⌈P / 50⌉) peers at a time, where P is the number of audience peers, or all of them if there are fewer. With peers that answer within about 200 ms, this reaches the 10,000 peers of §11.1 within about 10 s.
  4. Target: for 95 % of fan-outs, every reachable audience peer has acknowledged the event within 10 s of the change (00 HP-7). Peers that take much longer than 200 ms per request can delay large fan-outs beyond the target; operators SHOULD monitor it (21).
  5. Unreachable peers are retried by §9.7 for 24 h.

The same events also go to the account's own home-session devices as 07 and 05 specify; that isn't federation.

11.4 What an audience does

On accepting one of these events about an account A, a peer MUST, within 60 s:

Event Duties
device.revoked for device d End every remote session of (A, d) with reason device_revoked (§6.8), which also revokes its voice leases (15). Mark (A, d) as revoked, so that no new session (§6.3 V15) or leaf is admitted for it. Start removal of every leaf of d in every MLS group the peer hosts (13).
identity.changed If the new IdentityState's inc differs from the one recorded for A, apply §11.6 instead of the rest of this row. Obtain the new IdentityState: from the payload if 07 puts it there, otherwise by fetching it (07), retrying for up to 60 s. Invalidate the cached IdentityState for A (00 HP-2). Update or end each session of A by §7.2. Start removal (13) of every leaf of A that is no longer valid: a different igen, a device no longer listed, or a downgrade. Until the new IdentityState is in hand, admit no new leaf for A.
account.deleted For the records of incarnation d.inc only (records of another incarnation are untouched, 05 §16.4): end every session of A with reason account_deleted. Mark (A, d.inc) as deleted, so that no new session (§6.3 V15) or leaf is admitted for it. Start removal of every leaf of A (13). Process memberships and stored data as 05 and 09 specify. Delete cached profile and IdentityState data for A (§14).
account.suspended End every remote session of A with reason admin (§6.8), which also revokes its voice leases (15). Mark (A, d.inc) as suspended with the event's d.suspendedAt, so that V15 (§6.3) refuses assertions issued before it. Don't remove leaves, end memberships or delete data: suspension is reversible, and restoration sends no event (05 §11.8).

Revocation marks. A revoked mark for (A, d) and a deleted mark for (A, inc) are kept for at least 1 h after the event was accepted, which outlasts every HomeAssertion issued before the revocation (300 s) plus skew. A suspended mark for (A, inc) is kept for at least 1 h after the event was accepted; assertions issued after suspendedAt pass it, so a restored account works again at once. A peer MAY keep them longer. Rationale: without the marks, an assertion issued just before a revocation could still open a fresh one-hour session after the audience had processed the revocation, for insecure accounts too.

"Start removal" means the hosting server has cut delivery and leases and sent its Remove proposals as the external sender, as 13 specifies (D-037). The commit that completes removal may come later, from a member device.

Audiences MUST NOT forward these events to other servers. Every home server informs its own audiences; hosting servers inform group members through MLS (13).

If the event's subject is unknown to the peer (no sessions, leaves or memberships), it still records the revoked, deleted or suspended mark, answers ignored, and does nothing else. The mark matters most here: an assertion collected for this peer before the revocation hasn't been used yet.

11.5 Exposure bounds

The design bounds how long a revoked device keeps any access at a remote server:

Situation Bound
Audience reachable About 10 s for delivery + 60 s for the audience to act; voice cut within 4 s of the lease revocation (HP-15).
Audience unreachable from the home server, but the device's session there is live min(the session's remaining life, ≤ 1 h; the delivery time + 60 s). The revoked device can't renew: its home server refuses it an assertion.
Home server unreachable from the audience, so the session gets extended Up to 24 h after the last verification (§6.6): the accepted cost of keeping people online during home outages.
The device has no session at the peer It can't fetch anything there. Its stale leaves in that peer's groups are removed when the event arrives, or at the latest by 90-day eviction (13).

11.6 Incarnation changes (D-086)

Every account has an immutable incarnation value inc (05 §11.1), carried in HomeAssertions (§4.3), IdentityStates (07 §7.1) and the public profile (05 §17.1). A local part registered again after a deletion (01 §5.7) gets a new inc, so (address, inc) names exactly one account ever.

A server keys every record it keeps about an account of another server on (canonical address, inc): remote sessions and the marks of §11.4 (this document), community and channel memberships (09 §4), role assignments, member overwrites, timeouts and server mutes (10), DM participation (12 §6.3), MLS leaves (13), and the sender account recorded with each stored timeline entry, which decides who may edit or delete it (11 §5.1). Bans are the exception: they match the address alone, so they also apply to a later account at that address (10 §9.2, 01 §5.7). A home server applies the same rule to its own accounts in its hosting role.

When a server verifies a HomeAssertion (§6.3) or an IdentityState (07 §7.4), from any source, whose inc differs from the inc of its records for that address, it MUST, before it acts on the new object and at the latest within 60 s:

  1. process the records of the recorded incarnation exactly as §11.4's account.deleted row says, as if account.deleted for (address, recorded inc) had arrived: end those sessions with reason account_deleted, mark (address, recorded inc) deleted, start removal of every leaf with 13's reason account_deleted, and end memberships and DM participation as 09 §4.8 and 12 §6.4 specify for a deleted account;
  2. then treat the new incarnation as an account it has never seen: it has no sessions, memberships, roles, DM participation or leaves here.

An incarnation that a verifier has seen replaced never becomes current again: an IdentityState that names it fails with state_rollback (07 §7.4 step 9), and an assertion that names it fails V15 with account_deleted.

Rationale: account.deleted reaches only the account's audiences of the moment and is retried for 24 h (§9.7). A server outside them, or one that every retry missed, would otherwise give the new holder of a reused address the earlier person's memberships, roles and DM conversations once the 365-day quarantine ends. The new inc lets it recognise the new account the first time it sees it.

12. Federation blocks

12.1 Model

A server's federation policy decides which peers it federates with. It has a mode and a list of blocks:

  • open (the default): federate with every peer except blocked ones.
  • allowlist (OPTIONAL to implement): federate only with listed peers, and never with blocked ones.

Blocks are keyed by canonical domain and cover every alias (00 HP-7). Aliases are covered through resolution: resolving any alias of a peer yields the peer's canonical domain, and the block matches that. Matching never trusts the list of domains a peer publishes about itself, because any server can list any domain there (§19).

12.2 Objects

FederationBlock

Member Type Required Meaning
domain string Yes The blocked server's canonical domain, or, if it couldn't be resolved, the domain as entered (lowercase A-label) (a provisional value permitted by 01 §7.7).
resolved boolean Yes Whether domain is a canonical domain obtained from discovery.
includeSubdomains boolean Yes When true, the block also covers every domain that ends with "." + domain. Default false.
note string No Private administrator note, at most 500 characters. Never sent to any peer.
createdAt string Yes RFC 3339.
createdBy string Yes Canonical address of the administrator.

FederationPolicy

Member Type Required Meaning
mode string Yes open or allowlist. A server that doesn't implement allowlist mode rejects allowlist with 501 core.unsupported_feature (data.feature: "federation_allowlist").
allows array of string Yes Canonical domains federated with in allowlist mode (each covers its aliases as in §12.3). A PATCH resolves every entry and stores the canonical domain; an entry that can't be resolved is stored as given (lowercase A-label) (a provisional value permitted by 01 §7.7) and re-resolved at least every 24 h. Empty in open mode.
blockCount integer Yes Number of FederationBlocks.

12.3 Matching

A server decides whether a peer is blocked as follows, every time §4.2, §6.3, §8.5 or §12.4 asks:

blocked(name, peer):
    N := { name }                       # the domain as given or as signed (lowercase A-label)
    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 false

Checks "on the name" (before resolution, §4.2 step 4) use N = { name } and apply blocks only; the allowlist is evaluated only after resolution, so an alias of an allowed peer isn't refused before it has been resolved. Checks after resolution use both elements. A peer's self-published domains list is never added to N.

At least every 24 h, a server re-resolves the domain of every unresolved block and, on success, rewrites the block under the canonical domain it obtained (resolved becomes true). If two blocks then share a canonical domain, they merge (includeSubdomains is the logical OR, and the earlier createdAt and createdBy are kept).

12.4 Administration

These endpoints are for the server's administrators: they require a session (home, or remote for a remote admin) of an account that holds the admin system role (10 §4.2), to which 10 reserves federation blocks. Others get 403 core.forbidden with data.missingRole: "admin" (10 §6.3).

Request Body Response
GET {base}/v1/federation/policy — 200 FederationPolicy
PATCH {base}/v1/federation/policy {"mode": "allowlist", "allows": ["c.com"]} (either member optional) 200 FederationPolicy
GET {base}/v1/federation/blocks?cursor=&limit= — 200 {"items": [FederationBlock], "nextCursor": …} (00 §7.10)
PUT {base}/v1/federation/blocks/{domain} {"includeSubdomains": false, "note": "spam"} 201 (new) or 200 (updated) FederationBlock
DELETE {base}/v1/federation/blocks/{domain} — 204; 404 core.not_found if absent

PUT resolves {domain}: an alias is accepted, and the block is stored under the canonical domain that resolving it yields. If resolution fails, the block is stored unresolved and matches by name until a later resolution succeeds (§12.3). DELETE accepts an alias the same way. Blocking one of the server's own domains fails with 400 core.invalid_request. A server SHOULD support these endpoints so that generic admin tools work; it MUST enforce blocks whatever interface sets them.

Creating or updating a block writes a federation_blocked entry, and deleting one writes federation_unblocked, to 10's audit log (10 §11.3) in the same transaction, with restricted: true; the block's note isn't copied into the entry.

PUT {base}/v1/federation/blocks/spam.example

{ "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"
}

A server never publishes its policy or blocks in ServerMetadata and never tells a blocked peer it was blocked, except through federation.blocked answers to that peer's own requests.

Proposed decision: Federation blocks are administered through /v1/federation/blocks… and /v1/federation/policy by holders of the admin role, and allowlist mode is optional. Blocks and allowlist entries match only the name being checked and the canonical domain the server resolved itself, never a peer's self-published domain list. Rationale: an interoperable admin API costs little and lets one admin tool manage any implementation; allowlists serve private and corporate servers without burdening others; and a peer's own domain list can't be trusted to decide whom a block covers.

12.5 Effects

When server X blocks peer Y (or Y is outside X's allowlist), X MUST apply every effect below. Effects on existing state take place within 60 s of the block being created.

Area Effect at X
HomeAssertions X refuses to issue assertions with aud = Y: 403 federation.blocked. X's users can't visit Y.
New remote sessions X refuses assertions issued by Y: 403 federation.blocked.
Existing remote sessions Sessions of Y's accounts end with reason blocked, which revokes their voice leases.
Inbound S2S Every authenticated S2S request from Y (events, KeyPackage claims, membership checks) gets 403 federation.blocked (§8.5 R13).
Outbound S2S X drops its queues for Y and enqueues nothing new for Y, with one exception: for 30 days after the block, X keeps sending identity.changed, device.revoked and account.deleted about each of its accounts whose audience set had Y with source assertion when the block was created, so that Y can end those accounts' sessions and remove their leaves. X stops this at once if Y answers 403 federation.blocked. X claims no KeyPackages from Y.
Community membership Memberships of Y's accounts are kept unchanged, so unblocking restores them, but they can't connect. X removes their leaves from its MLS groups, as for any removal (13), recorded with reason federation_blocked; this isn't 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 (no sessions, no dm.request, no notify.event); X's users can still post, and their messages reach the participants who aren't blocked.
DMs hosted at Y X's users can't get assertions for Y, so their clients show those DMs as unavailable.
DMs and group DMs hosted at a third server Z that include Y's accounts X has no control over Z. X MAY drop, with ignored, a dm.request or notify.event from Z whose inviter or sender is homed at Y. X's clients SHOULD show Y's participants as unavailable ("Your server doesn't connect with b.com"); X's users can still talk to everyone else there.
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.

At the blocked peer. When Y receives 403 federation.blocked from X on an S2S request, Y drops every queued event for X and SHOULD pause deliveries to X for 24 h, then try again with the next event. Y's own users see that the servers don't connect (§15).

Unblocking. Deleting the block restores federation for new requests. Nothing is replayed: events dropped while the block lasted are gone. Y's users create new sessions as usual and their devices rejoin secure groups silently by external commit (13).

Blocks versus domain bans. A federation block stops all federation with a peer. A domain ban (10) only keeps a domain's accounts out of the community's membership; S2S traffic (DMs hosted here, revocations, notifications) continues. Administrators choose a ban for unwanted members and a block for an abusive server.

13. Outage behaviour

13.1 Home server down

Effect Behaviour
Existing remote sessions Continue until expiresAt. At renewal the client can't get an assertion and asks for an extension (§6.10 rule 5). The remote server probes the home server (§6.6) and, if it is unreachable, extends in steps of 1 h, up to 24 h after the last verification.
What still works Chat in every context the user already uses; staying in secure groups where the device already has a leaf; calls in progress and rejoins of them.
What doesn't New remote sessions (no assertions); new secure joins and new leaves for the user's devices anywhere (§7.3); DM requests, notifications and pushes to the user (they are queued at the hosting servers for 24 h, §9.7); KeyPackage claims for the user.
Revocations Can't be sent while the home server is down; this is the accepted cost of extensions (§11.5).
What the user sees A quiet status line: "Your server (a.com) isn't responding. You can keep chatting where you're already connected." No prompt.

13.2 Remote (hosting) server down

Effect Behaviour
The client Keeps outgoing messages with their client-generated IDs and retries (11, 12): 1 s, doubling to 60 s, then every 60 s while the app runs. Calls follow auto-rejoin (15). When the server answers again, the client creates a new session if the old one expired.
What the user sees Each waiting message shows "Waiting for b.com…". The context shows a status line saying the server isn't responding. No prompt, and nothing is lost.
Other servers Queue S2S events for it for 24 h (§9.7). Revocations missed for longer are covered by IdentityState expiry (≤ 24 h) and by the down server's sessions having expired long before (≤ 1 h).
When it comes back It processes delivered events, and treats every cached IdentityState as needing revalidation before admitting new leaves (07).

13.3 Network partition between servers

When the client can reach both servers but they can't reach each other:

  • A remote server verifies assertions with cached metadata and keys (02 allows stale use while the issuer is unreachable), and with the IdentityState the client presents. Session creation therefore usually works. It fails with 503 federation.issuer_unreachable only if the remote server has no usable cached keys, or needs an IdentityState it can't get (§6.3.1).
  • S2S events queue and retry.
  • If the session needs an extension, the probe fails, so the extension is granted; the 24 h bound still applies.

13.4 Key-set suspension

When 02 suspends a peer because its delegation or key set changed without continuity (02 §10.4, D-030), the server treats the peer as temporarily unreachable and trusts only the keys in its pin:

Effect Behaviour
Assertions for the suspended peer The home server refuses them: 503 discovery.peer_suspended (02).
Remote sessions of the suspended peer's accounts Creation and renewal work only with assertions that verify under a key in the pin (§6.3 V9, V10); any other key fails with 503 discovery.peer_suspended. The server sends nothing to the peer, so an enrolled assertion that would need an IdentityState fetch fails the same way (§6.3.1). Extensions are always refused (§6.6): suspension is a security event, not an outage.
Inbound S2S from it A server MUST accept a request whose token verifies under a key in the pin (02 §10.4 allows this; this document requires it); otherwise 503 discovery.peer_suspended. Accepted identity.changed, device.revoked and account.deleted events MUST be processed during the suspension, so revocations from the holder of the pinned keys are never delayed.
Outbound S2S to it Held in the queue (the 24 h clock keeps running), as 02 requires. Nothing is sent to the peer at the pinned or the observed base URL.
What users see "b.com is temporarily unreachable." No security warning: this is an administrator matter (00 §4.12.5 lists server key rotation as never-prompt).
Resolution The administrator is alerted and resolves it as 02 specifies (accepting the new key set, or waiting for the peer to restore continuity).

13.5 Summary

Down or unusable Chat in existing contexts New contexts on other servers 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: yes, 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

14. Data minimisation

14.1 At a remote server

A remote server MAY store about a user of another server only what it needs to serve that user and its own members:

Data Allowed Retention
Canonical address, incarnation (inc), display name, kind Yes While the account has sessions, memberships, content or DM participation here; then at most 30 days
The latest verified IdentityState and the highest ver seen Yes Until exp; the highest ver value while any related state exists
RemoteSession records (§6.2), with token hashes only Yes Until 7 days after the session ends
HomeAssertions, DeviceProofs No, beyond verification The jti in the replay cache until exp + 60 s only
DeviceCertificates Only those of devices with sessions or leaves here (07, 13 keep them inside MLS state) While the session or leaf exists
Revocation and deletion marks (§11.4): account, inc, did, time Yes At least 1 h after the event; SHOULD NOT exceed 7 days
IP addresses and client identifiers For abuse prevention and diagnostics SHOULD NOT exceed 30 days unless needed for an open abuse case
Membership, roles, bans, content, MLS state As 09, 10, 11, 13 and 14 specify As they specify

A remote server MUST NOT:

  • ask a client for, or store, the user's OIDC identities, e-mail addresses, push tokens or other servers' session tokens;
  • use the device list of an IdentityState for anything except validation, MLS roster display (00 §5.4) and the rules of this document;
  • forward data it learned about a remote user to a third server, except inside protocol messages that their owners define (for example 12's DM events or 10's forwarded reports);
  • keep audit logs that link a remote user to their IP address beyond the retention above.

On accepting account.deleted, or on an incarnation change (§11.6), it deletes cached profile data, IdentityStates and session records of the deleted incarnation within 60 s and handles the rest as 05, 09 and 11 specify.

14.2 At the home server

Data Retention
Audience records (§11.1): account, peer, last assertion time, sources 30 days after the last assertion, unless another source keeps the peer
Issued assertions Not stored. Logs MAY record (account, aud, jti, time) for at most 7 days.
S2S outbound queues Until delivered or given up (≤ 24 h)
Dedupe store At least 48 h (§9.5); SHOULD NOT exceed 7 days

The audience set is a record of where a user goes. A home server MUST NOT expose it through any API other than what the user can see about their own account (05), and MUST NOT use it for anything except fan-out, the user's own view, and the internal notify.event legitimacy check of 19 §6.1, which reveals nothing to the sender because failures answer ignored.

14.3 In S2S events

S2S events carry only what their owners define. dm.request carries ciphertext for secure DMs (12), and notify.event carries no content for secure contexts (D-022, 19). The one exception to "no plaintext of secure contexts" is report.forwarded (10 §10.9): it carries the revealed per-message keys of the reported items, so the reported account's home server can read exactly those messages (D-040). The reporter is told this before sending (10 §10.11).

15. User experience

Federation is invisible when it works. Creating, renewing and extending sessions, verifying assertions, retrying events and fanning out revocations never show anything to the user and never prompt (00 §4.12.5). The only federation states users see are status lines and error texts, none of which is a security warning in the sense of 00 §4.12.1. Document 20 owns the exact copy; the intended meaning is:

Situation Where Intended meaning
Remote server not answering (§13.2) On waiting messages and the context header "Waiting for b.com…" / "b.com isn't responding. Your messages will be sent when it's back."
Home server not answering (§13.1) App-wide status line "Your server (a.com) isn't responding. You can keep chatting where you're already connected."
Session extension limit reached Context header on that server "Can't confirm your account with a.com. Reconnecting when it's back."
discovery.peer_suspended (02) Context header "b.com is temporarily unreachable."
federation.blocked Where the user tried to go, or in the DM "Your server doesn't connect with b.com." In a DM: "You can't message dan@b.com because your server doesn't connect with b.com."
A secure join refused while extended (§7.3) Inline, where the join was attempted "Waiting for your server (a.com) before you can join. Try again in a little while." The action resumes by itself when the home server returns.

Clients SHOULD name the server by its canonical domain, which is what the user knows from addresses, in display form: the U-label where 01 §4.3 allows it, otherwise the A-label. They MUST NOT show raw error codes, keys, jti values or token details to the user; those go to diagnostics (15).

16. Error codes

This document owns the federation area (00 §7.5). Every code uses the problem object of 00 §7.9.

Code HTTP status userAction retryable Meaning data
federation.audience_is_home 400 none false An assertion was requested for the home server itself. —
federation.blocked 403 none false Federation between the two servers is blocked by policy (§12). domain: the peer's canonical domain, when known
federation.assertion_invalid 401 none false The HomeAssertion failed a structural, key, signature, time or claim check (§6.3). reason (§17.4); serverTime (RFC 3339) when reason is expired, not_yet_valid or lifetime
federation.assertion_replayed 401 retry true The assertion's jti was already used here. —
federation.wrong_audience 401 retry true The assertion was issued for another server. expected: this server's canonical domain
federation.device_proof_required 401 retry true The assertion is for an enrolled device but the DeviceProof or DeviceCertificate is missing. —
federation.device_proof_invalid 401 none false The DeviceProof or DeviceCertificate failed verification (§6.3.3). reason; serverTime when reason is device_proof_expired; identityReason (07 §10.6), optional
federation.identity_mismatch 409 retry true The assertion disagrees with the current IdentityState, even after a fresh fetch (§6.3.2). reason: sec, igen, identity_key, kind or device; identityReason (07 §10.6), optional
federation.issuer_unreachable 503 wait true The issuer's metadata, keys or IdentityState couldn't be obtained. domain; discovery: the 02 code of the failed resolution, when there is one
federation.session_ended 401 per reason per reason The remote session was ended (§6.8), or the device or account was revoked, deleted or suspended (§6.3 V15). retryable equals data.retry; userAction is retry when data.retry is true, otherwise none. reason, retry
federation.home_unreachable 503 wait true The action needs the account's home server, which can't be reached (§7.3). domain
federation.home_reachable 409 retry true Extension refused: the probe reached the home server, so the client must renew with an assertion (§6.6). —
federation.extension_limit 409 wait false Extension refused: the session reached 24 h since its last verification (§6.6). The session stays valid until expiresAt. extendableUntil
federation.s2s_unauthenticated 401 none true The S2S request token is missing or failed verification (§8.5). reason (§17.4); serverTime (RFC 3339) when reason is expired, not_yet_valid or lifetime
federation.not_authorized 403 none false An authenticated S2S request names a subject or origin outside the sender's authority (for example a claimant not homed at iss). field
federation.batch_invalid 400 none false The event batch as a whole is malformed (§9.3). —
federation.event_invalid 400 none false Per event: envelope or payload invalid (§9.4). detail
federation.event_too_large 413 none false Per event: larger than maxFederationEventBytes. limit
federation.event_not_authorized 403 none false Per event: the origin isn't entitled to send this event about this subject (§10.1). —
federation.event_expired 410 none false Per event: ts is more than 25 h old (§9.4). —

The per-event codes appear only inside EventResult error objects; their status member gives the HTTP status a single-event request would have had.

Other documents' codes that federation endpoints return: core.* (03), address.non_canonical (01, always with status 400), discovery.* (02, including discovery.peer_suspended for suspended peers), security.upgrade_required (00), auth.home_session_required and account.suspended (05), moderation.banned (10), and owner-defined per-event codes such as dm.host_mismatch (12).

17. Registry additions

17.1 Error codes

All codes of §16, in the federation area, for 03's registry, including federation.not_authorized (the request-level refusal of an S2S request outside the sender's authority).

17.2 Event types

Type Class ctx Owner Meaning
federation.session_ended Ephemeral, client me 06 A remote session was ended (§6.8).

The S2S event types are indexed in §10.1 with their owners.

17.3 Limits

Limit Default Floor Meaning
maxFederationEventBytes 131,072 (128 KiB) 131,072 Largest serialized S2S event a server accepts (§9.2). Advertised in ServerMetadata limits (02).

The number of events per batch is fixed at 100 and isn't advertised.

17.4 data.reason values

Code Values
federation.assertion_invalid malformed, alg, typ, claims, kid, key_unknown, key_status, signature, expired, not_yet_valid, lifetime, subject, security_claims
federation.device_proof_invalid device_certificate, device_proof, device_proof_binding, device_proof_expired
federation.s2s_unauthenticated missing, malformed, alg, typ, claims, kid, issuer_not_canonical, key_unknown, key_status, signature, audience, method, uri, body_hash, expired, not_yet_valid, lifetime, replayed
federation.session_ended / federation.session_ended event expired, extension_limit, device_revoked, identity_changed, account_deleted, blocked, key_revoked, moderation, replaced, signed_out, admin
federation.identity_mismatch sec, inc, igen, identity_key, kind, device

Receivers treat an unknown reason as a generic failure of the same code (and, for federation.session_ended, as admin).

17.5 Endpoints

Paths owned by this document, for 00 §7.3 and 03's index:

Path Methods Authentication
/v1/federation/assertions POST Home session or bot token
/v1/federation/sessions POST None (assertion in body); optional current remote session token for renewal
/v1/federation/sessions/current GET, DELETE Remote session token
/v1/federation/sessions/current/extend POST Remote session token
/v1/federation/events POST S2S token
/v1/federation/policy GET, PATCH Session of an account holding the admin role (10 §4.2)
/v1/federation/blocks, /v1/federation/blocks/{domain} GET; PUT, DELETE Session of an account holding the admin role (10 §4.2)

/v1/federation/assertions and /v1/federation/sessions are exempt from Idempotency-Key replay (§4.1), and the public GET lookups of §10.3 accept an optional S2S token under §8.1; 03 §14.2 item 8 records the Idempotency-Key exemption, and 03 §3.2 rule 8(a) the S2S token on the public lookups.

17.6 JWS types and claims

No new typ values: sv-assert+jwt, sv-devproof+jwt and sv-s2s+jwt are already in 04's registry with this document as owner. The HomeAssertion claims kind, isv, name and inc (D-086) are added here (§4.3). No new cryptographic labels are needed.

18. Test vectors

18.1 Keys

All keys are Ed25519 private-key seeds from RFC 8032 §7.1, so any implementation can check them. Thumbprints are RFC 7638 SHA-256 over {"crv":"Ed25519","kty":"OKP","x":"<x>"}.

Role Seed (hex) Public key (hex) JWK x Thumbprint
Alice's identity key (RFC 8032 TEST 1) 9d61b19deffd5a60ba844af492ec2cc44449c5697b326919703bac031cae7f60 d75a980182b10ab7d54bfed3c964073a0ee172f3daa62325af021a68f707511a 11qYAYKxCrfVS_7TyWQHOg7hcvPapiMlrwIaaPcHURo kPrK_qmxVWaYVA9wwBF6Iuo3vVzz7TxHCTwXBygrS4k (ikf)
Alice's DSK, device q2bS9xVg3m0yJpQe1vT0Aw (TEST 2) 4ccd089b28ff96da9db6c346ec114e0f5b8a319f35aba624da8cf6ed4fb8a6fb 3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c PUAXw-hDiVqStwqnTRt-vJyYLM8uxJaMwM1V8Sr0Zgw FtIu-VbGrfe_KB6CH7GNwODB72MNxj_ml11dEvO-7kk (dkf)
Server key a.com#2026-12a, purpose sign (TEST 3) c5aa8df43f9f837bedb7442f31dcb7b166d38535076f094b85ce3a2e0b4458f7 fc51cd8e6218a1a38da47ed00230f0580816ed13ba3303ac5deb911548908025 _FHNjmIYoaONpH7QAjDwWAgW7RO6MwOsXeuRFUiQgCU —
Server key b.com#k1, purpose sign (TEST 1024) f5e5767cf153319517630f226876b86c8160cc583bc013744c6bf255f5cc0ee5 278117fc144c72340f67d0f2316e8386ceffbf2b2428c9c51fef7c597f1d426e J4EX_BRMcjQPZ9DyMW6Dhs7_vyskKMnFH-98WX8dQm4 —

Setting: a.com has base URL https://a.com/sv; b.com has base URL https://chat.b.com/server and the alias chat.b.com. Both keys have status active. Time iat = 1796408400 is 2026-12-04T18:20:00Z. Alice's account has inc sLGys7S1tre4ubq7vL2-vw (bytes b0 … bf) and Bob's (bob@a.com) wMHCw8TFxsfIycrLzM3Ozw (bytes c0 … cf).

The JWS header and payload below are the exact octets that were base64url-encoded (compact JSON, members in the order shown). Ed25519 is deterministic, so the signatures are reproducible.

18.2 TV-1: HomeAssertion for an enrolled device

Header: {"alg":"EdDSA","typ":"sv-assert+jwt","kid":"a.com#2026-12a"}

Payload: {"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"}

Compact JWS:

eyJhbGciOiJFZERTQSIsInR5cCI6InN2LWFzc2VydCtqd3QiLCJraWQiOiJhLmNvbSMyMDI2LTEyYSJ9.eyJpc3MiOiJhLmNvbSIsInN1YiI6ImFsaWNlQGEuY29tIiwiYXVkIjoiYi5jb20iLCJpYXQiOjE3OTY0MDg0MDAsImV4cCI6MTc5NjQwODcwMCwianRpIjoiS2MxbzJROGJUelIzZkx3OXlIMGFWZyIsImtpbmQiOiJ1c2VyIiwiaW5jIjoic0xHeXM3UzF0cmU0dWJxN3ZMMi12dyIsInNlYyI6InNlY3VyZSIsImRpZCI6InEyYlM5eFZnM20weUpwUWUxdlQwQXciLCJlbnIiOnRydWUsImlzdiI6MTcsImlnZW4iOjEsImlrZiI6ImtQcktfcW14VldhWVZBOXd3QkY2SXVvM3ZWeno3VHhIQ1R3WEJ5Z3JTNGsiLCJka2YiOiJGdEl1LVZiR3JmZV9LQjZDSDdHTndPREI3Mk1OeGpfbWwxMWRFdk8tN2trIn0.d2yW-1RgGsVoMxQpdMAfc1WE0FxHm83Y-oN-G9Z8I6_joUdqzcjZtkpyiMzUy4kuHCbityPmu-scrdLgxBU5CA

18.3 TV-2: DeviceProof for TV-1

Header: {"alg":"EdDSA","typ":"sv-devproof+jwt","kid":"FtIu-VbGrfe_KB6CH7GNwODB72MNxj_ml11dEvO-7kk"}

Payload: {"aud":"b.com","ajti":"Kc1o2Q8bTzR3fLw9yH0aVg","iat":1796408401,"exp":1796408461}

Compact JWS (signed with Alice's DSK):

eyJhbGciOiJFZERTQSIsInR5cCI6InN2LWRldnByb29mK2p3dCIsImtpZCI6IkZ0SXUtVmJHcmZlX0tCNkNIN0dOd09EQjcyTU54al9tbDExZEV2Ty03a2sifQ.eyJhdWQiOiJiLmNvbSIsImFqdGkiOiJLYzFvMlE4YlR6UjNmTHc5eUgwYVZnIiwiaWF0IjoxNzk2NDA4NDAxLCJleHAiOjE3OTY0MDg0NjF9.yYMHB8gv1-pezXM9Qmwfhn8e45cPJ75pHmZ-K6qx0VbR4X1-C1sRMA6EZEv6OYBw7k9tDw1TVvz0MuWvXSFuBw

A complete session request for TV-1 also needs Alice's DeviceCertificate and an IdentityState with ver 17 listing the device; those objects are 07's test vectors and use the same keys.

18.4 TV-3: HomeAssertion for an insecure account

Header: as TV-1.

Payload: {"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}

eyJhbGciOiJFZERTQSIsInR5cCI6InN2LWFzc2VydCtqd3QiLCJraWQiOiJhLmNvbSMyMDI2LTEyYSJ9.eyJpc3MiOiJhLmNvbSIsInN1YiI6ImJvYkBhLmNvbSIsImF1ZCI6InNsb3BweXZvaWNlLmNvbSIsImlhdCI6MTc5NjQwODQwMCwiZXhwIjoxNzk2NDA4NzAwLCJqdGkiOiJtM1ZRZDBjOEhuMXhUNnBacjJ5TGtBIiwia2luZCI6InVzZXIiLCJpbmMiOiJ3TUhDdzhURnhzZkl5Y3JMek0zT3p3Iiwic2VjIjoiaW5zZWN1cmUiLCJkaWQiOiJUcTl3RTFyWTV1STNvUDdhUzJkRjRnIiwiZW5yIjpmYWxzZSwiaXN2IjozfQ.KRKHLXQEXGWsSRSkwEqajjfpoio2oHeoqsaNYsaVcCjzzWheM2nCAzUIrqVLfkCmKmqPUdQJB9LkZp-XGd2UAw

18.5 TV-4: S2S token for an event batch

Request: POST https://chat.b.com/server/v1/federation/events from a.com.

Body (193 octets, exactly as sent). The payload d is deliberately incomplete: it exercises token verification only, and a receiver rejects the event itself (TV-7 #16).

{"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"}}]}

bh = nUYsWv7XP5CecrdPm9G1P7rzc5lz5guolB9PeaYkCPI

Header: {"alg":"EdDSA","typ":"sv-s2s+jwt","kid":"a.com#2026-12a"}

Payload: {"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"}

eyJhbGciOiJFZERTQSIsInR5cCI6InN2LXMycytqd3QiLCJraWQiOiJhLmNvbSMyMDI2LTEyYSJ9.eyJpc3MiOiJhLmNvbSIsImF1ZCI6ImIuY29tIiwiaHRtIjoiUE9TVCIsImh0dSI6Imh0dHBzOi8vY2hhdC5iLmNvbS9zZXJ2ZXIvdjEvZmVkZXJhdGlvbi9ldmVudHMiLCJiaCI6Im5VWXNXdjdYUDVDZWNyZFBtOUcxUDdyemM1bHo1Z3VvbEI5UGVhWWtDUEkiLCJpYXQiOjE3OTY0MDg0MDAsImV4cCI6MTc5NjQwODQ2MCwianRpIjoiOHlRd1YybkM1a0wwcFI3dFgzekoxZyJ9.hhvQ_oEt9jXhW3Yt1av2IUQxfntEdGN7c4x_zYeDX_4vLwAoPk8BCvDpmitdJW7OkfZEPzE10O4q1qk1xYVnBA

18.6 TV-5: S2S token from b.com to a.com

Request: POST https://a.com/sv/v1/federation/keypackages/claim from b.com. Body (deliberately not a valid 13 claim body, 13 §9.5; it exercises only the token and bh): {"addr":"dan@a.com","count":1}, bh = 7f1TQlQedNhyyyoiHEz1vpqtBdwk8xRt3llZNYP-KJ0.

Header: {"alg":"EdDSA","typ":"sv-s2s+jwt","kid":"b.com#k1"}

Payload: {"iss":"b.com","aud":"a.com","htm":"POST","htu":"https://a.com/sv/v1/federation/keypackages/claim","bh":"7f1TQlQedNhyyyoiHEz1vpqtBdwk8xRt3llZNYP-KJ0","iat":1796408405,"exp":1796408465,"jti":"Rk2vB7xN0qW4eT9yU1iO3w"}

eyJhbGciOiJFZERTQSIsInR5cCI6InN2LXMycytqd3QiLCJraWQiOiJiLmNvbSNrMSJ9.eyJpc3MiOiJiLmNvbSIsImF1ZCI6ImEuY29tIiwiaHRtIjoiUE9TVCIsImh0dSI6Imh0dHBzOi8vYS5jb20vc3YvdjEvZmVkZXJhdGlvbi9rZXlwYWNrYWdlcy9jbGFpbSIsImJoIjoiN2YxVFFsUWVkTmh5eXlvaUhFejF2cHF0QmR3azh4UnQzbGxaTllQLUtKMCIsImlhdCI6MTc5NjQwODQwNSwiZXhwIjoxNzk2NDA4NDY1LCJqdGkiOiJSazJ2Qjd4TjBxVzRlVDl5VTFpTzN3In0.sDXVTZKlQ-GLIJ81POkSnorWCVPmBmU14W7coniRDvZ5lSzkBhR49UYkSQfLjeLTcN_LfdG83M6vEbOKBYHAAw

For reference, the SHA-256 of empty content is 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU. It never appears in a valid token: a request without content has no bh.

18.7 TV-6: target-URI normalization

Input normalize(input)
https://Chat.B.com:443/server/v1/federation/events https://chat.b.com/server/v1/federation/events
https://chat.b.com:8443/server/v1/federation/events https://chat.b.com:8443/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
https://a.com https://a.com/
https://BÜCHER.example/sv/v1/federation/events https://xn--bcher-kva.example/sv/v1/federation/events
https://a.com/sv/v1/federation/events#frag https://a.com/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

(%3A is decoded only in the path, never in the query.)

18.8 TV-7: verification outcomes

Verifier b.com (base URL https://chat.b.com/server, alias chat.b.com), clock now = 1796408410 unless stated, with TV-1, TV-2, Alice's DeviceCertificate and IdentityState ver 17 available.

# Input Expected result
1 TV-1 + TV-2 + certificate + IdentityState 201, session with secureAccess = full, expiresAt = now + 3,600 s
2 The same request again 401 federation.assertion_replayed
3 TV-1 at now = 1796408759 (fresh replay cache) Accepted (within the 60 s skew after exp), provided TV-2 is replaced by a DeviceProof valid at that time
4 TV-1 at now = 1796408760 401 federation.assertion_invalid, reason = expired
5 TV-1 without deviceProof 401 federation.device_proof_required
6 TV-1 with a DeviceProof whose ajti is m3VQd0c8Hn1xT6pZr2yLkA 401 federation.device_proof_invalid, reason = device_proof_binding
7 An assertion like TV-1 but aud = chat.b.com 400 address.non_canonical
8 TV-3 presented at b.com 401 federation.wrong_audience, data.expected = b.com
9 An assertion like TV-1 but exp = iat + 301 401 federation.assertion_invalid, reason = lifetime
10 An assertion like TV-3 but enr = true 401 federation.assertion_invalid, reason = security_claims
11 An assertion like TV-1 but header kid = c.com#2026-12a 401 federation.assertion_invalid, reason = kid
12 TV-4 sent to https://chat.b.com/server/v1/federation/events/ 401 federation.s2s_unauthenticated, reason = uri
13 TV-4 with one space added to the body 401 federation.s2s_unauthenticated, reason = body_hash
14 TV-4 sent as PUT 401 federation.s2s_unauthenticated, reason = method
15 TV-4 sent twice Second: 401 federation.s2s_unauthenticated, reason = replayed
16 A valid batch containing the event of TV-4, sent twice with fresh tokens First: rejected with federation.event_invalid at §9.4 step 8, because TV-4's payload lacks members 07 requires (revokedAt, igen, ver, state). Second: duplicate, from a receiver that records rejected outcomes as §9.4 recommends (otherwise rejected again)
17 An assertion like TV-1 but inc = wMHCw8TFxsfIycrLzM3Ozw, with the IdentityState of 07 §21.4 (inc sLGys7S1tre4ubq7vL2-vw) both presented and fetched 409 federation.identity_mismatch, reason = inc

18.9 TV-8: retry schedule

The nominal schedule of §9.7, as attempt number: time since ts (s): 1: 0; 2: 1; 3: 3; 4: 7; 5: 15; 6: 31; 7: 63; 8: 127; 9: 255; 10: 511; 11: 1,023; 12: 2,047; 13: 4,095; 14: 7,695; then +3,600 per attempt up to attempt 35 at 83,295. No attempt after 86,400.

19. Security considerations

Assertion replay and theft. A HomeAssertion is single use at its audience, bound to one audience, and lives at most 300 s. A party that copies an insecure account's assertion within that window (for example from a compromised client or a TLS-intercepting proxy) can open one session as that user at that one server, if it presents the assertion first; the legitimate client then gets federation.assertion_replayed and silently retries. This exposes insecure-context access only, which matches insecure mode's trust model (00 §5.1). For an enrolled device, a copied assertion is useless without the DSK, because the DeviceProof binds the assertion's jti to the audience and the device. The remote server consumes the jti only after every other check passes, so an attacker without the DSK can't even burn it.

Remote session token theft. The remote session token is a bearer token valid for up to 1 h (24 h when extended). Whoever steals it acts as the user at that server, within the session's secureAccess; in secure contexts they still can't read content without the device's MLS and history keys. Servers store only token hashes, tokens never appear in URLs (00 §7.3), and renewal rotates them. Revoking the device at the home server ends the session at reachable audiences within about 70 s. Binding tokens to the DSK of enrolled devices would close this gap; it is deferred (§20, OQ-06-1).

A malicious home server can mint assertions for any of its own accounts, at any time, for any audience. That is inherent: the home server is the root of trust for its users' identity in insecure contexts and for which identity key is current (00 §5.2). It can't mint assertions for another server's accounts: sub must be in the iss domain, and iss must be the canonical domain whose keys the verifier resolved itself. It can't produce a DeviceProof for a real enrolled device. It can make its user appear unenrolled, which only lowers that user's access, or publish a new IdentityState with an identity key it generated, which is a reset that the user's own devices see as W4a and DM contacts as W2 (D-071). Its audience records reveal where its users go; §14.2 limits their use.

A malicious remote server learns what the session gives it: the account, did, security state, identity-key and DSK thumbprints, client software, IP address and activity. It can't reuse an assertion or DeviceProof elsewhere, because both name it as audience and the jti is single use everywhere. Device IDs are the same at every server and also appear in the public IdentityState, so servers can correlate a device's visits; this metadata exposure is accepted (00 §5.4). It can end or extend sessions as it pleases, which only affects its own service.

A malicious peer sending S2S traffic can't impersonate another server: iss must equal the canonical domain whose key signed the token, and the token is bound to method, URI, body and audience, and is single use. Within its own authority it can send false events, which subject binding (§10.1) limits to accounts it homes, contexts it hosts and reports it forwards. A false identity.changed only makes an audience refetch the IdentityState, which the home server signs. A peer can flood: receivers rate-limit per peer (§8.7), cap batch and event sizes, and answer ignored for unknown subjects without revealing whether an account exists.

Revocation latency and its limits. Fan-out aims at 10 s and audiences act within 60 s, so a revoked device is normally cut off in about 70 s. Audiences also keep a revoked or deleted mark (§11.4), so an assertion issued just before the revocation can't open a new session afterwards, for insecure accounts as well as secure ones. The limits are: an unreachable audience (bounded by the session's remaining hour, because the device can't renew); a home server that the remote server can't reach (bounded by the 24 h extension limit); and leaves at servers outside the audience set (the device has no session there to fetch anything, and 90-day eviction removes them). An attacker who can both steal a device and cut the network path between its home server and a remote server could keep a session there for up to 24 h. This is the accepted price of keeping users online during home outages (D-062).

Reused addresses (D-086). Records are keyed on (address, inc), and the first HomeAssertion or IdentityState with a new inc ends everything the earlier account had here (§11.6). A server that missed account.deleted therefore never hands the earlier account's sessions, memberships, roles or DM conversations to a later holder of the address. A malicious home server could announce a new incarnation to wipe one of its own users' memberships everywhere, but it can already delete or reset the account. Bans deliberately stay keyed by address (10 §9.2).

DNS and key trust. Every verification resolves the issuer itself and uses the pinned key set of 02. Without DNSSEC, first contact with a cross-site delegation is trust on first use (D-074); after that, an attacker who controls DNS can't substitute keys without the peer being suspended (§13.4). During a suspension only keys already in the pin are trusted, so revocations from the real key holder still arrive. HTTPS to the base URL authenticates responses, and responses are not separately signed. Retired keys can't mint new short-lived tokens (§3.2), and sessions opened with a key that is later revoked end within 60 s (§6.2).

A peer's domain list is a self-assertion. Any server can list any domain in its own ServerMetadata domains; the list proves nothing about domains the verifier didn't resolve itself (D-002 protects only the direction "domain X is served by server S" when X is resolved). Federation policy therefore never matches against it (§12.3). Otherwise a hostile server could list an allowlisted domain to slip past an allowlist, or list popular domains so that blocking it would silently block innocent peers.

Server-side request forgery. Federation makes servers fetch URLs that strangers choose. §3.1 forbids connections to non-public addresses and redirects on S2S requests, and the address check is made on the connected address to defeat DNS rebinding.

Denial of service. Verifiers do cheap local checks (size, header, claims, audience, times, and for S2S tokens the method, URI and body hash) before resolution and signature verification, and verify the signature before applying the block list or touching the replay cache. Checking blocks after the signature means a blocked peer's name can make a verifier resolve it, but that result is cached (02), and no third party can learn from the answers whom a server blocks (§12.4). Replay caches fail closed. A malicious home server can mint unlimited fake devices; the per-issuer session limits of §6.9 bound the cost. A peer can't make a home server fan out: only the home server's own account changes trigger revocation events, and their rate is bounded by 05's limits on device registration and revocation.

Clock skew. All checks allow ±60 s. A server with a clock far wrong will fail to verify, or to be verified by, its peers; this shows up as expired or not_yet_valid reasons in diagnostics and is an operational matter (21).

Blocks are not a user-level boundary. A federation block stops a server, not a person: a blocked server's users can open accounts elsewhere. Abuse by individuals is handled with bans and reports (10).

20. Open questions

ID Question Recommendation
OQ-06-1 Should remote session tokens of enrolled devices be sender-constrained, for example by a DSK-signed proof on each request (in the style of RFC 9449 DPoP), so a stolen token is useless without the device? Defer until after v1. It adds a signature to every request and complicates web clients' key Worker, while secure content is already protected by MLS keys. Revisit if token theft is observed.
OQ-06-2 When the home server is reachable from the remote server but not from the user's client (for example a regional network block), the extension is refused and the session ends after its hour. Should the remote server instead extend on its own fresh IdentityState fetch? Keep the rule as in 00 HP-7: extend only when the probe fails. Extending on a remote fetch would let a revoked-then-relisted or misbehaving state keep sessions alive without the client ever proving itself again. The user sees "Can't reach your server" and recovers when their own path is back.

21. References

21.1 Normative

  • RFC 2119, RFC 8174 — requirement key words
  • RFC 1918 — private IPv4 addresses; RFC 4193 — unique local IPv6 addresses; RFC 6890 — special-purpose IP address registries
  • RFC 3339 — timestamps; RFC 3986 — URI syntax and normalization
  • RFC 4648 — base64url
  • RFC 5234 — ABNF
  • RFC 5890, RFC 5891 — IDNA2008
  • RFC 7493 — I-JSON; RFC 8259 — JSON
  • RFC 7515 — JWS; RFC 7517 — JWK; RFC 7519 — JWT (NumericDate, claim conventions); RFC 7638 — JWK thumbprint; RFC 8037 — EdDSA in JOSE
  • RFC 8032 — Ed25519
  • RFC 6750 — Bearer token usage (WWW-Authenticate error parameters)
  • RFC 9110 — HTTP semantics (content, content coding, redirects)
  • RFC 9457 — problem details
  • RFC 9562 — UUIDv7
  • Sloppy Voice documents 00, 01, 02, 03, 04, 05, 07, 09, 10, 12, 13, 15, 19

21.2 Informative

  • RFC 9421 — HTTP message signatures (the alternative not chosen, D-027)
  • RFC 9449 — OAuth 2.0 DPoP (OQ-06-1)
  • RFC 9420 — MLS; RFC 9750 — MLS architecture
  • RFC 6749 — OAuth 2.0
  • RFC 8615 — well-known URIs
  • Unicode UTS #46 — IDNA compatibility processing
  • Sloppy Voice documents 08, 11, 14, 20, 21, 22; spec/DECISIONS.md