Protocol and version upgrades
What changes when you upgrade the SDK, what happens to persisted sessions, and who owns version negotiation across a mixed device population.
- Status
- stable
- Applies to
- 15.0.0
- Platforms
- Expo · Browser · Node
- Prereqs
- A working client from Start → Quickstart
- Reading time
- 11 min
Two things change independently when you upgrade: the code, and the shape of what is already persisted on your users' devices. The first is your build pipeline's problem. The second is a user-visible event, and this page is mostly about that.
The maturity statement is the frame for everything below: 15.0.x. Public APIs and persisted formats follow semantic versioning.
When register returns DEVICE_LINK_REQUIRED
The OpenE2EE Signal Protocol Relay applies this rule to every SDK release. No SDK upgrade is necessary.
The Relay registers only the first device of an account. A registration with a new device key on an account that has a device gets HTTP 409 with the code DEVICE_LINK_REQUIRED. The Relay adds no device. A registration with a device key that the account holds keeps its device ID.
Who gets the refusal. An application with custom-token or native provider identity that registers a new device key for an account with a device. Examples are a reinstall, a new phone, a second browser, and cleared site data. In device-owned identity, a new store makes a new account, so it does not get this refusal.
- Handle the refusal.
createHostedSignalProtocolClientthrowsHostedSignalProtocolRelayDeviceLinkRequiredError. It is aHostedSignalProtocolRelayHttpErrorwithcodeDEVICE_LINK_REQUIRED,status409, andretryablefalse. Do not retry the registration.isRetryableError()returnsfalsefor this error, sowithRetry()gives it to the caller after one attempt. - Add the new device through the two-device link. The new device calls
joinHostedSignalProtocolRelayAccount()with an empty store. Device 1 callsapproveHostedSignalProtocolRelayDeviceLink(). When the Relay does not serve the two-device link, the join throwsHostedSignalProtocolRelayDeviceProvisioningErrorwith codeSIGNAL_RELAY_UNSUPPORTED. Then link the device from device 1 withlinkHostedSignalProtocolRelayDevice(). See multi-device. - Recover the account when the user has no active device. Create the client with
assertionPurpose: 'recover'. Recovery revokes every earlier device of the account. - Check the path after
HostedSignalProtocolRelayDeviceUnknownError. A re-registration after that error getsDEVICE_LINK_REQUIREDwhen the account has other devices.
See when the account already has a device.
Upgrading from 14.x to 15.0.0
15.0.0 is a major release. It removes the earlier names that 14.2.0 and 14.3.0 deprecated. The SDK reports 'signal-relay' for the Relay. Eleven errors and four log operations get a new name. The new values and names keep the stored formats and the wire formats.
The client speaks only Relay protocol version 3, and each device proof signs the version 3 label. To upgrade from 14.x:
-
Do the 14.2.0 and 14.3.0 steps first. 15.0.0 removes each earlier name that those releases deprecated. See 14.1 to 14.2.0 and 14.2 to 14.3.0. Set each option that is required again. TypeScript gives an error when you do not set one.
JavaScript code that sets a removed option name gets no error, and the SDK does not read that option.
registerHook('onSignalProtocolRelayProtocolError', ...)throwsUnknown Signal Protocol client hook. UseonRelayProtocolError. A bootstrap adapter that returns norelayor norelayScopeIdmakes the hosted client fail to start. -
Replace the earlier pre-key bundle type name with
PreKeyBundle. 15.0.0 removes the earlier name from the package root. The two names identified the same type. TheCHANGELOG.mdfile of the package gives the earlier name. TypeScript gives an error for each import of that name. -
Expect
'signal-relay'for the Relay.DeliverySource, theoriginofReceiveExpiredEvent, and theoriginofPendingReceiveare'signal-relay'where SDK 14 gave'relay'. This includes a record that an earlier SDK stored with'relay'. The store keeps the stored value. The three types still accept'relay'. Make each comparison with'relay'match'signal-relay'. Code that followed the 14.2.0 steps for these values needs no change. AswitchonDeliverySourcekeeps itscasefor'relay', because the type still accepts that value. -
Match the new error names. The
nameproperty of each error in the table below is now the name of its class. In SDK 14, thenamewas the name in the table withoutSignalProtocol. Change each match onname, in code and in a log query.instanceofchecks need no change. -
Match the new log operations. The device transfer connection logs the
operationvaluessignal-relay-connect,signal-relay-disconnect,signal-relay-upload, andsignal-relay-download. SDK 14 logged each value withoutsignal-. Change each log query that matches one of these values. SDK 14.2.0 announced this change. -
Use protocol version 3 of the Relay. The client offers no other version. It offers version 3 on each HTTP request and on the mailbox socket. SDK 14 changed to version 2 when the Relay refused it. The OpenE2EE Signal Protocol Relay serves this version. When a Relay does not serve version 3, the SDK sends each request once:
- An identified Relay route and the managed group authority throw
HostedSignalProtocolRelayHttpErrorwith thecodePROTOCOL_UNSUPPORTED, thestatus400, andretryabletrue. - A sealed post throws
HostedAnonymousDeliveryErrorwith thecodeDELIVERY_FAILEDand thestatus400. - A group server request throws
HostedGroupErrorwhosedata.statusis 400. - The mailbox socket reconnects with its usual backoff. Its state is
reconnectingwith the reasonprotocol-unsupported, where SDK 14 gaveclosed.
Read
PROTOCOL_UNSUPPORTEDas a retryable fault. Do not expect the SDK to send a request again on another version. A send keeps the device pending until its posting deadline.UPGRADE_REQUIREDstays terminal. Addprotocol-unsupportedto each exhaustiveswitchonSignalProtocolRelayConnectionReason. - An identified Relay route and the managed group authority throw
-
Custom
hosted.adapter: remove theprotocolVersionargument. ThesignChallengeandsignCertificateRequestmethods ofHostedSignalProtocolRelayDeviceAuthenticationhave noprotocolVersionparameter. Each call signs the version 3 label. In SDK 14, a call withoutprotocolVersionsigned the version 2 label. Remove the argument from each call. TypeScript gives an error for a call with that argument. Make each adapter that verifies such a proof verify the version 3 label.
name in 15.0.0 | Announced in |
|---|---|
SignalProtocolRelayWorkStopped | 14.2.0 |
InMemorySignalProtocolRelayRefusal | 14.2.0 |
HostedSignalProtocolRelayDeviceLinkError | 15.0.0 |
HostedSignalProtocolRelayDeviceUnknownError | 15.0.0 |
HostedSignalProtocolRelayDeviceRevokedError | 15.0.0 |
HostedSignalProtocolRelayHttpError | 15.0.0 |
HostedSignalProtocolRelayPresenceError | 15.0.0 |
HostedSignalProtocolRelayResumeError | 15.0.0 |
HostedSignalProtocolRelayUpgradeRequiredError | 15.0.0 |
SignalProtocolRelayProtocolError | 15.0.0 |
SendNeverAcceptedBySignalProtocolRelayError | 15.0.0 |
The SDK does not export InMemorySignalProtocolRelayRefusal, so an instanceof check cannot use it. Match its name.
The changelog lists each change and the SDK 14 name of each error.
Upgrading from 14.3.0 or earlier
The OpenE2EE Signal Protocol Relay serves only Relay protocol version 3. SDK 14.3.0 and earlier releases send version 1, version 2, or no version. The Relay refuses each of their requests to a Relay route with HTTP 426 and the code UPGRADE_REQUIRED. It closes each of their mailbox sockets with code 4426. A retry fails the same way.
- Upgrade to SDK 14.4.0 or a later release. This release sends version 3. See protocol versions.
- Do the steps of each newer release. Start at the section of your release. Then do each newer section in order.
Upgrading from 14.3 to 14.4.0
14.4.0 is a minor release. The SDK speaks version 3 of the Relay protocol. It writes new values and keys to the local store. A store that SDK 14.0.0 through 14.3.0 wrote opens with 14.4.0. For DeliverySource, PendingReceive.origin, and ReceiveExpiredEvent.origin, the SDK still reports 'relay', as 14.3.0 does.
- Use a Relay that serves version 3. On each HTTP request to a Relay route, 14.4.0 sends the header
x-signal-relay-protocol: 3. On the mailbox socket, it offers the subprotocol tokensignal-relay.v3. The OpenE2EE Signal Protocol Relay serves only version 3. When the Relay refuses version 3 withPROTOCOL_UNSUPPORTED, the client falls back to version 2. The Relay refuses version 2 withUPGRADE_REQUIRED, so the client stops. See protocol versions. - Custom
hosted.adapter: pass the protocol version to the device proof signer. ThesignChallengeandsignCertificateRequestmethods ofHostedSignalProtocolRelayDeviceAuthenticationtake an optional last argument,protocolVersion. A call without it signs the earlier label that versions 1 and 2 share. An adapter that sends the proof withx-signal-relay-protocol: 3must pass3as the version. The Relay refuses a request with version 1, version 2, or no version withUPGRADE_REQUIRED. - Expect the new store values and keys. A new receive record holds the origin
'signal-relay'and the receipt decisionsignalProtocolRelayOwnsReceipt. A new Relay delivery status holds the source'signal-relay'. The SDK writes a hosted record to itssignalRelay.<record>.v2:key only. When only the earlier.v1:key holds a record, a read copies the record to the current key. The read keeps the earlier key. The SDK also reads each earlier value and each.v1:key that SDK 14.0.0 through 14.3.0 wrote. - Do not ship SDK 14.1.0 or earlier to a device after the device runs 14.4.0. To roll back, ship SDK 14.2.0 or 14.3.0 to the device. Those releases read each value that 14.4.0 writes. They read the current key of a hosted record first. SDK 14.1.0 and earlier releases refuse the origin
'signal-relay'. They read only the.v1:key of a hosted record. A device that goes back to SDK 14.1.0 or earlier can have these failures:- Messages that the device received but did not complete can stay unprocessed. The receive queue fails each time it reads a stored receive with the origin
'signal-relay'. - A device that registered with 14.4.0 cannot resume its Relay connection. The earlier release does not find the device authentication key. The resume fails with
RETAINED_DEVICE_AUTHENTICATION_UNAVAILABLE. - A device-owned identity that 14.4.0 created is lost. The earlier release does not find the key, so it creates a new key. The Relay binds an account to that key, so the device gets a new account.
- A hosted record that 14.4.0 changed goes back to its earlier value. An example is the stored Relay session.
- Messages that the device received but did not complete can stay unprocessed. The receive queue fails each time it reads a stored receive with the origin
The changelog lists each change.
Upgrading from 14.2 to 14.3.0
14.3.0 is a minor release. The role names of members and options, such as relay, relayUrl, and startRelaySubscription, are the names to use. The signalProtocolRelay* names that 14.2.0 added are deprecated, and SDK 15.0.0 removes them. Both names of each member and option still work in 14.3.0. The behavior of the SDK, the bytes on the wire, and the stored bytes do not change. Code that did not change for 14.2.0 needs no change.
- Change each
signalProtocolRelay*name back to its role name. For example, userelayin place ofsignalProtocolRelay, andhosted.relayUrlin place ofhosted.signalProtocolRelayUrl. Code that keeps asignalProtocolRelay*name compiles and runs in 14.3.0. The TypeScript tools mark that name as deprecated. Do this step before SDK 15.0.0. - Remove each
signalProtocolRelay*member that you added to an implementation. This applies to a class or object that implementsSignalProtocolRelayServer,SignalProtocolContentAdapter, orHostedSignalProtocolRelayBootstrapResult. Keep the role-name member, such asrelayConnectionState. 14.3.0 requires it. - Read
earlierNameto find the name to keep. In aSignalProtocolRelayNameConflictError,earlierNameholds the role name andnewNameholds the deprecatedsignalProtocolRelay*name.
The changelog lists each name.
Upgrading from 14.1 to 14.2.0
14.2.0 is a minor release. Each exported Relay name and package subpath without the Signal Protocol prefix gets a new name. Each earlier name still works in 14.2.0. SDK 15.0.0 removes the earlier names. Members and options keep their role names, as step 3 tells. A store that SDK 14.1.0 wrote opens unchanged, and SDK 14.1.0 reads each record that 14.2.0 writes. The bytes on the wire do not change.
- Replace each earlier name with its new name. A new name has the form
SignalProtocolRelay. A new name that starts withHostedhas the formHostedSignalProtocolRelay. For example,useRelayLifecycleis nowuseSignalProtocolRelayLifecycle. The pre-key bundle type is nowPreKeyBundle. TheCHANGELOG.mdfile of the package lists each name. The TypeScript tools mark an earlier name as deprecated. - Replace each earlier package subpath.
remote/relayis nowremote/signal-relay, andremote/relay/typesis nowremote/signal-relay/types. The two subpaths load one module. The TypeScript tools do not mark an earlier subpath. - Keep the
relaymembers and options. 14.2.0 adds a long form for each member and option, such assignalProtocolRelayfor therelayadapter andhosted.signalProtocolRelayUrlforhosted.relayUrl. 14.2.0 marks the role name as deprecated. SDK 14.3.0 removes that mark and marks the long form as deprecated. SDK 15.0.0 removes the long forms and keeps the role names. Do not change your code to the long forms. Set each option by one name only. Two different values for the two names fail withSignalProtocolRelayNameConflictError. A class or object that implementsSignalProtocolRelayServerkeeps the role-name members, such asrelayConnectionState. - Read the new URL variable first. Set the Relay URL in
OPEN_E2EE_SIGNAL_RELAY_URL. If your framework needs a public prefix, use the prefixed name, such asNEXT_PUBLIC_OPEN_E2EE_SIGNAL_RELAY_URL. Anoerelease before 5.0.0 wrote the earlier name withoutSIGNAL_. Until each environment has the new name, read the new name first and the earlier name second. - Accept
'signal-relay'next to'relay'.DeliverySource, theoriginofReceiveExpiredEvent, and theoriginofPendingReceiveaccept both values. 14.2.0 reports'relay'. SDK 15.0.0 reports'signal-relay'. Aswitchthat ends with an exhaustive check needs acasefor each value now. - Prepare error and log matches for SDK 15.0.0. SDK 15.0.0 adds
SignalProtocolbeforeRelayin two error names. The new names areSignalProtocolRelayWorkStoppedandInMemorySignalProtocolRelayRefusal. SDK 15.0.0 also addssignal-before each log operation that starts withrelay-. These operations are connect, disconnect, upload, and download. 14.2.0 does not change them. Make each match in code or in a log query accept both values.
Upgrading from 13.x to 14.0.0
14.0.0 is a major release. A group receive goes through processIncomingEnvelope(). Each own device gets each group master key in a GroupKeySync. The stores refuse SDK 13.x after the first open. To upgrade from 13.x:
- Replace
decryptGroupMessage()withprocessIncomingEnvelope(). Adecrypt*method is a cipher primitive that returns plaintext, such asdecryptMessage(),decryptEnvelope(), anddecryptFile(). Aprocess*method is a receive workflow that returns an outcome and keeps the content untilcompleteReceive(). Give the delivered envelope with its Relayid. An envelope with noidtakes no receive lock, and a repeat call gives the retained content again untilcompleteReceive(). A refusal gives adeniedoutcome and runsonDecryptionErrorin place of a throw. A retryable decrypt failure sends a retry request and throws. A receive that 13.xdecryptGroupMessage()left pending completes throughcompleteReceive()whenlistPendingReceives()lists it atawaiting-completion. AcompleteReceive()call before that stage deletes nothing. A repeatprocessIncomingEnvelope()call with the same frame does not find the receive. It fails withDECRYPTION_FAILEDand sends a retry request. Stop each 13.x loop that calls again, and uselistPendingReceives(). See groups. - Send all managed group content with
send(). The SDK denies managed group content that has no group context. A client withgroupsgives the reasonlegacy-no-context. An earlier check can deny the content first, for exampleblockedfor a blocked group. A client with nogroupsrefuses the content with aGroupReceiveRefusedErrorof reasonconfiguration. Before, the client decided such content against the local group state. Every sender must run SDK 12.0.0 or later. The output ofencryptGroupMessage()has no group context unless its plaintext holds one. A receiver denies that output in the same way for a managed group. A caller that delivers the bytes ofencryptGroupMessage()itself decrypts them withdecryptEnvelope(). See groups. - Store the group master key before a send. A client with
groupswhose group store has no master key for a managed group refuses a new send to that group. It also refuses a manual resend of content with no logged group context. The send throwsEncryptionErrorwith the codeGROUP_MASTER_KEY_MISSING, and it stores and posts nothing. An attachment send also uploads nothing. Store the group master key through the link or sync path, then send again. A manual resend of logged content that has a group context keeps that context. A replay that must build a sent transcript for an own device skips that transcript. It keeps its posts and logs one warning with the code. See errors. - Remove the SDK 11 received-content names. At the first open of 14.0.0, each durable store deletes every SDK 11 received-content row and every converted record that waits for its envelope. The store logs the count once with the code
LEGACY_RECEIVED_CONTENT_DELETED. The fieldreadablecounts the deleted rows that parse. A readable row is in a store that SDK 12.0.0 or later never opened. The sweep relies on the Relay retention period, 30 days in production. Where that limit applies, no SDK version shows the content of such a row. A device that received the content on SDK 11 in the last 30 days loses the row. The sweep does not restore it. Remove all use ofReceivedContent,ReceiveWorkRecord.awaitingEnvelope,receivedContentKey, andparseReceivedContent. A custom store must setmessageId,senderUserId, andsenderDeviceIdon eachReceiveWorkRecord. See local storage. - Upgrade every own device of an account in one release. Each own device gets each group master key in an encrypted
GroupKeySync. An own device on an earlier SDK gives the raw sync toonMessageDecrypted, and that sync holds the group master key. A custom content adapter must implementserializeGroupKeySync(), or spread the result ofcreateDefaultSignalProtocolContentAdapter()into itself. Aswitchstatement onParsedSyncContent.typemust handle'groupKeySync'. A custom local store must keep each metadata value across a close and a reopen. The first start of 14.0.0 sends oneGroupKeySyncto each other own device for each managed group that it can sync. Such a group has a verified record, and its stored state lists the account as a member. See groups. - Replace
case 'expired-content':withcase 'request-expired':inonRetryTerminal. A retry request whose latest attempt the Relay answered or holds ends asrequest-expiredat its deadline. That end resets no session. A retry request whose latest attempt the Relay did not accept ends asposting-deadlineat its posting deadline or its deadline. That end resets the session. Onlyposting-deadlineresets a session. During the reader window, the SDK reads a storedexpired-contentend asrequest-expired, and a record that the migration moved can haveevent.recovery. The reader window lasts until the next major SDK version. It also lasts at least 60 days after the publish day of 14.0.0.request-expiredis not the delivery error causerequest-ended. See error handling. - Expect a unique send timestamp for each device. A new send with a timestamp that a different send of the device used throws
InvalidSendTimestampErrorwith the reasonalready_used. For that reason,earliestandlatestare absent.SendResult.clientTimestampis now required. Read the timestamp there when the SDK selects it. A retry with the sameclientMessageId, a manual resend, and a retry answer keep the original timestamp. See errors. - Expect a drop of a later message with the same sender and timestamp. The SDK drops a later message from any device of the same sender with the same timestamp. The rule also applies to sent transcripts from two own devices in two conversations. A custom store that reads
ReceiveWorkRecord.receivedgets a key with onlysenderUserIdandtimestamp. A note to self gets to each other own device only as a sent transcript. See offline and reconciliation. - Do not go back to SDK 13.x after the first open of 14.0.0. After that open, the stores refuse SDK 13.x. A 13.x reader throws on a record of 14.0.0. A 13.x web tab cannot open the IndexedDB store and gets a
VersionError. A 14.x open waits for each open 13.x tab to close. A 13.x SQLite store refuses the file withINVALID_STATE. The key-value store has no version guard. Stop each 13.x process on it before the first 14.x open. See local storage.
The changelog lists each change.
Upgrading from 12.x to 13.0.0
13.0.0 is a major release. A new link gives the linked device its own registration ID and copies each group master key. These steps use the current names. In SDK 13.0.0, the names are linkHostedRelayDevice(), HostedRelayDeviceLinkError, and HostedRelayHttpError. SDK 14.2.0 adds the current names, and SDK 15.0.0 removes the earlier names. To upgrade from 12.x:
- One-process link: use a new store that holds only the account identity. Before the link copies the groups,
linkHostedSignalProtocolRelayDevice()reads the linked device's group store. That group store isgroups.store, or the SDK group store on the linked store. When it lists a group that the link did not write, the call throwsHostedSignalProtocolRelayDeviceLinkErrorwith codeDEVICE_LINK_STORE_NOT_EMPTY. A call that resumes the link ignores the groups that the link wrote. The call throws the same error for a store that holds a device-authentication key and no registration of this link. The error hasretryablefalse, and a call with the same store fails again. Link the device again with a new store that holds only the account identity. See multi-device. - Custom local stores: accept an overwrite of the identity record. The link gives the linked device its own registration ID with the same identity keys. It calls
storeIdentityKey()and thensetLocalRegistrationId()for an identity type that the store already holds. After both calls, the record fromgetIdentityKey()and the value fromgetLocalRegistrationId()for that type must hold the new ID. A write of one identity type must not change the other type. The built-in stores already do this. To check a custom store, runassertLocalStoreConformance()from/local/store/conformancein your automated checks.assertLocalStoreConformance()does not check the sender-key handoff rows, the message records, or the send log. See adapters. - SQLite stores: use a name that does not end in
.oe2e-convert. TheconvertPlaintextconversion to encryption uses that ending for its temporary file.nodeStore(),expoStore(),reactNativeStore(),webSqliteStore(), and their reset functions refuse such a name withINVALID_STATE. See local storage. - Remove your own group key transfer. For each group that the active device's group store lists, the link copies the master key into the linked device's group store. The link skips a listed group that has no master key. The copy runs in the calling process and sends no master key to the Relay. A client with
groupson the linked device then fetches each copied group. It skips a group thatgroups.isGroupBlockedreports as blocked. It also skips a group whengroups.isGroupBlockedthrows. The application does not have to send each master key or callsyncGroup()after the link. The SDK group store does not list a group that has only an older-format record. Any read or write of the group migrates the record to the current format and lists the group. On the active device, callgetGroupInitStatus(groupId)once for each group ID that the application holds before the link. Use a client withgroupswhose group store is the store that the link copies from.hosted.onProgressreports the phase'copying'for the'device-link'operation before the copy. Aswitchstatement onphasemust handle'copying'. - Pass the active group store when a client runs during the link. The
activeGroupStoreoption is the group store that the link copies from. The default is the SDK group store onactiveDeviceStorage. If a client runs on the active device during the link, pass that client's group store, or stop that client first. - Handle a rejected first sync. When the first sync of the linked client fails,
linkHostedSignalProtocolRelayDevice()stops the client and rejects withOpenE2EE Signal Protocol Relay initial synchronization failed. CalllinkHostedSignalProtocolRelayDevice()again with the same stores. The call resumes the link and gets the same device. - Custom
hosted.adapter: throwHostedSignalProtocolRelayHttpErrorfor a Relay refusal. The package root and/clientexport the error. Give it thestatus,code,message, andretryableof the refusal. A refusal withretryablefalse and the codeKEY_PROOF_INVALIDorCONFLICTstarts a rollback of the link. From SDK 14.6.0, a refusal withNOT_PRIMARYalso starts a rollback. The rollback removes the link state and the copied groups. It keeps the identity records and the registration, so the next call sends the same registration ID. A completed link has no rollback. The call cannot tell whether the Relay accepted the link before the error, so throw this error only for a refusal of the link request. Every other error from the adapter keeps the link state, and the next call resumes the link.
A device that a 12.x release linked keeps its registration ID. A link that a 12.x release began and did not complete keeps its stored registration ID, and the next call registers the same device. Session records keep version 4, so the SDK reads the stored sessions of 12.x. The changelog lists each change.
Upgrading from 11.x to 12.0.0
12.0.0 is a major release. Every new session uses PQXDH, the managed device link replaces device provisioning, and a receive keeps its content until the application completes it. To upgrade from 11.x:
-
Remove the classical fallback.
'required'is the onlypostQuantumvalue, and the SDK has no classical key agreement.postQuantum: 'compatible'throwsUnsupported postQuantum policyat client creation. A peer bundle without an ML-KEM prekey fails withPQXDH_REQUIRED.PostQuantumPolicy.Compatible,allowClassicalFallback,ClassicalFallbackReason,usedClassicalFallback,classicalFallbackReason, andX3DH_INFO_DEFAULTare removed.PQXDHFallbackTypeandfallbackTypeare removed. ReadPQXDHRequiredError.reasoninstead, which isno_kyber_prekeyorpqxdh_failed. The X3DH module and its exports are removed. A stored 11.x classical session continues as a Double Ratchet session. -
Remove device provisioning. The SDK does not ship the device provisioning protocol. These names are removed: the
./device/provisioningsubpath and all of its exports,PROVISIONING_SESSION_TTL_MSfrom./device/constants,getDeviceMetadatafrom./device/expoand./device/react-native,ProvisioningServicefrom./remote/relay/types, andDeviceChoice.requiresQR. For the device fields of a transfer, usegetTransferDeviceInfo().The managed device link is in the package root and
./client. In the two-device link, a new device with an empty store callsjoinHostedSignalProtocolRelayAccount(), and device 1 callsapproveHostedSignalProtocolRelayDeviceLink(). The account identity goes to the new device in an encrypted envelope, and the private keys that open it stay on the new device. The one-process link,linkHostedSignalProtocolRelayDevice(), needs the account identity in the new store from device transfer or an application channel. It sends no private key to the Relay. See multi-device. -
Custom relays: drop the provisioning methods.
SignalProtocolRelayServerno longer hascreateProvisioningSession,connectNewDevice,sendProvisioningMessage,getProvisioningMessage,completeProvisioning,acknowledgeProvisioning,rollbackProvisioning, ordeleteProvisioningSession. It extends onlyKeyRotationService. See adapters. -
Handle receive outcomes.
processIncomingEnvelope()returns aReceiveOutcomein place of the plaintext. Itskindisprocessed,pending,duplicate,null-message,denied, orrefused. Acknowledge the envelope for each kind exceptrefused. Arefusedoutcome means that the receive queue has no room, so give the envelope again later. Aprocessedreceive keeps its content on the device until you callcompleteReceive()with itsmessageId, or until theonPersistoption resolves.processIncomingEnvelopes()returns{ envelope, outcome }or{ envelope, error }for each envelope.decryptGroupMessage()is deprecated. See receive outcomes. -
Check the receive queue bounds.
protocol.receiveQueuebounds the stored receives.maxItemsis 3000 andmaxBytesis 750 MiB by default. Stored content waits at most 30 days, and that age is fixed. Client creation refusesprotocol.receiveQueue.maxAgeMs. The newonReceiveExpiredhook reports content before the client drops it. A receive pass waits at most 2 minutes for each hook. SetreceiveHookTimeoutMswhen a hook can run longer. -
Check content recovery.
protocol.contentRecoverydecides whether the local store may keep the plaintext of a resendable message. The default mode,require-protected, keeps it only when the store is encrypted and its key is in an operating system keychain or a declared application vault. The IndexedDB store with the IndexedDB vault keeps its key in the same origin storage, so the default keeps no content there. A retry request for a direct message then resets the session with no content. ReadcontentRecoveryStatusfor the decision. To keep content recovery on a web store, use a keychain or an application vault, or setallow-co-located-keyafter a product review.retentionMssets the retention, at most 30 days. -
Handle the new retry ends and hooks. A retry request now ends 14 days after its first attempt. Before, it ended after 24 hours. A retry request is sealed when the client can seal it.
RetryTerminalClassaddsattempts-exhaustedandmembership-refused, so a switch over it must handle both. The new hooks areonDeliveryError,onDeliveryRecovered,onReceiveExpired, andonRelayProtocolError.SendResultaddsrefusedDestinationCountandsyncPending. WhensyncPendingis true, callsend()again with the sameclientMessageIdto post the pending sync copies. See hooks. -
Custom local stores: implement the new contract. Client creation fails when the store declares no
protection. The declaration must state what the store does, because it adds no encryption. The store must also implement these interfaces and methods:- the
SendLogStoremethods, andrewriteMessageRecordsonMessageRecordStore - the six
SenderKeyHandoffStoremethods, with each row delete in the same write as the change that causes it getReceiveWork,putReceiveWork,listReceiveWork,receiveWorkUsage, andcompleteReceiveWork, which replacegetReceivedContent,deleteReceivedContent, anddeleteExpiredReceivedContent- a receive record write in the same transaction as the session or sender key state
- the
removedAtfield of a device record onSesameStore getGroupReceiveRecord,updateGroupReceiveRecord, andlistGroupReceiveRecordsonGroupStateStore
A custom key-value backend applies
removeSenderKeyHandoffsinsideatomicWrite. A customKeyStorageOpsaddsclearSendLog(). The built-in stores already implement all of these. See adapters. - the
-
Custom content adapters: add the new methods.
SignalProtocolContentAdapteraddsserializeContentWithGroupContext,withoutGroupContext,serializeContentBesideSenderKeyDistribution, andwithoutSenderKeyDistribution.inspectContentreportsgroupContextand the requiredsenderKeyDistributionOnlyboolean. The default adapter implements them. -
Ask users to verify safety numbers again. Safety numbers order the two parties as libsignal does. For some identifier pairs, the displayed number differs from the 11.x number. The composite QR profile steps from version 3 to version 4, so a QR code from an 11.x client reports
version_mismatch.SafetyNumberConfirmation.versionsteps from 1 to 2, andconfirmSafetyNumberrefuses a version 1 confirmation. Callverify()again and show the new safety number. -
Plan for a forward-only store. The SQLite schema moves to version 6 and the IndexedDB database to version 11. An earlier SDK refuses the SQLite file with
SqliteSchemaTooNewError, and the browser refuses the IndexedDB open with aVersionError. The IndexedDB and key-value stores encrypt their metadata values at the first open. A downgrade is not supported. See local storage. -
Remove the dropped ratchet exports. The skipped-key cap now applies to each receiver chain, 2000 keys by default.
countTotalMessageKeysandevictOldestMessageKeyare removed.cleanupSPQRStateandSPQR_CONFIG.MAX_SKIPPED_KEY_AGEare removed.trimEpochSkippedKeys(state, epoch)replacestrimSkippedKeys.
A removed device now keeps its record and its archived sessions, and it gets no fan-out. A send to a user whose devices are all removed fails with NO_DEVICES. The session record format stays at version 4. The changelog lists each change.
Upgrading from 9.5.0 to 10.0.0
10.0.0 reports each delivery by its source, and the Relay can take the delivery receipt. To upgrade from 9.5.0:
- Replace
onDeliveryReceiptReceivedwithonDelivered. The new hook receives oneDeliveredEventfor each new receipt source of each recipient device. It does not receive a sender ID and timestamps. ReadclientMessageIdandrecipientDeviceIdfrom the event. A Relay delivery receipt addssource: 'relay'. An E2EE receipt addssource: 'e2ee'.decryptionConfirmedis true only after an E2EE receipt. TheDeliveredEventandDeliverySourcetypes are exported. See hooks. - Remove unknown hook names.
registerHook()and thehooksoption of client creation now throw for a name that is not a hook. A removed or misspelled hook name therefore fails at registration. RemoveonDeliveryReceiptReceivedfrom eachhooksoption and eachregisterHook()call. - Stop using
IMPLICIT_ENVELOPE_TYPESandserver_delivery_receipt. Both are removed. An envelope is implicit only when itscontentHintisContentHint.Implicit. UseisImplicitContentType()from./client/constantsto test an envelope. See package subpaths. - Check the
'auto'delivery receipts. On the Signal Protocol Relay,deliveryReceipts: 'auto'now leaves the receipt to the Relay when it can. The client sends no E2EE receipt for an identified message that the Relay acknowledgment lists as receipted. A sealed message always gets the E2EE receipt. Only an E2EE receipt deletes the retry copy on the sender device. SetdeliveryReceipts: 'always'to send an E2EE receipt for each message that asks for one. See delivery receipts.
The changelog lists each change.
Upgrading from 9.4.0 to 9.5.0
9.5.0 moves the retry request into the mailbox. To upgrade from 9.4.0:
- Receive pulled batches with
receiveIncomingEnvelopes(). A retry request is now aretry_requestenvelope in the mailbox of the sender device. The relay subscription andreceiveIncomingEnvelopes()handle it.processIncomingEnvelope()throwsINVALID_CIPHERTEXTfor it. A batch that goes throughprocessIncomingEnvelopes()therefore never sends the resend. Remove each call tostartRetryRequestSubscription(). The relay subscription carries retry requests. See offline and reconciliation. - Custom relays: carry
retry_requestlike any other envelope.SignalProtocolRelayServerno longer hassendRetryRequestorsubscribeRetryRequests. Store and deliver an envelope withmessageType: 'retry_request'. A relay that assigns its own envelope IDs must deliver theclientMessageIdwith the envelope on every delivery path.Envelope.operationEpochMillisecondsand a new last parameter ofsendMultiRecipientUnidentified()carry the operation epoch of a post. See adapters. - Without a relay: change the
sendRetryRequestcallback.ProcessEnvelopeOptions.sendRetryRequestreceived aRetryRequestin 9.4.0. It now receives aretry_requestEnvelope. Deliver that envelope to the sender device like any other envelope. - Convex relay component: deploy the new component. The component no longer has a retry-request table, its cron, or its three functions.
- Custom content adapters: set
nullMessage.InspectedSignalProtocolContent.nullMessageis now a requiredboolean. Set it on everyinspectContent()result. Set it totruefor your own null encoding. The default adapter sets it. - Remove
runPeriodicCleanup(). It cleaned only a map that the client no longer fills. Remove each call to it.
The changelog lists each change.
Upgrading from 8.2.0 to 9.0.0
9.0.0 is a major release. The public package now contains only client code. To upgrade from 8.2.0:
- Remove the
/remote/relay/memoryimports. The/remote/relay/memoryentry is removed, withinMemoryRelay()andInMemorySignalProtocolRelayServer. The package contains no relay implementation. UsecreateHostedSignalProtocolClient()with a Sandbox environment of the OpenE2EE Signal Protocol Relay, or pass an application-ownedSignalProtocolRelayServertocreateSignalProtocolClient(). A test relay is your code: see testing encrypted flows. - Convex R2: write the broker functions. The
/remote/object-store/convex-r2/serverentry is removed, withdefineConvexR2ObjectStore(). Your Convex backend exports the four functions thatConvexR2ObjectStoreApitypes. The@convex-dev/r2peer is removed, because your backend mounts the component. See object store adapters. - Remove the group server imports. The
/groups/serverentry is removed. The group server engine, the credential and certificate issuers, and the group administration CLI stay private. Group encryption, credential receipt, and presentation stay public. - Reset group sender-key state. Sender Keys now use HKDF-Extract before HKDF-Expand. Sender-key state and distribution messages require
senderKeyVersion: 'v2', and signed frames require version byte0x44. Old state, distributions, and frames fail closed. Before you upgrade, discard queued group sends and reset group sender-key state on every device. Then redistribute keys with upgraded peers. The SQLite stores discard skipped keys from the old schema. - Custom local stores: update the skipped Sender Key contract. Apply
SenderKeyReceiveCommit.skippedKeysatomically with the record. AddsenderKeyIdto skipped-key lookup, storage, and deletion.SenderKeyReceiveCommit.consumedSkippedKeynow carries the identifier and index. A custom key-value backend implementspruneSkippedSenderKeysinsideatomicWrite.
The fix for overlapping Braid sessions does not change the wire format or the persisted state format. The changelog lists each change.
Upgrading from 7.2.0 to 8.0.0
8.0.0 is a major release. To upgrade from 7.2.0:
- React Native and Expo: install a global random source. Install
react-native-get-random-values2.x orreact-native-quick-crypto, and load it before the first SDK call. - Pass a secret vault. The profile key, the device ID, the device-lifecycle state, and the key-value store's value key live in a
SignalProtocolLocalSecretVaultthat your app passes. A call without one throwsSECRET_VAULT_REQUIRED. Bare React Native apps can use/local/vault/react-native-keychain, Expo apps/local/vault/expo-secure-store, and Electron apps/local/vault/electron-safe-storage. - Key-value store: change the import and the names. The store moves from
/local/store/react-nativeto/local/store/key-value, and its names drop theReactNativeprefix. To keep existing data, move its value key into the vault before the first open. - Bare React Native:
/local/store/react-nativeis now the SQLite store.reactNativeStore()opens an SDK-owned SQLCipher database on the optional peer@op-engineering/op-sqlite18.2.5 or later, with the op-sqlite SQLCipher build turned on. - Expo: await the store. Replace
expoStore()withawait expoStore(). The SDK owns the database, its schema, and its key. - Node and Electron: open the new SQLCipher store.
nodeStore({ directory, vault })opens an SDK-owned SQLCipher database on the optional peerbetter-sqlite3-multiple-ciphers13.0.3 or later. It does not read the files of the 7.2.0 Node store. - Remove the deleted names. The
/local/store/expo/dband/local/store/expo/schemaentries, the Expo database and key functions, the profile-key storage functions,createReferenceReactNativeBackend, and thedrizzle-orm,expo-crypto, andfs-native-extensionspeers are removed. - Signal Protocol Relay: copy the connection URL from the Console again. The API path and the developer environment kind changed, and the sandbox and staging hosts have new names.
Browser apps can also use the new /local/store/web-sqlite store. It is optional, and the IndexedDB store stays at /local/store/web. In 8.0.0 the web SQLite store is experimental. From 8.1.0, it is supported, and it is the store for browsers where the origin private file system works. The changelog lists each change.
Persisted formats: reset, not migrated
Session records carry a format version. The current version is 4, and the SDK's storage boundary requires "rejection of stale-format writes before replacing current state" and "removal or rejection of stale persisted session records on read."
The rule is direct: the SDK rejects and resets older session formats instead of migrating them.
Here is what that means in a deployed application. A user upgrades. On the next read of an older session record, the SDK discards it instead of updating it in place. The session is gone. The next message to or from that peer establishes a fresh session from a prekey bundle.
What the user experiences:
- The user cannot send to that peer until a bundle fetch succeeds. The relay must be reachable for this fetch.
- Messages that were in flight under the old session, encrypted before the reset, become undecryptable. Depending on your handling they surface as
SESSION_NOT_FOUNDorDECRYPTION_FAILED. - On the peer's side, a new session establishment from someone they already had a session with. If your product surfaces session resets to users, this looks like an event. If it does not, it is invisible.
What the user does not experience: an identity change. A session reset does not rotate identity keys and does not void safety numbers. Verification survives. Say this explicitly in whatever notice you show, because "your session was reset" reads to a security-conscious user like "you were attacked" unless you distinguish the two.
Before an upgrade changes a persisted format, plan for many users to lose sessions on the same day. The resulting bundle-fetch burst can reach your relay at once.
Protocol policy
The defaults are postQuantum: 'required' and braid: 'required'. Required mode means post-quantum session establishment and the post-quantum message ratchet are both mandatory, and a peer with no post-quantum material fails closed. That failure surfaces as PQXDHRequiredError.
const client = await createSignalProtocolClient({
identity: { userId },
adapters: { storage, relay },
protocol: { postQuantum: 'required', braid: 'required' },
});'required' is the only postQuantum value. The SDK has no classical key agreement, and no setting allows a classical X3DH session. Version 12.0.0 removed the classical fallback with no replacement, and postQuantum: 'compatible' throws Unsupported postQuantum policy at client creation. A stored 11.x classical session continues as a Double Ratchet session.
braid: 'disabled' keeps post-quantum establishment required and uses the direct ML-KEM SPQR mode instead of the Braid profile. The documentation defines it as an explicit escape hatch for product-reviewed constraints, not downgrade recovery. There is no public postQuantum: 'disabled' mode.
Spec revision pins
The profile pins specific published revisions instead of "the Signal Protocol" in general.
| Specification | Revision |
|---|---|
| X3DH, for the shared DH steps of PQXDH | Revision 1, 2016-11-04 |
| PQXDH | Revision 3, 2023-05-24 (last updated 2024-01-23) |
| Double Ratchet | Revision 4, 2025-11-04 |
| Sesame | Revision 2, 2017-04-14 |
| ML-KEM Braid | Revision 1, 2025-02-21 (last updated 2025-09-26) |
When a pin changes in a future release, read the release notes carefully. A revision change can alter wire behavior or persisted shapes.
There is no wire compatibility with Signal Messenger
This matters when someone in your organization hears "upgrade" and thinks "interoperate."
"Public keys and ciphertexts require exactly 0x0A || raw ML-KEM-1024 bytes." And: "The 0x0A encoding is distinct from Signal Messenger deployments that use round-3 Kyber1024 tagged 0x08."
Untagged values, the 0x08 tag, unknown tags, and wrong lengths fail before secret derivation or state commit. This is a deliberate, checkable difference, not an accident of version drift, and no future release turns it into interoperability. Signal Protocol is the published specification family. Signal Messenger is an unaffiliated product. Upgrading this SDK never means talking to it.
Rolling upgrades across a device population
Your users do not upgrade at once. App-store rollout, corporate MDM, and delayed user updates create a mixed population. The two ends of a session can use different versions.
INVALID_CIPHERTEXT is the code you see when a client receives a message it cannot parse at the protocol version it implements. The SDK raises it and fails closed. It does not negotiate down, and it does not decide what your product should do about it. processIncomingEnvelope() also raises it for a retry_request envelope. That is not a version mismatch. Give that envelope to receiveIncomingEnvelopes().
Retry requests do not cross the 9.5.0 boundary. A 9.4.0 client does not handle a retry_request envelope. A 9.5.0 client has no retry subscription. It therefore does not get the retry requests of a 9.4.0 client. A message that fails to decrypt between a 9.5.0 device and an older device therefore gets no resend.
The application owns version-negotiation policy. That is a product decision with real options and no SDK default:
- Publish a minimum supported version and refuse to run below it, with a forced-update screen. Clean, and it locks out users you may not be able to reach.
- Accept the split and surface an honest per-conversation message when a peer's client is too old. Keeps everyone running, adds a support category.
- Stage the rollout so that the receiving capability ships in an earlier release than the sending behavior that requires it. More release cycles, far fewer broken conversations.
Most teams select the third option after they try the first. If a release changes sent data, ship the receive capability one release earlier. Enable sending after telemetry shows that the receiving version reached the target population. client.getStats() and your version reporting provide the required data.
Rollback has two practical constraints. The SDK does not support downgrading a device after it writes version: 4 session records. An older build rejects the newer format, just as a newer build rejects an older format. After a 12.0.0 client opens a store, an earlier SDK cannot open it. See the 12.0.0 store steps. An upgraded peer does not have to communicate with a peer that rolled back. Treat SDK upgrades as forward-only for each device. Use feature flags, not package versions, for rollback safety.
Upgrade checklist
- Read the release notes for changes to the spec revision pins table.
- Check whether the session record version changed. If it did, expect population-wide session resets and a bundle-fetch burst.
- Confirm your outbound queue survives a period with no establishable session.
- Confirm
INVALID_CIPHERTEXTfrom a malformed message reaches a user-facing state, not a silent drop. Give pulled batches toreceiveIncomingEnvelopes(), so a retry request from a peer never surfaces as this error. - Verify your
protocolpolicy is still what you intended. No setting suppressesPQXDHRequiredError. Itsreasonisno_kyber_prekeyorpqxdh_failed. - Stage receive-then-send if the release changes the outbound format.
- Re-run the failure-path suite in testing against the new version before rollout.
Opacity ledger
| Artifact | Stays on device | Sent to relay | In object store | Visible as metadata |
|---|---|---|---|---|
Session record (version: 4) | yes | no | no | no |
| Stale-format session record | discarded on read | no | no | no |
KyberPreKey public half (0x0A-tagged) | yes | yes | no | tag and length are visible |
| SDK version in use | yes | your telemetry only | no | not carried by the protocol |
INVALID_CIPHERTEXT occurrence | yes | no | no | safe as a counter |
| Message plaintext | yes | no | no | no |
Next
Deletion and device revocation
What deletion can and cannot mean in an encrypted system, and the lifecycle operations that actually revoke access.
Security review checklist
What a platform or security team can verify about this SDK, what it cannot, and which questions belong to the application team instead.