@open-e2ee/signal-protocol-sdk 0.4.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (220) hide show
  1. package/CHANGELOG.md +63 -5
  2. package/README.md +10 -7
  3. package/SECURITY.md +2 -2
  4. package/THIRD_PARTY_NOTICES.md +1 -1
  5. package/device/README.md +7 -5
  6. package/dist/client/client.d.ts +3 -2
  7. package/dist/client/client.d.ts.map +1 -1
  8. package/dist/client/client.js +58 -25
  9. package/dist/client/client.js.map +1 -1
  10. package/dist/client/config.d.ts +46 -7
  11. package/dist/client/config.d.ts.map +1 -1
  12. package/dist/client/config.js +2 -2
  13. package/dist/client/config.js.map +1 -1
  14. package/dist/client/group-outbox.d.ts +38 -0
  15. package/dist/client/group-outbox.d.ts.map +1 -0
  16. package/dist/client/group-outbox.js +221 -0
  17. package/dist/client/group-outbox.js.map +1 -0
  18. package/dist/client/group-sealed-sender.d.ts +28 -0
  19. package/dist/client/group-sealed-sender.d.ts.map +1 -0
  20. package/dist/client/group-sealed-sender.js +74 -0
  21. package/dist/client/group-sealed-sender.js.map +1 -0
  22. package/dist/client/hosted-push.d.ts +77 -0
  23. package/dist/client/hosted-push.d.ts.map +1 -0
  24. package/dist/client/hosted-push.js +90 -0
  25. package/dist/client/hosted-push.js.map +1 -0
  26. package/dist/client/hosted.d.ts +207 -0
  27. package/dist/client/hosted.d.ts.map +1 -0
  28. package/dist/client/hosted.js +505 -0
  29. package/dist/client/hosted.js.map +1 -0
  30. package/dist/client/index.d.ts +4 -2
  31. package/dist/client/index.d.ts.map +1 -1
  32. package/dist/client/index.js +2 -0
  33. package/dist/client/index.js.map +1 -1
  34. package/dist/client/relay-subscription.d.ts.map +1 -1
  35. package/dist/client/relay-subscription.js +34 -7
  36. package/dist/client/relay-subscription.js.map +1 -1
  37. package/dist/client/{sealed-sender-ops.d.ts → sealed-sender.d.ts} +39 -22
  38. package/dist/client/sealed-sender.d.ts.map +1 -0
  39. package/dist/client/sealed-sender.js +296 -0
  40. package/dist/client/sealed-sender.js.map +1 -0
  41. package/dist/client/signal-service-cipher.d.ts +23 -26
  42. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  43. package/dist/client/signal-service-cipher.js +465 -706
  44. package/dist/client/signal-service-cipher.js.map +1 -1
  45. package/dist/client/types.d.ts +18 -3
  46. package/dist/client/types.d.ts.map +1 -1
  47. package/dist/client/types.js +6 -0
  48. package/dist/client/types.js.map +1 -1
  49. package/dist/device/index.d.ts +2 -2
  50. package/dist/device/index.d.ts.map +1 -1
  51. package/dist/device/index.js +1 -1
  52. package/dist/device/index.js.map +1 -1
  53. package/dist/device/transfer.d.ts +7 -43
  54. package/dist/device/transfer.d.ts.map +1 -1
  55. package/dist/device/transfer.js +31 -150
  56. package/dist/device/transfer.js.map +1 -1
  57. package/dist/device/types.d.ts +6 -47
  58. package/dist/device/types.d.ts.map +1 -1
  59. package/dist/device/types.js +1 -1
  60. package/dist/device/types.js.map +1 -1
  61. package/dist/index.d.ts +5 -4
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +2 -1
  64. package/dist/index.js.map +1 -1
  65. package/dist/internal/encoding/proto/pq-ratchet-serialize.js +1 -1
  66. package/dist/internal/encoding/proto/pq-ratchet-serialize.js.map +1 -1
  67. package/dist/internal/encoding/proto/primitives.js +1 -1
  68. package/dist/internal/encoding/proto/primitives.js.map +1 -1
  69. package/dist/internal/groups/manager.d.ts +3 -3
  70. package/dist/internal/groups/manager.d.ts.map +1 -1
  71. package/dist/internal/groups/manager.js +5 -4
  72. package/dist/internal/groups/manager.js.map +1 -1
  73. package/dist/internal/protocol/sealed-sender/certificate.d.ts +10 -4
  74. package/dist/internal/protocol/sealed-sender/certificate.d.ts.map +1 -1
  75. package/dist/internal/protocol/sealed-sender/certificate.js +64 -7
  76. package/dist/internal/protocol/sealed-sender/certificate.js.map +1 -1
  77. package/dist/internal/protocol/sealed-sender/decryption.d.ts +34 -47
  78. package/dist/internal/protocol/sealed-sender/decryption.d.ts.map +1 -1
  79. package/dist/internal/protocol/sealed-sender/decryption.js +95 -182
  80. package/dist/internal/protocol/sealed-sender/decryption.js.map +1 -1
  81. package/dist/internal/protocol/sealed-sender/encryption.d.ts +49 -64
  82. package/dist/internal/protocol/sealed-sender/encryption.d.ts.map +1 -1
  83. package/dist/internal/protocol/sealed-sender/encryption.js +120 -123
  84. package/dist/internal/protocol/sealed-sender/encryption.js.map +1 -1
  85. package/dist/internal/protocol/sealed-sender/index.d.ts +5 -7
  86. package/dist/internal/protocol/sealed-sender/index.d.ts.map +1 -1
  87. package/dist/internal/protocol/sealed-sender/index.js +4 -12
  88. package/dist/internal/protocol/sealed-sender/index.js.map +1 -1
  89. package/dist/internal/protocol/sealed-sender/{v2-helpers.d.ts → multi-recipient-crypto.d.ts} +1 -1
  90. package/dist/internal/protocol/sealed-sender/multi-recipient-crypto.d.ts.map +1 -0
  91. package/dist/internal/protocol/sealed-sender/{v2-helpers.js → multi-recipient-crypto.js} +1 -1
  92. package/dist/internal/protocol/sealed-sender/multi-recipient-crypto.js.map +1 -0
  93. package/dist/internal/protocol/sealed-sender/{v2-binary.d.ts → multi-recipient-message.d.ts} +3 -2
  94. package/dist/internal/protocol/sealed-sender/multi-recipient-message.d.ts.map +1 -0
  95. package/dist/internal/protocol/sealed-sender/{v2-binary.js → multi-recipient-message.js} +16 -8
  96. package/dist/internal/protocol/sealed-sender/multi-recipient-message.js.map +1 -0
  97. package/dist/internal/protocol/sealed-sender/proto/index.d.ts +3 -0
  98. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  99. package/dist/internal/protocol/sealed-sender/proto/index.js +25 -2
  100. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  101. package/dist/internal/protocol/sealed-sender/trust-root.d.ts +11 -1
  102. package/dist/internal/protocol/sealed-sender/trust-root.d.ts.map +1 -1
  103. package/dist/internal/protocol/sealed-sender/trust-root.js +13 -1
  104. package/dist/internal/protocol/sealed-sender/trust-root.js.map +1 -1
  105. package/dist/internal/protocol/sealed-sender/types.d.ts +20 -135
  106. package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -1
  107. package/dist/internal/protocol/sealed-sender/types.js +15 -6
  108. package/dist/internal/protocol/sealed-sender/types.js.map +1 -1
  109. package/dist/internal/protocol/sender-keys/manager.d.ts +22 -1
  110. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  111. package/dist/internal/protocol/sender-keys/manager.js +39 -4
  112. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  113. package/dist/internal/protocol/spqr/braid-serialize.js +1 -1
  114. package/dist/internal/protocol/spqr/braid-serialize.js.map +1 -1
  115. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js +4 -4
  116. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js.map +1 -1
  117. package/dist/internal/protocol/zk/groups/index.d.ts +1 -1
  118. package/dist/internal/protocol/zk/groups/index.d.ts.map +1 -1
  119. package/dist/internal/protocol/zk/groups/index.js +1 -1
  120. package/dist/internal/protocol/zk/groups/index.js.map +1 -1
  121. package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts +37 -12
  122. package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts.map +1 -1
  123. package/dist/internal/protocol/zk/groups/profile-key-credential.js +104 -31
  124. package/dist/internal/protocol/zk/groups/profile-key-credential.js.map +1 -1
  125. package/dist/local/store/expo/adapter.d.ts +1 -0
  126. package/dist/local/store/expo/adapter.d.ts.map +1 -1
  127. package/dist/local/store/expo/adapter.js +3 -0
  128. package/dist/local/store/expo/adapter.js.map +1 -1
  129. package/dist/local/store/expo/key-storage.d.ts +1 -0
  130. package/dist/local/store/expo/key-storage.d.ts.map +1 -1
  131. package/dist/local/store/expo/key-storage.js +4 -0
  132. package/dist/local/store/expo/key-storage.js.map +1 -1
  133. package/dist/local/store/memory/adapter.d.ts +1 -0
  134. package/dist/local/store/memory/adapter.d.ts.map +1 -1
  135. package/dist/local/store/memory/adapter.js +4 -0
  136. package/dist/local/store/memory/adapter.js.map +1 -1
  137. package/dist/local/store/node/adapter.d.ts +1 -0
  138. package/dist/local/store/node/adapter.d.ts.map +1 -1
  139. package/dist/local/store/node/adapter.js +3 -0
  140. package/dist/local/store/node/adapter.js.map +1 -1
  141. package/dist/local/store/node/database.d.ts +1 -0
  142. package/dist/local/store/node/database.d.ts.map +1 -1
  143. package/dist/local/store/node/database.js +5 -0
  144. package/dist/local/store/node/database.js.map +1 -1
  145. package/dist/local/store/react-native/adapter.d.ts +1 -0
  146. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  147. package/dist/local/store/react-native/adapter.js +4 -0
  148. package/dist/local/store/react-native/adapter.js.map +1 -1
  149. package/dist/local/store/react-native/reference-backend.js +1 -1
  150. package/dist/local/store/react-native/reference-backend.js.map +1 -1
  151. package/dist/local/store/reliability.d.ts +63 -0
  152. package/dist/local/store/reliability.d.ts.map +1 -0
  153. package/dist/local/store/reliability.js +219 -0
  154. package/dist/local/store/reliability.js.map +1 -0
  155. package/dist/local/store/web/adapter.d.ts +1 -0
  156. package/dist/local/store/web/adapter.d.ts.map +1 -1
  157. package/dist/local/store/web/adapter.js +5 -0
  158. package/dist/local/store/web/adapter.js.map +1 -1
  159. package/dist/remote/relay/convex/backend.d.ts +4 -14
  160. package/dist/remote/relay/convex/backend.d.ts.map +1 -1
  161. package/dist/remote/relay/convex/backend.js +11 -20
  162. package/dist/remote/relay/convex/backend.js.map +1 -1
  163. package/dist/remote/relay/convex/component/_generated/component.d.ts +7 -14
  164. package/dist/remote/relay/convex/component/_generated/component.d.ts.map +1 -1
  165. package/dist/remote/relay/convex/component/certificates.d.ts.map +1 -1
  166. package/dist/remote/relay/convex/component/certificates.js +14 -5
  167. package/dist/remote/relay/convex/component/certificates.js.map +1 -1
  168. package/dist/remote/relay/convex/component/messages.d.ts +0 -13
  169. package/dist/remote/relay/convex/component/messages.d.ts.map +1 -1
  170. package/dist/remote/relay/convex/component/messages.js +13 -47
  171. package/dist/remote/relay/convex/component/messages.js.map +1 -1
  172. package/dist/remote/relay/convex/component/schema.d.ts +3 -1
  173. package/dist/remote/relay/convex/component/schema.js +1 -0
  174. package/dist/remote/relay/convex/component/schema.js.map +1 -1
  175. package/dist/remote/relay/convex/component/zkAuth.d.ts +7 -1
  176. package/dist/remote/relay/convex/component/zkAuth.d.ts.map +1 -1
  177. package/dist/remote/relay/convex/component/zkAuth.js +29 -14
  178. package/dist/remote/relay/convex/component/zkAuth.js.map +1 -1
  179. package/dist/remote/relay/convex/relay.d.ts +2 -5
  180. package/dist/remote/relay/convex/relay.d.ts.map +1 -1
  181. package/dist/remote/relay/convex/relay.js +17 -47
  182. package/dist/remote/relay/convex/relay.js.map +1 -1
  183. package/dist/remote/relay/memory/adapter.d.ts +4 -10
  184. package/dist/remote/relay/memory/adapter.d.ts.map +1 -1
  185. package/dist/remote/relay/memory/adapter.js +31 -34
  186. package/dist/remote/relay/memory/adapter.js.map +1 -1
  187. package/dist/remote/relay/types.d.ts +6 -19
  188. package/dist/remote/relay/types.d.ts.map +1 -1
  189. package/dist/types/api.d.ts +2 -0
  190. package/dist/types/api.d.ts.map +1 -1
  191. package/dist/types/errors.d.ts +3 -1
  192. package/dist/types/errors.d.ts.map +1 -1
  193. package/dist/types/errors.js +4 -2
  194. package/dist/types/errors.js.map +1 -1
  195. package/dist/types/protocol-config.d.ts +1 -1
  196. package/dist/username/link.d.ts.map +1 -1
  197. package/dist/username/link.js +1 -1
  198. package/dist/username/link.js.map +1 -1
  199. package/docs/ASSURANCE.md +5 -5
  200. package/docs/DEVIATIONS.md +32 -61
  201. package/docs/GETTING_STARTED.md +7 -0
  202. package/docs/SECURITY.md +6 -0
  203. package/package.json +1 -1
  204. package/remote/relay/convex/component/README.md +20 -14
  205. package/scripts/oe-groups.mjs +5 -1
  206. package/dist/client/sealed-sender-ops.d.ts.map +0 -1
  207. package/dist/client/sealed-sender-ops.js +0 -203
  208. package/dist/client/sealed-sender-ops.js.map +0 -1
  209. package/dist/internal/protocol/sealed-sender/decryption-v2.d.ts +0 -46
  210. package/dist/internal/protocol/sealed-sender/decryption-v2.d.ts.map +0 -1
  211. package/dist/internal/protocol/sealed-sender/decryption-v2.js +0 -198
  212. package/dist/internal/protocol/sealed-sender/decryption-v2.js.map +0 -1
  213. package/dist/internal/protocol/sealed-sender/encryption-v2.d.ts +0 -56
  214. package/dist/internal/protocol/sealed-sender/encryption-v2.d.ts.map +0 -1
  215. package/dist/internal/protocol/sealed-sender/encryption-v2.js +0 -163
  216. package/dist/internal/protocol/sealed-sender/encryption-v2.js.map +0 -1
  217. package/dist/internal/protocol/sealed-sender/v2-binary.d.ts.map +0 -1
  218. package/dist/internal/protocol/sealed-sender/v2-binary.js.map +0 -1
  219. package/dist/internal/protocol/sealed-sender/v2-helpers.d.ts.map +0 -1
  220. package/dist/internal/protocol/sealed-sender/v2-helpers.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,7 +1,65 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.0.0
4
+
5
+ - **Hosted Relay supports data-only push wake hints across Expo, APNs, FCM,
6
+ and Web Push.** The SDK registers one destination for the authenticated
7
+ device and derives no account, device, scope, or generation identifiers from
8
+ application input. A wake starts an authenticated durable-mailbox pull.
9
+ The SDK acknowledges only envelopes that it processes successfully, and the
10
+ same pull remains available when push delivery is unavailable.
11
+
12
+ - **Hosted Relay now supports provider migration, recovery progress, and
13
+ managed device linking.** Migration assertions use the existing purpose-aware
14
+ identity callback with typed source and target roles. Recovery reports typed
15
+ phases while Relay remains the account authority. Managed linking requires a
16
+ provisioned account identity. It also requires distinct active and new
17
+ device-auth keys. It sends no ratchet, sender-key, skipped-key, or outbox
18
+ state.
19
+
20
+ - **Breaking: sends use a durable exact-ciphertext outbox and always return a
21
+ logical-send identifier.** `SendResult.clientMessageId` is required. The SDK
22
+ generates it when `SendOptions.clientMessageId` is absent, exposes it on send
23
+ errors through `isOutgoingMessageError`, and replays the persisted encrypted
24
+ transmission after an unknown Relay result. Receivers retain processed Relay
25
+ envelope identifiers for 30 days and acknowledge duplicates without running
26
+ protocol decryption again. Automatic sender-key rotation also persists its
27
+ pairwise distribution messages before group transport. Custom
28
+ `ISignalProtocolLocalStore` implementations must now implement
29
+ `deleteMetadata` for bounded outbox and deduplication retention.
30
+
31
+ - **Breaking: linked-device backup format 2 transfers account identity only.**
32
+ A linked device generates fresh prekeys and establishes independent sessions.
33
+ The SDK rejects old or extended backup shapes that carry prekeys, ratchet
34
+ sessions, sender-key state, message state, or outbox state.
35
+
36
+ - **Profile-key credential issuance is blinded.** The authenticated issuer
37
+ receives an ACI-bound blinded request, not the raw profile key. The client
38
+ unblinds and verifies the response before it creates a group presentation.
39
+
40
+ - **Breaking: sealed-sender delivery now uses one multi-recipient wire format
41
+ for direct and group sends.** The direct path supports one recipient through
42
+ the same format, and the SDK rejects the retired V1 wire format. Hosted Relay
43
+ adapters no longer implement the V1 send method. `preferred` delivery falls
44
+ back to identified delivery only after an anonymous authorization rejection;
45
+ other anonymous-delivery failures do not change the privacy route.
46
+
3
47
  ## 0.4.0
4
48
 
49
+ - **Breaking: sender certificates now bind to Relay scope and issuer
50
+ validity.** The signed sender certificate requires an opaque 16-byte scope.
51
+ The signed server certificate requires its validity interval. Recipients
52
+ reject the old certificate shape. The new hosted bootstrap accepts a
53
+ publishable key and identity assertion callback. It then uses the account,
54
+ device, and scope bindings that Relay returns. Identified delivery does not
55
+ require a sender certificate.
56
+
57
+ - **Hosted Relay bootstrap now registers a complete EC and ML-KEM prekey
58
+ inventory.** The SDK creates and stores signed, last-resort, and one-time
59
+ prekeys before bootstrap. It sends only public material. Exact retries reuse
60
+ the original operation and public registration snapshot, so a restarted
61
+ client cannot publish an old one-time prekey as a new registration.
62
+
5
63
  - **The README now provides a runnable encrypted round trip and a current demo.**
6
64
  The quickstart exercises two SDK clients through the in-memory relay. The new
7
65
  recording shows the same two-device and relay flow as the live desktop and
@@ -142,7 +200,7 @@
142
200
  whether the operation produced the epoch secret. Braid mode spreads one
143
201
  ML-KEM key agreement across many messages, and until now the chunk counts
144
202
  lived entirely inside the state machine, so a host had no way to show or log
145
- how far a ratchet had travelled. A direct-mode session never raises the
203
+ how far a ratchet had traveled. A direct-mode session never raises the
146
204
  callback. The hook is guarded exactly as `onProtocolSelected` is: a consumer
147
205
  that throws is logged and the protocol path continues.
148
206
 
@@ -209,7 +267,7 @@
209
267
  install one. An epoch advance for receiving alone installs a zeroed send
210
268
  chain key. Pruning writes one over each retired send chain. Deriving from
211
269
  either would key a message from a known constant. No production path reached
212
- that state, so the check is defence in depth.
270
+ that state, so the check is defense in depth.
213
271
 
214
272
  - **The unused SPQR binary header codec is gone.** `serializeSPQRHeaderBinary`
215
273
  and `deserializeSPQRHeaderBinary` emitted an unversioned framing. No
@@ -980,7 +1038,7 @@
980
1038
  matching the `Type` enum of the reference implementation's
981
1039
  `UnidentifiedSenderMessage.Message` (`PREKEY_MESSAGE`, `MESSAGE`,
982
1040
  `SENDERKEY_MESSAGE`, `PLAINTEXT_CONTENT`), and `SealOptions.groupId` —
983
- encrypted, never populated by the send path — is removed in favour of
1041
+ encrypted, never populated by the send path — is removed in favor of
984
1042
  `contentType`. This is a wire-format change to sealed sender for both V1 and
985
1043
  V2.
986
1044
 
@@ -1061,7 +1119,7 @@
1061
1119
 
1062
1120
  - **Sealed sender envelope parsing is now canonical and validated.** Both the
1063
1121
  V1 and V2 inner-envelope parsers accepted a payload with trailing bytes, an
1064
- unrecognised content-type byte, a truncated varint, or a missing content
1122
+ unrecognized content-type byte, a truncated varint, or a missing content
1065
1123
  hint. Parsing runs after authentication, so none of these was reachable by an
1066
1124
  attacker, but two distinct byte strings could parse to identical content and
1067
1125
  an unknown content type fell through to a routing default. The parsers now
@@ -1235,7 +1293,7 @@
1235
1293
 
1236
1294
  - **Sealed sender can now be enabled.** `oe-groups trust-root` exports the
1237
1295
  Ed25519 sender-certificate root alongside the group trust root, printing both
1238
- labelled (`group trust root:` / `sealed sender trust root:`). Previously only
1296
+ labeled (`group trust root:` / `sealed sender trust root:`). Previously only
1239
1297
  the group root was printed, so there was no supported way to obtain the value
1240
1298
  clients pin in `sealedSender.trustRoots`; inbound sealed-sender validation
1241
1299
  stayed disabled and every send fell back to identified delivery, disclosing
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <img src="https://raw.githubusercontent.com/open-e2ee/design/v0.8.0/brand/generated/open-e2ee-mark-adaptive.svg" alt="OpenE2EE" width="72" height="72">
1
+ <img src="https://raw.githubusercontent.com/open-e2ee/design/v0.9.1/brand/generated/open-e2ee-mark-adaptive.svg" alt="OpenE2EE" width="72" height="72">
2
2
 
3
3
  # OpenE2EE Signal Protocol SDK
4
4
 
@@ -13,24 +13,27 @@
13
13
  [Website](https://open-e2ee.dev) ·
14
14
  [Documentation](https://docs.open-e2ee.dev) ·
15
15
  [Live demo](https://open-e2ee.dev/#demo) ·
16
+ [OpenE2EE Relay](https://open-e2ee.dev/relay) ·
16
17
  [API reference](https://docs.open-e2ee.dev/reference/api) ·
17
18
  [Security](./SECURITY.md)
18
19
 
19
20
  - **One TypeScript package.** Run the same protocol code in Expo, React Native, modern browsers, and Node.
20
21
  - **Post-quantum by default.** The default policy requires PQXDH session establishment and the ML-KEM Braid post-quantum ratchet. Required post-quantum operations fail closed.
21
22
  - **Messaging primitives included.** Build multi-device messaging, groups, sealed sender, encrypted attachments, and safety-number verification.
22
- - **Your infrastructure, behind explicit interfaces.** Your application owns device-local storage. The relay is an interface, not a hosted service. The relay never needs message plaintext or device private keys.
23
+ - **Explicit infrastructure boundaries.** Your application owns device-local storage. Supply your own relay adapter or use [OpenE2EE Relay](https://open-e2ee.dev/relay) for managed encrypted delivery. The relay never needs message plaintext or device private keys.
23
24
  - **AGPLv3, or a commercial license.** Proprietary applications that cannot meet AGPLv3 obligations can use a [commercial license](./COMMERCIAL.md).
24
25
 
25
26
  The protocol code ships without a native crypto module or platform crypto binary. The Expo SQLCipher store requires a development build and native project configuration.
26
27
 
27
- Version `0.4.x`. Public APIs and persisted formats can change before `1.0`.
28
+ Version `1.0.x`. Public APIs and persisted formats follow semantic versioning.
28
29
 
29
30
  OpenE2EE implements a versioned profile of the published Signal Protocol specifications. It is not affiliated with Signal Messenger and is **not wire-compatible with Signal Messenger or libsignal**. Messages, identities, and safety numbers do not interoperate. Read the [full notice](./NOTICE) and [documented deviations](./docs/DEVIATIONS.md).
30
31
 
31
32
  ## See an encrypted round trip
32
33
 
33
- [![Two devices exchange an end-to-end encrypted message through a relay. The relay handles public prekeys and ciphertext. Only the receiving device displays the plaintext.](https://raw.githubusercontent.com/open-e2ee/signal-protocol-js/main/docs/assets/demo/encrypted-round-trip.gif)](https://open-e2ee.dev/#demo)
34
+ Press play for the complete four-message run: device setup, session establishment, encrypted relay delivery, and on-device decryption.
35
+
36
+ https://github.com/user-attachments/assets/d8002bc3-c037-41b6-8f48-4008f2d49e6c
34
37
 
35
38
  The [live demo](https://open-e2ee.dev/#demo) runs two SDK clients against an in-memory relay. On desktop, type a message and inspect the envelope, ratchets, relay mailbox, and decrypted result. On mobile, the same protocol run replays at reading pace. The protocol and cryptography are real. The example simulates infrastructure in memory. Displayed timings exclude network time.
36
39
 
@@ -87,11 +90,11 @@ alice: hello
87
90
 
88
91
  The client factory creates or loads each device identity. When given a relay, it also publishes the public prekey bundle. `send()` fetches Bob's bundle and starts the required post-quantum session. It then gives ciphertext plus routing metadata to the relay. Bob's subscription retrieves and decrypts the envelope on his device.
89
92
 
90
- The in-memory store loses identities, sessions, and ratchet state on restart. The in-memory relay has no authentication, authorization, or durable storage. Do not ship either adapter. Continue with the [hosted Quickstart](https://docs.open-e2ee.dev/start/quickstart), which explains key custody, relay metadata, prekey replenishment, additional devices, and recovery policy.
93
+ The in-memory store loses identities, sessions, and ratchet state on restart. The in-memory relay has no authentication, authorization, or durable storage. Do not ship either adapter. Continue with the [documentation quickstart](https://docs.open-e2ee.dev/start/quickstart), which explains key custody, relay metadata, prekey replenishment, additional devices, and recovery policy.
91
94
 
92
95
  ## Move to production storage
93
96
 
94
- Choose the device-local store for your runtime, then supply a relay that authenticates each device and implements your product's access policy.
97
+ Choose the device-local store for your runtime. Then supply a relay that authenticates each device and implements your product's access policy, or use [OpenE2EE Relay](https://open-e2ee.dev/relay) as the managed delivery path. The SDK does not require the managed service. [Review Relay plans and exact meter definitions.](https://open-e2ee.dev/relay/pricing)
95
98
 
96
99
  | Runtime | Storage path | Deployment boundary |
97
100
  |---|---|---|
@@ -112,7 +115,7 @@ Report a suspected vulnerability privately through the process in [SECURITY](./S
112
115
 
113
116
  ## Why developers choose this SDK
114
117
 
115
- The SDK gives TypeScript applications one maintained package for required post-quantum session establishment and ratcheting, multi-device messaging, groups, sealed sender, attachments, and safety numbers. It keeps protocol state on the device and leaves the relay implementation to the application.
118
+ The SDK gives TypeScript applications one maintained package for required post-quantum session establishment and ratcheting, multi-device messaging, groups, sealed sender, attachments, and safety numbers. It keeps protocol state on the device. Applications can operate a relay adapter or use OpenE2EE Relay for managed delivery.
116
119
 
117
120
  [Compare maintained alternatives and their limits.](https://open-e2ee.dev/product/#how-it-compares)
118
121
 
package/SECURITY.md CHANGED
@@ -7,8 +7,8 @@ backports.
7
7
 
8
8
  | Version | Supported |
9
9
  | ------- | ------------------ |
10
- | 0.4.x | :white_check_mark: |
11
- | < 0.4.0 | :x: |
10
+ | 1.0.x | :white_check_mark: |
11
+ | < 1.0.0 | :x: |
12
12
 
13
13
  ## Reporting a Vulnerability
14
14
 
@@ -1,7 +1,7 @@
1
1
  # Third-party notices
2
2
 
3
3
  This file records third-party source distributed with or adapted by the
4
- OpenE2EE SDK. Dependency distributions may contain additional notices.
4
+ OpenE2EE Signal Protocol SDK. Dependency distributions may contain additional notices.
5
5
 
6
6
  ## @noble/post-quantum
7
7
 
package/device/README.md CHANGED
@@ -14,8 +14,9 @@ The two onboarding operations are deliberately separate:
14
14
 
15
15
  - **Provisioning** adds a linked device. It transfers account identity material
16
16
  and optional account metadata, but not existing sessions or message history.
17
- - **Transfer** migrates local cryptographic state to replacement hardware. It
18
- can include identity keys, prekeys, and sessions in an encrypted backup.
17
+ - **Transfer** sends the same identity-only provisioning bundle over an
18
+ application-owned encrypted device-to-device channel. The receiving device
19
+ generates fresh prekeys and sessions after import.
19
20
 
20
21
  The primary device uses ID `1`. The backend allocates linked device IDs from
21
22
  `2` through `5`. A client must not choose its own linked-device ID.
@@ -147,7 +148,7 @@ const receiving = await prepareNewDeviceTransfer();
147
148
  await appQr.show(receiving.qrCode);
148
149
 
149
150
  const sending = await prepareOldDeviceTransferWithBackup(backupStorage);
150
- const backup = await sending.getBackup(sessionIds);
151
+ const backup = await sending.getBackup();
151
152
  ```
152
153
 
153
154
  The application owns transport selection, peer confirmation, progress UI,
@@ -159,8 +160,9 @@ durably restores the backup.
159
160
 
160
161
  - Provisioning sessions expire after five minutes.
161
162
  - Ephemeral ECDH keys derive the provisioning/transfer encryption keys.
162
- - The SDK encrypts identity and backup material before it reaches a relay or
163
- transport.
163
+ - The SDK encrypts identity material before it reaches a relay or transport.
164
+ - Linked-device bundles never contain signed prekeys, one-time prekeys,
165
+ ratchet sessions, sender-key state, message state, or retry outbox state.
164
166
  - The QR channel authenticates the session only to the extent that the
165
167
  application protects what the user scans or shares.
166
168
  - The SDK encrypts device names for backend storage.
@@ -116,7 +116,7 @@ export declare class SignalProtocolClient implements ISignalProtocolClient {
116
116
  private retryUnsubscribe?;
117
117
  /**
118
118
  * Cached sender certificate for sealed sender.
119
- * Lazily fetched and refreshed when expired (24h validity, 5min margin).
119
+ * Lazily fetched and refreshed one hour before its signed expiration.
120
120
  */
121
121
  private cachedSenderCertificate;
122
122
  private cachedCertificateExpiry;
@@ -149,7 +149,8 @@ export declare class SignalProtocolClient implements ISignalProtocolClient {
149
149
  * Fetch (or return cached) sender certificate for sealed sender.
150
150
  *
151
151
  * Uses the configured certificateProvider or relay.fetchSenderCertificate().
152
- * Caches the result until expiry (24h certificate, 5min safety margin).
152
+ * Validates the fetched certificate and caches it until one hour before its
153
+ * signed expiration.
153
154
  *
154
155
  * @returns Base64-encoded serialized SenderCertificate
155
156
  * @throws if no certificate provider is available
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../client/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAOH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEjF,OAAO,KAAK,EACV,qBAAqB,EAItB,MAAM,UAAU,CAAC;AAIlB,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAChC,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAkB,aAAa,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAA+B,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,KAAK,0BAA0B,EAE/B,KAAK,8BAA8B,EAGnC,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAE/B,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAC;AAM3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAGhD,OAAO,KAAK,EACV,yBAAyB,EAEzB,WAAW,EACX,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAe,YAAY,EAAE,MAAM,SAAS,CAAC;AAMpD,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AAIvC,OAAO,EAGL,KAAK,sBAAsB,EAC5B,MAAM,UAAU,CAAC;AAClB,OAAO,EAA0C,KAAK,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAIjG,OAAO,KAAK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I,CAAC,CAEf;IAED;;OAEG;IACG,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpF;IAED;;OAEG;IACG,sBAAsB,CAC1B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,UAAU,EACnB,cAAc,EAAE,UAAU,GACzB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,QAAQ,GAAG,kBAAkB,CAAA;KAAE,CAAC,CAEtE;IAMD;;OAEG;IACH,OAAO,CAAC,cAAc;CAQvB"}
@@ -48,7 +48,7 @@ import { SignalProtocolManager } from '../internal/manager/index.js';
48
48
  import { SesameManager } from '../internal/sesame/index.js';
49
49
  import { createCompositeIdentityV1 } from '../keys/identity.js';
50
50
  import { EncryptionError, EncryptionErrorCode } from '../types/index.js';
51
- import { base64ToBytes } from '../internal/crypto/index.js';
51
+ import { base64ToBytes, bytesToBase64, constantTimeEqual } from '../internal/crypto/index.js';
52
52
  import { ProtocolAddress } from '../types/address.js';
53
53
  import { getActiveIdentityTypes, resolveSignalProtocolStrategy, } from './config.js';
54
54
  import { resolveSignalProtocolLogger } from '../logger.js';
@@ -74,6 +74,7 @@ import { StorageBackedSignalProtocolClientMedia } from './media.js';
74
74
  // Group state (Signal Private Group System)
75
75
  import { GroupManager, decodeGroupTrustRoot } from '../internal/groups/index.js';
76
76
  import { SignalProtocolGroupStateStore } from '../internal/groups/sdk-store.js';
77
+ import { deriveAccessKey } from '../internal/protocol/sealed-sender/delivery-token.js';
77
78
  export { IMPLICIT_ENVELOPE_TYPES } from './constants.js';
78
79
  /**
79
80
  * Module-level lock for storage initialization.
@@ -157,7 +158,7 @@ export class SignalProtocolClient {
157
158
  retryUnsubscribe;
158
159
  /**
159
160
  * Cached sender certificate for sealed sender.
160
- * Lazily fetched and refreshed when expired (24h validity, 5min margin).
161
+ * Lazily fetched and refreshed one hour before its signed expiration.
161
162
  */
162
163
  cachedSenderCertificate = null;
163
164
  cachedCertificateExpiry = 0;
@@ -223,20 +224,20 @@ export class SignalProtocolClient {
223
224
  const capability = this.relay?.groupServer;
224
225
  const server = config.groups.server ?? capability?.server;
225
226
  const issueCredential = config.groups.issueCredential ??
226
- (capability
227
- ? () => capability.issueAuthCredential(this._userId)
228
- : undefined);
227
+ (capability ? () => capability.issueAuthCredential(this._userId) : undefined);
229
228
  const issueProfileKeyCredential = config.groups.issueProfileKeyCredential ??
230
229
  (capability
231
- ? () => capability.issueProfileKeyCredential(this._userId, config.groups.profileKey)
230
+ ? async (request) => {
231
+ const accessKey = await deriveAccessKey(config.groups.profileKey);
232
+ await capability.setUnidentifiedAccessKey(this._userId, accessKey);
233
+ return capability.issueProfileKeyCredential(this._userId, request);
234
+ }
232
235
  : undefined);
233
236
  if (!server || !issueCredential || !issueProfileKeyCredential) {
234
237
  const missing = [
235
238
  !server ? 'server' : undefined,
236
239
  !issueCredential ? 'issueCredential' : undefined,
237
- !issueProfileKeyCredential
238
- ? 'issueProfileKeyCredential'
239
- : undefined,
240
+ !issueProfileKeyCredential ? 'issueProfileKeyCredential' : undefined,
240
241
  ].filter((value) => value !== undefined);
241
242
  throw new Error(`Groups require the relay.groupServer capability or explicit overrides; missing: ${missing.join(', ')}`);
242
243
  }
@@ -244,9 +245,7 @@ export class SignalProtocolClient {
244
245
  throw new Error('Groups require the client identity ACI; set identity.aci');
245
246
  }
246
247
  const trustRoot = decodeGroupTrustRoot(config.groups.trustRoot);
247
- this.groupStore =
248
- config.groups.store ??
249
- new SignalProtocolGroupStateStore(this._storage);
248
+ this.groupStore = config.groups.store ?? new SignalProtocolGroupStateStore(this._storage);
250
249
  const endorsementManager = config.groups.endorsementManager;
251
250
  endorsementManager?.assertEndorsementRootPublicKey(trustRoot.endorsementRootPublicKey);
252
251
  this.groupManager = new GroupManager({
@@ -332,6 +331,12 @@ export class SignalProtocolClient {
332
331
  }
333
332
  });
334
333
  }
334
+ if (config?.sealedSender) {
335
+ this.cipher.setSealedSenderDeliveryMode(config.sealedSender.deliveryMode ?? 'preferred');
336
+ if (config.sealedSender.onIdentifiedFallback) {
337
+ this.cipher.setSealedSenderIdentifiedFallback(config.sealedSender.onIdentifiedFallback);
338
+ }
339
+ }
335
340
  // Set up sealed sender provider if configured
336
341
  if (this.isSealedSenderEnabled) {
337
342
  this.cipher.setSealedSenderProvider(async () => {
@@ -466,27 +471,32 @@ export class SignalProtocolClient {
466
471
  */
467
472
  get isSealedSenderEnabled() {
468
473
  const ss = this.config.sealedSender;
469
- return !!(ss && ss.accessMode !== 'disabled' && ss.trustRoots.length > 0);
474
+ return !!(ss && ss.deliveryMode !== 'disabled' && ss.trustRoots.length > 0);
470
475
  }
471
476
  /**
472
477
  * Fetch (or return cached) sender certificate for sealed sender.
473
478
  *
474
479
  * Uses the configured certificateProvider or relay.fetchSenderCertificate().
475
- * Caches the result until expiry (24h certificate, 5min safety margin).
480
+ * Validates the fetched certificate and caches it until one hour before its
481
+ * signed expiration.
476
482
  *
477
483
  * @returns Base64-encoded serialized SenderCertificate
478
484
  * @throws if no certificate provider is available
479
485
  */
480
486
  async fetchSenderCertificate() {
481
487
  const { SEALED_SENDER_CERTIFICATE_MARGIN_MS } = await import('./config.js');
482
- // Return cached if still valid (with 5min safety margin)
483
- if (this.cachedSenderCertificate && Date.now() < this.cachedCertificateExpiry) {
488
+ const now = Date.now();
489
+ if (this.cachedSenderCertificate && now < this.cachedCertificateExpiry) {
484
490
  return this.cachedSenderCertificate;
485
491
  }
492
+ const sealedSender = this.config.sealedSender;
493
+ if (!sealedSender || sealedSender.trustRoots.length === 0) {
494
+ throw new EncryptionError('Sender certificate trust is not configured', EncryptionErrorCode.INITIALIZATION_FAILED);
495
+ }
486
496
  // Fetch from configured provider or relay
487
497
  let certBase64;
488
- if (this.config.sealedSender?.certificateProvider) {
489
- certBase64 = await this.config.sealedSender.certificateProvider();
498
+ if (sealedSender.certificateProvider) {
499
+ certBase64 = await sealedSender.certificateProvider();
490
500
  }
491
501
  else if (this.relay?.fetchSenderCertificate) {
492
502
  certBase64 = await this.relay.fetchSenderCertificate(this.deviceId);
@@ -494,11 +504,34 @@ export class SignalProtocolClient {
494
504
  else {
495
505
  throw new EncryptionError('No sender certificate provider configured. Set sealedSender.certificateProvider or use a relay that supports fetchSenderCertificate.', EncryptionErrorCode.INITIALIZATION_FAILED);
496
506
  }
497
- // Cache with margin
498
- const CERTIFICATE_VALIDITY_MS = 24 * 60 * 60 * 1000;
499
- this.cachedSenderCertificate = certBase64;
500
- this.cachedCertificateExpiry =
501
- Date.now() + CERTIFICATE_VALIDITY_MS - SEALED_SENDER_CERTIFICATE_MARGIN_MS;
507
+ const { deserializeSenderCertificate, validateSenderCertificate } = await import('../internal/protocol/sealed-sender/index.js');
508
+ let certificate;
509
+ try {
510
+ certificate = deserializeSenderCertificate(base64ToBytes(certBase64));
511
+ await validateSenderCertificate(certificate, sealedSender.trustRoots.map((root) => bytesToBase64(root)), now, {
512
+ expectedRelayScopeId: bytesToBase64(sealedSender.relayScopeId),
513
+ revokedIssuerKeyIds: sealedSender.revokedIssuerKeyIds,
514
+ });
515
+ const identity = await this._storage.getIdentityKey();
516
+ if (!identity ||
517
+ certificate.senderUuid !== this.userId ||
518
+ certificate.senderDeviceId !== this.deviceId ||
519
+ !constantTimeEqual(base64ToBytes(certificate.senderIdentityKey), base64ToBytes(identity.dhKey.publicKey))) {
520
+ throw new Error('certificate binding mismatch');
521
+ }
522
+ }
523
+ catch {
524
+ throw new EncryptionError('Fetched sender certificate failed client binding validation', EncryptionErrorCode.INVALID_CIPHERTEXT);
525
+ }
526
+ const refreshAt = certificate.expires - SEALED_SENDER_CERTIFICATE_MARGIN_MS;
527
+ if (refreshAt > now) {
528
+ this.cachedSenderCertificate = certBase64;
529
+ this.cachedCertificateExpiry = refreshAt;
530
+ }
531
+ else {
532
+ this.cachedSenderCertificate = null;
533
+ this.cachedCertificateExpiry = 0;
534
+ }
502
535
  return certBase64;
503
536
  }
504
537
  /**
@@ -1043,13 +1076,13 @@ export class SignalProtocolClient {
1043
1076
  async processIncomingEnvelope(envelope, options) {
1044
1077
  // Handle sealed sender envelopes: unseal to reveal sender before decrypting
1045
1078
  if (envelope.messageType === 'unidentified_sender' && this.config.sealedSender) {
1046
- const { unsealMessage, envelopeTypeForContent } = await import('./sealed-sender-ops.js');
1079
+ const { unsealMessage, envelopeTypeForContent } = await import('./sealed-sender.js');
1047
1080
  const identityKeyPair = await this._storage.getIdentityKey();
1048
1081
  if (!identityKeyPair) {
1049
1082
  throw new EncryptionError('No identity key pair for sealed sender decryption', EncryptionErrorCode.DECRYPTION_FAILED);
1050
1083
  }
1051
1084
  const recipientPrivateKeyBytes = base64ToBytes(identityKeyPair.dhKey.privateKey);
1052
- const unsealed = await unsealMessage(envelope.ciphertext, recipientPrivateKeyBytes, this.userId, this.deviceId, this.config.sealedSender, this.logger);
1085
+ const unsealed = await unsealMessage(envelope.ciphertext, recipientPrivateKeyBytes, this.userId, this.deviceId, this.config.sealedSender, envelope.serverTimestamp, this.logger);
1053
1086
  // Process the inner envelope with revealed sender identity. The inner
1054
1087
  // type travels inside the seal. Nothing outside it distinguishes a
1055
1088
  // group message from a pairwise one. The same mapping serves the other