@open-e2ee/signal-protocol-sdk 0.2.3 → 0.3.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 (601) hide show
  1. package/ADAPTERS.md +4 -4
  2. package/ARCHITECTURE.md +17 -16
  3. package/CHANGELOG.md +39 -0
  4. package/COMMERCIAL.md +6 -6
  5. package/NOTICE +1 -1
  6. package/README.md +44 -34
  7. package/SECURITY.md +16 -13
  8. package/TROUBLESHOOTING.md +5 -5
  9. package/blocking/README.md +6 -5
  10. package/client/README.md +5 -5
  11. package/device/README.md +8 -8
  12. package/dist/blocking/types.d.ts +2 -2
  13. package/dist/blocking/types.js +2 -2
  14. package/dist/client/client.d.ts +46 -45
  15. package/dist/client/client.d.ts.map +1 -1
  16. package/dist/client/client.js +61 -60
  17. package/dist/client/client.js.map +1 -1
  18. package/dist/client/config.d.ts +32 -32
  19. package/dist/client/constants.d.ts +7 -6
  20. package/dist/client/constants.d.ts.map +1 -1
  21. package/dist/client/constants.js +5 -4
  22. package/dist/client/constants.js.map +1 -1
  23. package/dist/client/dual-store.d.ts +2 -2
  24. package/dist/client/dual-store.js +2 -2
  25. package/dist/client/endorsement-manager.d.ts +14 -14
  26. package/dist/client/endorsement-manager.d.ts.map +1 -1
  27. package/dist/client/endorsement-manager.js +15 -15
  28. package/dist/client/endorsement-manager.js.map +1 -1
  29. package/dist/client/event-hooks.d.ts +16 -16
  30. package/dist/client/event-hooks.d.ts.map +1 -1
  31. package/dist/client/event-hooks.js +1 -1
  32. package/dist/client/event-hooks.js.map +1 -1
  33. package/dist/client/files.js +4 -4
  34. package/dist/client/files.js.map +1 -1
  35. package/dist/client/headless.d.ts +7 -7
  36. package/dist/client/headless.d.ts.map +1 -1
  37. package/dist/client/headless.js +4 -4
  38. package/dist/client/key-rotation-core.d.ts +19 -17
  39. package/dist/client/key-rotation-core.d.ts.map +1 -1
  40. package/dist/client/key-rotation-core.js +35 -31
  41. package/dist/client/key-rotation-core.js.map +1 -1
  42. package/dist/client/key-rotation.d.ts +8 -8
  43. package/dist/client/key-rotation.js +8 -8
  44. package/dist/client/media.d.ts +1 -1
  45. package/dist/client/messages.d.ts.map +1 -1
  46. package/dist/client/messages.js +13 -11
  47. package/dist/client/messages.js.map +1 -1
  48. package/dist/client/multi-device.d.ts +5 -4
  49. package/dist/client/multi-device.d.ts.map +1 -1
  50. package/dist/client/multi-device.js.map +1 -1
  51. package/dist/client/prekeys.d.ts +7 -7
  52. package/dist/client/prekeys.js +10 -10
  53. package/dist/client/prekeys.js.map +1 -1
  54. package/dist/client/relay-subscription.d.ts +3 -0
  55. package/dist/client/relay-subscription.d.ts.map +1 -1
  56. package/dist/client/relay-subscription.js +7 -4
  57. package/dist/client/relay-subscription.js.map +1 -1
  58. package/dist/client/retry-utils.d.ts +5 -6
  59. package/dist/client/retry-utils.d.ts.map +1 -1
  60. package/dist/client/retry-utils.js +5 -12
  61. package/dist/client/retry-utils.js.map +1 -1
  62. package/dist/client/retry.js +7 -7
  63. package/dist/client/retry.js.map +1 -1
  64. package/dist/client/sealed-sender-ops.d.ts +3 -3
  65. package/dist/client/sealed-sender-ops.js +5 -5
  66. package/dist/client/sealed-sender-ops.js.map +1 -1
  67. package/dist/client/sessions.d.ts +2 -2
  68. package/dist/client/sessions.js +2 -2
  69. package/dist/client/signal-service-cipher.d.ts +9 -9
  70. package/dist/client/signal-service-cipher.d.ts.map +1 -1
  71. package/dist/client/signal-service-cipher.js +41 -40
  72. package/dist/client/signal-service-cipher.js.map +1 -1
  73. package/dist/client/state.d.ts +1 -1
  74. package/dist/client/state.js +1 -1
  75. package/dist/client/types.d.ts +19 -19
  76. package/dist/client/types.d.ts.map +1 -1
  77. package/dist/device/connection.d.ts +1 -1
  78. package/dist/device/connection.js +2 -2
  79. package/dist/device/connection.js.map +1 -1
  80. package/dist/device/constants.d.ts +4 -4
  81. package/dist/device/constants.js +3 -3
  82. package/dist/device/device-id.d.ts +4 -4
  83. package/dist/device/device-id.js +4 -4
  84. package/dist/device/expo-metadata.d.ts +13 -11
  85. package/dist/device/expo-metadata.d.ts.map +1 -1
  86. package/dist/device/expo-metadata.js +13 -11
  87. package/dist/device/expo-metadata.js.map +1 -1
  88. package/dist/device/lifecycle/manager.d.ts +6 -6
  89. package/dist/device/lifecycle/manager.js +7 -7
  90. package/dist/device/lifecycle/types.d.ts +13 -13
  91. package/dist/device/lifecycle/types.d.ts.map +1 -1
  92. package/dist/device/lifecycle/utils.d.ts +2 -2
  93. package/dist/device/lifecycle/utils.js +5 -5
  94. package/dist/device/lifecycle/utils.js.map +1 -1
  95. package/dist/device/provisioning.d.ts +5 -4
  96. package/dist/device/provisioning.d.ts.map +1 -1
  97. package/dist/device/provisioning.js +5 -4
  98. package/dist/device/provisioning.js.map +1 -1
  99. package/dist/device/transfer.d.ts +2 -2
  100. package/dist/device/transfer.js +3 -3
  101. package/dist/device/transfer.js.map +1 -1
  102. package/dist/encoding/index.d.ts +3 -4
  103. package/dist/encoding/index.d.ts.map +1 -1
  104. package/dist/encoding/index.js.map +1 -1
  105. package/dist/files/index.d.ts +1 -1
  106. package/dist/files/index.js +1 -1
  107. package/dist/hooks/use-connection-presence.d.ts +1 -1
  108. package/dist/hooks/use-connection-presence.js +7 -7
  109. package/dist/hooks/use-connection-presence.js.map +1 -1
  110. package/dist/hooks/use-group-membership.d.ts +2 -2
  111. package/dist/hooks/use-group-membership.d.ts.map +1 -1
  112. package/dist/hooks/use-group-membership.js +6 -6
  113. package/dist/hooks/use-group-membership.js.map +1 -1
  114. package/dist/hooks/use-key-rotation.js +3 -3
  115. package/dist/hooks/use-key-rotation.js.map +1 -1
  116. package/dist/hooks/use-single-flight.d.ts +2 -2
  117. package/dist/hooks/use-single-flight.js +1 -1
  118. package/dist/index.d.ts +4 -3
  119. package/dist/index.d.ts.map +1 -1
  120. package/dist/index.js +22 -4
  121. package/dist/index.js.map +1 -1
  122. package/dist/internal/crypto/ec/ed25519.d.ts +6 -6
  123. package/dist/internal/crypto/ec/ed25519.js +6 -6
  124. package/dist/internal/crypto/ec/x25519-validation.d.ts.map +1 -1
  125. package/dist/internal/crypto/ec/x25519-validation.js +4 -2
  126. package/dist/internal/crypto/ec/x25519-validation.js.map +1 -1
  127. package/dist/internal/crypto/index.d.ts +2 -0
  128. package/dist/internal/crypto/index.d.ts.map +1 -1
  129. package/dist/internal/crypto/index.js +2 -0
  130. package/dist/internal/crypto/index.js.map +1 -1
  131. package/dist/internal/crypto/kdf/hkdf.d.ts +9 -8
  132. package/dist/internal/crypto/kdf/hkdf.d.ts.map +1 -1
  133. package/dist/internal/crypto/kdf/hkdf.js +11 -10
  134. package/dist/internal/crypto/kdf/hkdf.js.map +1 -1
  135. package/dist/internal/crypto/key-prefix.d.ts +3 -3
  136. package/dist/internal/crypto/key-prefix.js +3 -3
  137. package/dist/internal/crypto/pq/kyber.d.ts +7 -7
  138. package/dist/internal/crypto/pq/kyber.js +10 -10
  139. package/dist/internal/crypto/pq/kyber.js.map +1 -1
  140. package/dist/internal/crypto/random.d.ts +1 -1
  141. package/dist/internal/crypto/random.js +1 -1
  142. package/dist/internal/crypto/symmetric/aes-gcm-siv.js +1 -1
  143. package/dist/internal/crypto/symmetric/aes.js +4 -4
  144. package/dist/internal/crypto/symmetric/aes.js.map +1 -1
  145. package/dist/internal/crypto/symmetric/mac.d.ts +1 -1
  146. package/dist/internal/crypto/symmetric/mac.js +3 -3
  147. package/dist/internal/crypto/symmetric/padding.js +1 -1
  148. package/dist/internal/crypto/symmetric/padding.js.map +1 -1
  149. package/dist/internal/crypto/symmetric/streaming-aead.d.ts +7 -1
  150. package/dist/internal/crypto/symmetric/streaming-aead.d.ts.map +1 -1
  151. package/dist/internal/crypto/symmetric/streaming-aead.js +10 -4
  152. package/dist/internal/crypto/symmetric/streaming-aead.js.map +1 -1
  153. package/dist/internal/crypto/utils.d.ts +2 -2
  154. package/dist/internal/crypto/utils.d.ts.map +1 -1
  155. package/dist/internal/crypto/utils.js +16 -14
  156. package/dist/internal/crypto/utils.js.map +1 -1
  157. package/dist/internal/crypto/validation.d.ts +4 -4
  158. package/dist/internal/crypto/validation.js +2 -2
  159. package/dist/internal/encoding/proto/envelope.d.ts +1 -1
  160. package/dist/internal/encoding/proto/envelope.js +1 -1
  161. package/dist/internal/encoding/proto/index.d.ts +4 -4
  162. package/dist/internal/encoding/proto/index.js +4 -4
  163. package/dist/internal/encoding/proto/pq-ratchet-serialize.d.ts +28 -16
  164. package/dist/internal/encoding/proto/pq-ratchet-serialize.d.ts.map +1 -1
  165. package/dist/internal/encoding/proto/pq-ratchet-serialize.js +30 -18
  166. package/dist/internal/encoding/proto/pq-ratchet-serialize.js.map +1 -1
  167. package/dist/internal/encoding/proto/primitives.d.ts +45 -35
  168. package/dist/internal/encoding/proto/primitives.d.ts.map +1 -1
  169. package/dist/internal/encoding/proto/primitives.js +54 -43
  170. package/dist/internal/encoding/proto/primitives.js.map +1 -1
  171. package/dist/internal/encoding/proto/sender-key-message.d.ts +2 -2
  172. package/dist/internal/encoding/proto/sender-key-message.js +2 -2
  173. package/dist/internal/encoding/proto/signal-message.d.ts +13 -13
  174. package/dist/internal/encoding/proto/signal-message.d.ts.map +1 -1
  175. package/dist/internal/encoding/proto/signal-message.js +13 -13
  176. package/dist/internal/encoding/proto/signal-message.js.map +1 -1
  177. package/dist/internal/groups/access-control.d.ts +5 -5
  178. package/dist/internal/groups/access-control.js +6 -6
  179. package/dist/internal/groups/access-control.js.map +1 -1
  180. package/dist/internal/groups/change-actions.d.ts +4 -4
  181. package/dist/internal/groups/change-actions.js +3 -3
  182. package/dist/internal/groups/encrypted-state.js +1 -1
  183. package/dist/internal/groups/encrypted-state.js.map +1 -1
  184. package/dist/internal/groups/group-id.d.ts +1 -1
  185. package/dist/internal/groups/manager.d.ts +24 -23
  186. package/dist/internal/groups/manager.d.ts.map +1 -1
  187. package/dist/internal/groups/manager.js +40 -36
  188. package/dist/internal/groups/manager.js.map +1 -1
  189. package/dist/internal/groups/server-engine.d.ts +29 -21
  190. package/dist/internal/groups/server-engine.d.ts.map +1 -1
  191. package/dist/internal/groups/server-engine.js +55 -50
  192. package/dist/internal/groups/server-engine.js.map +1 -1
  193. package/dist/internal/groups/trust-root.d.ts +2 -2
  194. package/dist/internal/groups/trust-root.js +2 -2
  195. package/dist/internal/groups/types.d.ts +4 -4
  196. package/dist/internal/groups/types.d.ts.map +1 -1
  197. package/dist/internal/groups/wire.d.ts +6 -7
  198. package/dist/internal/groups/wire.d.ts.map +1 -1
  199. package/dist/internal/groups/wire.js +6 -7
  200. package/dist/internal/groups/wire.js.map +1 -1
  201. package/dist/internal/manager/manager.d.ts +14 -12
  202. package/dist/internal/manager/manager.d.ts.map +1 -1
  203. package/dist/internal/manager/manager.js +47 -41
  204. package/dist/internal/manager/manager.js.map +1 -1
  205. package/dist/internal/protocol/double-ratchet/chains.d.ts +8 -6
  206. package/dist/internal/protocol/double-ratchet/chains.d.ts.map +1 -1
  207. package/dist/internal/protocol/double-ratchet/chains.js +10 -8
  208. package/dist/internal/protocol/double-ratchet/chains.js.map +1 -1
  209. package/dist/internal/protocol/double-ratchet/index.d.ts +2 -2
  210. package/dist/internal/protocol/double-ratchet/index.js +2 -2
  211. package/dist/internal/protocol/double-ratchet/ratchet.d.ts +4 -4
  212. package/dist/internal/protocol/double-ratchet/ratchet.js +6 -6
  213. package/dist/internal/protocol/pqxdh/pqxdh.d.ts +21 -18
  214. package/dist/internal/protocol/pqxdh/pqxdh.d.ts.map +1 -1
  215. package/dist/internal/protocol/pqxdh/pqxdh.js +48 -42
  216. package/dist/internal/protocol/pqxdh/pqxdh.js.map +1 -1
  217. package/dist/internal/protocol/sealed-sender/decryption-v2.js +5 -5
  218. package/dist/internal/protocol/sealed-sender/decryption-v2.js.map +1 -1
  219. package/dist/internal/protocol/sealed-sender/decryption.d.ts.map +1 -1
  220. package/dist/internal/protocol/sealed-sender/decryption.js +11 -8
  221. package/dist/internal/protocol/sealed-sender/decryption.js.map +1 -1
  222. package/dist/internal/protocol/sealed-sender/delivery-token.d.ts +2 -2
  223. package/dist/internal/protocol/sealed-sender/delivery-token.js +2 -2
  224. package/dist/internal/protocol/sealed-sender/encryption-v2.js +1 -1
  225. package/dist/internal/protocol/sealed-sender/encryption-v2.js.map +1 -1
  226. package/dist/internal/protocol/sealed-sender/encryption.d.ts +2 -2
  227. package/dist/internal/protocol/sealed-sender/encryption.js +2 -2
  228. package/dist/internal/protocol/sealed-sender/proto/index.d.ts +25 -23
  229. package/dist/internal/protocol/sealed-sender/proto/index.d.ts.map +1 -1
  230. package/dist/internal/protocol/sealed-sender/proto/index.js +32 -30
  231. package/dist/internal/protocol/sealed-sender/proto/index.js.map +1 -1
  232. package/dist/internal/protocol/sealed-sender/trust-root.d.ts +10 -9
  233. package/dist/internal/protocol/sealed-sender/trust-root.d.ts.map +1 -1
  234. package/dist/internal/protocol/sealed-sender/trust-root.js +10 -9
  235. package/dist/internal/protocol/sealed-sender/trust-root.js.map +1 -1
  236. package/dist/internal/protocol/sealed-sender/types.d.ts +13 -14
  237. package/dist/internal/protocol/sealed-sender/types.d.ts.map +1 -1
  238. package/dist/internal/protocol/sealed-sender/types.js +7 -8
  239. package/dist/internal/protocol/sealed-sender/types.js.map +1 -1
  240. package/dist/internal/protocol/sealed-sender/v2-binary.d.ts +1 -1
  241. package/dist/internal/protocol/sealed-sender/v2-binary.js +2 -2
  242. package/dist/internal/protocol/sealed-sender/v2-binary.js.map +1 -1
  243. package/dist/internal/protocol/sender-keys/manager.d.ts +16 -14
  244. package/dist/internal/protocol/sender-keys/manager.d.ts.map +1 -1
  245. package/dist/internal/protocol/sender-keys/manager.js +37 -34
  246. package/dist/internal/protocol/sender-keys/manager.js.map +1 -1
  247. package/dist/internal/protocol/spqr/braid-serialize.d.ts +6 -6
  248. package/dist/internal/protocol/spqr/braid-serialize.js +5 -5
  249. package/dist/internal/protocol/spqr/braid-serialize.js.map +1 -1
  250. package/dist/internal/protocol/spqr/braid.d.ts +3 -3
  251. package/dist/internal/protocol/spqr/braid.js +7 -7
  252. package/dist/internal/protocol/spqr/braid.js.map +1 -1
  253. package/dist/internal/protocol/spqr/index.js +1 -1
  254. package/dist/internal/protocol/spqr/index.js.map +1 -1
  255. package/dist/internal/protocol/spqr/ml-kem-braid/chunk-domain.d.ts +3 -3
  256. package/dist/internal/protocol/spqr/ml-kem-braid/chunk-domain.js +3 -3
  257. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.js +1 -1
  258. package/dist/internal/protocol/spqr/ml-kem-braid/incremental-kem.js.map +1 -1
  259. package/dist/internal/protocol/spqr/ml-kem-braid/kdf.d.ts +1 -1
  260. package/dist/internal/protocol/spqr/ml-kem-braid/kdf.js +1 -1
  261. package/dist/internal/protocol/spqr/ml-kem-braid/kdf.js.map +1 -1
  262. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/arithmetic.d.ts +4 -3
  263. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/arithmetic.d.ts.map +1 -1
  264. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/arithmetic.js +4 -3
  265. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/arithmetic.js.map +1 -1
  266. package/dist/internal/protocol/spqr/ml-kem-braid/noble-pq/index.js +2 -2
  267. package/dist/internal/protocol/spqr/ml-kem-braid/progress.d.ts +1 -1
  268. package/dist/internal/protocol/spqr/ml-kem-braid/progress.js +1 -1
  269. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.d.ts +15 -7
  270. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.d.ts.map +1 -1
  271. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.js +15 -7
  272. package/dist/internal/protocol/spqr/ml-kem-braid/rs/codec.js.map +1 -1
  273. package/dist/internal/protocol/spqr/ml-kem-braid/rs/galois/field.js +1 -1
  274. package/dist/internal/protocol/spqr/ml-kem-braid/rs/polynomial.d.ts +3 -3
  275. package/dist/internal/protocol/spqr/ml-kem-braid/rs/polynomial.js +1 -1
  276. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.d.ts +7 -7
  277. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.js +11 -11
  278. package/dist/internal/protocol/spqr/ml-kem-braid/serialize.js.map +1 -1
  279. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.d.ts +1 -1
  280. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js +6 -6
  281. package/dist/internal/protocol/spqr/ml-kem-braid/state-machine.js.map +1 -1
  282. package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts +2 -2
  283. package/dist/internal/protocol/spqr/ml-kem-braid/types.d.ts.map +1 -1
  284. package/dist/internal/protocol/spqr/ml-kem-braid/types.js.map +1 -1
  285. package/dist/internal/protocol/spqr/serialize.d.ts +12 -12
  286. package/dist/internal/protocol/spqr/serialize.js +5 -5
  287. package/dist/internal/protocol/spqr/spqr.d.ts +6 -6
  288. package/dist/internal/protocol/spqr/spqr.d.ts.map +1 -1
  289. package/dist/internal/protocol/spqr/spqr.js +47 -42
  290. package/dist/internal/protocol/spqr/spqr.js.map +1 -1
  291. package/dist/internal/protocol/spqr/validate.d.ts +1 -1
  292. package/dist/internal/protocol/triple-ratchet/ratchet.d.ts +12 -12
  293. package/dist/internal/protocol/triple-ratchet/ratchet.d.ts.map +1 -1
  294. package/dist/internal/protocol/triple-ratchet/ratchet.js +11 -11
  295. package/dist/internal/protocol/triple-ratchet/ratchet.js.map +1 -1
  296. package/dist/internal/protocol/username/hash.d.ts.map +1 -1
  297. package/dist/internal/protocol/username/hash.js +6 -4
  298. package/dist/internal/protocol/username/hash.js.map +1 -1
  299. package/dist/internal/protocol/version.d.ts +3 -3
  300. package/dist/internal/protocol/version.js +1 -1
  301. package/dist/internal/protocol/x3dh/x3dh.d.ts +16 -16
  302. package/dist/internal/protocol/x3dh/x3dh.d.ts.map +1 -1
  303. package/dist/internal/protocol/x3dh/x3dh.js +15 -15
  304. package/dist/internal/protocol/x3dh/x3dh.js.map +1 -1
  305. package/dist/internal/protocol/zk/credentials/attributes.d.ts +7 -7
  306. package/dist/internal/protocol/zk/credentials/attributes.js +7 -7
  307. package/dist/internal/protocol/zk/credentials/credentials.d.ts +1 -1
  308. package/dist/internal/protocol/zk/credentials/credentials.js +1 -1
  309. package/dist/internal/protocol/zk/credentials/endorsements.d.ts +11 -11
  310. package/dist/internal/protocol/zk/credentials/endorsements.js +14 -14
  311. package/dist/internal/protocol/zk/credentials/issuance.d.ts +5 -1
  312. package/dist/internal/protocol/zk/credentials/issuance.d.ts.map +1 -1
  313. package/dist/internal/protocol/zk/credentials/issuance.js +5 -1
  314. package/dist/internal/protocol/zk/credentials/issuance.js.map +1 -1
  315. package/dist/internal/protocol/zk/credentials/presentation.d.ts +16 -16
  316. package/dist/internal/protocol/zk/credentials/presentation.d.ts.map +1 -1
  317. package/dist/internal/protocol/zk/credentials/presentation.js +18 -18
  318. package/dist/internal/protocol/zk/credentials/presentation.js.map +1 -1
  319. package/dist/internal/protocol/zk/groups/auth-credential.d.ts +22 -16
  320. package/dist/internal/protocol/zk/groups/auth-credential.d.ts.map +1 -1
  321. package/dist/internal/protocol/zk/groups/auth-credential.js +19 -14
  322. package/dist/internal/protocol/zk/groups/auth-credential.js.map +1 -1
  323. package/dist/internal/protocol/zk/groups/client-zk-group-cipher.d.ts +4 -4
  324. package/dist/internal/protocol/zk/groups/client-zk-group-cipher.js +4 -4
  325. package/dist/internal/protocol/zk/groups/group-params.d.ts +2 -2
  326. package/dist/internal/protocol/zk/groups/group-params.js +2 -2
  327. package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts +10 -9
  328. package/dist/internal/protocol/zk/groups/group-send-endorsement.d.ts.map +1 -1
  329. package/dist/internal/protocol/zk/groups/group-send-endorsement.js +9 -8
  330. package/dist/internal/protocol/zk/groups/group-send-endorsement.js.map +1 -1
  331. package/dist/internal/protocol/zk/groups/lizard.d.ts +1 -1
  332. package/dist/internal/protocol/zk/groups/lizard.js +4 -4
  333. package/dist/internal/protocol/zk/groups/lizard.js.map +1 -1
  334. package/dist/internal/protocol/zk/groups/profile-key-commitment.d.ts +3 -3
  335. package/dist/internal/protocol/zk/groups/profile-key-commitment.js +3 -3
  336. package/dist/internal/protocol/zk/groups/profile-key-credential.d.ts +11 -11
  337. package/dist/internal/protocol/zk/groups/profile-key-credential.js +7 -7
  338. package/dist/internal/protocol/zk/groups/profile-key-encryption.d.ts +2 -2
  339. package/dist/internal/protocol/zk/groups/profile-key-encryption.js +2 -2
  340. package/dist/internal/protocol/zk/groups/profile-key-struct.d.ts +2 -2
  341. package/dist/internal/protocol/zk/groups/profile-key-struct.js +2 -2
  342. package/dist/internal/protocol/zk/groups/profile-key-version.d.ts +2 -2
  343. package/dist/internal/protocol/zk/groups/profile-key-version.js +2 -2
  344. package/dist/internal/protocol/zk/groups/server-params.d.ts +1 -1
  345. package/dist/internal/protocol/zk/groups/server-params.js +1 -1
  346. package/dist/internal/protocol/zk/groups/uid-encryption.d.ts +4 -4
  347. package/dist/internal/protocol/zk/groups/uid-encryption.js +4 -4
  348. package/dist/internal/protocol/zk/groups/uid-struct.d.ts +2 -2
  349. package/dist/internal/protocol/zk/groups/uid-struct.js +3 -3
  350. package/dist/internal/protocol/zk/groups/uid-struct.js.map +1 -1
  351. package/dist/internal/protocol/zk/proofs/args.d.ts +3 -3
  352. package/dist/internal/protocol/zk/proofs/args.js +3 -3
  353. package/dist/internal/protocol/zk/proofs/sho-sha256.d.ts +3 -3
  354. package/dist/internal/protocol/zk/proofs/sho-sha256.js +3 -3
  355. package/dist/internal/protocol/zk/proofs/sho.d.ts +8 -7
  356. package/dist/internal/protocol/zk/proofs/sho.d.ts.map +1 -1
  357. package/dist/internal/protocol/zk/proofs/sho.js +8 -7
  358. package/dist/internal/protocol/zk/proofs/sho.js.map +1 -1
  359. package/dist/internal/protocol/zk/proofs/statement.d.ts +8 -6
  360. package/dist/internal/protocol/zk/proofs/statement.d.ts.map +1 -1
  361. package/dist/internal/protocol/zk/proofs/statement.js +8 -6
  362. package/dist/internal/protocol/zk/proofs/statement.js.map +1 -1
  363. package/dist/internal/sesame/manager.d.ts +23 -19
  364. package/dist/internal/sesame/manager.d.ts.map +1 -1
  365. package/dist/internal/sesame/manager.js +64 -54
  366. package/dist/internal/sesame/manager.js.map +1 -1
  367. package/dist/internal/sesame/types.d.ts +28 -25
  368. package/dist/internal/sesame/types.d.ts.map +1 -1
  369. package/dist/internal/sesame/types.js +2 -2
  370. package/dist/internal/sesame/types.js.map +1 -1
  371. package/dist/internal/sesame/validation.d.ts +2 -2
  372. package/dist/internal/sesame/validation.js +3 -3
  373. package/dist/internal/sesame/validation.js.map +1 -1
  374. package/dist/internal/session/builder.d.ts +8 -8
  375. package/dist/internal/session/builder.js +22 -22
  376. package/dist/internal/session/builder.js.map +1 -1
  377. package/dist/internal/session/cipher.d.ts +3 -3
  378. package/dist/internal/session/cipher.d.ts.map +1 -1
  379. package/dist/internal/session/cipher.js +51 -40
  380. package/dist/internal/session/cipher.js.map +1 -1
  381. package/dist/internal/session/decryption.js +11 -9
  382. package/dist/internal/session/decryption.js.map +1 -1
  383. package/dist/internal/session/factory.js +1 -1
  384. package/dist/internal/session/factory.js.map +1 -1
  385. package/dist/internal/session/handshake.d.ts +4 -4
  386. package/dist/internal/session/handshake.js +4 -4
  387. package/dist/internal/session/keys.d.ts +3 -4
  388. package/dist/internal/session/keys.d.ts.map +1 -1
  389. package/dist/internal/session/keys.js.map +1 -1
  390. package/dist/internal/session/ratchet.d.ts +8 -8
  391. package/dist/internal/session/ratchet.js +10 -10
  392. package/dist/internal/session/ratchet.js.map +1 -1
  393. package/dist/internal/session/session-resolver.d.ts +6 -6
  394. package/dist/internal/session/session-resolver.js +6 -6
  395. package/dist/internal/session/state.d.ts +12 -12
  396. package/dist/internal/session/state.d.ts.map +1 -1
  397. package/dist/internal/session/state.js +7 -7
  398. package/dist/internal/session/types.d.ts +20 -20
  399. package/dist/internal/session/types.d.ts.map +1 -1
  400. package/dist/internal/session/types.js +3 -3
  401. package/dist/internal/session/validation.d.ts +1 -1
  402. package/dist/internal/session/validation.js +4 -4
  403. package/dist/internal/session/validation.js.map +1 -1
  404. package/dist/keys/branded.d.ts +12 -12
  405. package/dist/keys/branded.js +3 -3
  406. package/dist/keys/generation.d.ts +4 -4
  407. package/dist/keys/generation.js +4 -4
  408. package/dist/keys/identity.d.ts +7 -7
  409. package/dist/keys/identity.d.ts.map +1 -1
  410. package/dist/keys/identity.js +7 -7
  411. package/dist/keys/identity.js.map +1 -1
  412. package/dist/keys/types.d.ts +16 -16
  413. package/dist/keys/types.d.ts.map +1 -1
  414. package/dist/layers.d.ts +1 -1
  415. package/dist/layers.js +1 -1
  416. package/dist/local/store/expo/adapter.d.ts +8 -8
  417. package/dist/local/store/expo/adapter.js +10 -10
  418. package/dist/local/store/expo/adapter.js.map +1 -1
  419. package/dist/local/store/expo/database-key.d.ts +7 -7
  420. package/dist/local/store/expo/database-key.js +7 -7
  421. package/dist/local/store/expo/key-storage.d.ts +1 -1
  422. package/dist/local/store/expo/key-storage.js +4 -4
  423. package/dist/local/store/expo/key-storage.js.map +1 -1
  424. package/dist/local/store/expo/models/kyber-prekey-used.d.ts +6 -6
  425. package/dist/local/store/expo/models/kyber-prekey-used.js +3 -3
  426. package/dist/local/store/expo/models/kyber-prekey.d.ts +1 -1
  427. package/dist/local/store/expo/models/kyber-prekey.js +1 -1
  428. package/dist/local/store/expo/models/message-record.d.ts +2 -2
  429. package/dist/local/store/expo/models/message-record.d.ts.map +1 -1
  430. package/dist/local/store/expo/models/message-record.js +1 -1
  431. package/dist/local/store/expo/models/message-record.js.map +1 -1
  432. package/dist/local/store/expo/models/sender-key.d.ts +11 -10
  433. package/dist/local/store/expo/models/sender-key.d.ts.map +1 -1
  434. package/dist/local/store/expo/models/sender-key.js +11 -10
  435. package/dist/local/store/expo/models/sender-key.js.map +1 -1
  436. package/dist/local/store/expo/schema.d.ts +2 -2
  437. package/dist/local/store/expo/schema.js +2 -2
  438. package/dist/local/store/expo/secure-store-options.d.ts +1 -1
  439. package/dist/local/store/memory/adapter.d.ts +2 -2
  440. package/dist/local/store/memory/adapter.js +12 -12
  441. package/dist/local/store/memory/adapter.js.map +1 -1
  442. package/dist/local/store/node/adapter.d.ts.map +1 -1
  443. package/dist/local/store/node/adapter.js +5 -4
  444. package/dist/local/store/node/adapter.js.map +1 -1
  445. package/dist/local/store/node/database-key.d.ts +8 -8
  446. package/dist/local/store/node/database-key.js +10 -10
  447. package/dist/local/store/node/database-key.js.map +1 -1
  448. package/dist/local/store/node/database.d.ts +5 -5
  449. package/dist/local/store/node/database.js +11 -11
  450. package/dist/local/store/node/database.js.map +1 -1
  451. package/dist/local/store/react-native/adapter.d.ts +6 -6
  452. package/dist/local/store/react-native/adapter.d.ts.map +1 -1
  453. package/dist/local/store/react-native/adapter.js +35 -32
  454. package/dist/local/store/react-native/adapter.js.map +1 -1
  455. package/dist/local/store/react-native/backend-conformance.d.ts +11 -10
  456. package/dist/local/store/react-native/backend-conformance.d.ts.map +1 -1
  457. package/dist/local/store/react-native/backend-conformance.js +13 -12
  458. package/dist/local/store/react-native/backend-conformance.js.map +1 -1
  459. package/dist/local/store/react-native/index.d.ts +1 -1
  460. package/dist/local/store/react-native/reference-backend.d.ts +14 -13
  461. package/dist/local/store/react-native/reference-backend.d.ts.map +1 -1
  462. package/dist/local/store/react-native/reference-backend.js +15 -14
  463. package/dist/local/store/react-native/reference-backend.js.map +1 -1
  464. package/dist/local/store/react-native/storage.d.ts +3 -3
  465. package/dist/local/store/web/adapter.d.ts +3 -3
  466. package/dist/local/store/web/adapter.d.ts.map +1 -1
  467. package/dist/local/store/web/adapter.js +30 -31
  468. package/dist/local/store/web/adapter.js.map +1 -1
  469. package/dist/local/store/web/index.d.ts +1 -1
  470. package/dist/local/vault/index.d.ts +2 -2
  471. package/dist/media/index.d.ts +11 -11
  472. package/dist/media/index.js +9 -9
  473. package/dist/profile/contact-state.d.ts +1 -1
  474. package/dist/profile/contact-state.js +1 -1
  475. package/dist/profile/profile-key.d.ts +2 -2
  476. package/dist/profile/profile-key.js +7 -6
  477. package/dist/profile/profile-key.js.map +1 -1
  478. package/dist/remote/object-store/index.d.ts +1 -1
  479. package/dist/remote/object-store/s3/storage.d.ts +1 -1
  480. package/dist/remote/object-store/types.d.ts +4 -4
  481. package/dist/remote/object-store/types.d.ts.map +1 -1
  482. package/dist/remote/relay/convex/backend.d.ts +4 -4
  483. package/dist/remote/relay/convex/backend.js +3 -3
  484. package/dist/remote/relay/convex/backend.js.map +1 -1
  485. package/dist/remote/relay/convex/component/accounts.d.ts +15 -13
  486. package/dist/remote/relay/convex/component/accounts.d.ts.map +1 -1
  487. package/dist/remote/relay/convex/component/accounts.js +31 -28
  488. package/dist/remote/relay/convex/component/accounts.js.map +1 -1
  489. package/dist/remote/relay/convex/component/certificates.js +1 -1
  490. package/dist/remote/relay/convex/component/cleanup.js +7 -7
  491. package/dist/remote/relay/convex/component/cleanup.js.map +1 -1
  492. package/dist/remote/relay/convex/component/convex.config.d.ts.map +1 -1
  493. package/dist/remote/relay/convex/component/convex.config.js +10 -8
  494. package/dist/remote/relay/convex/component/convex.config.js.map +1 -1
  495. package/dist/remote/relay/convex/component/devices.d.ts +21 -20
  496. package/dist/remote/relay/convex/component/devices.d.ts.map +1 -1
  497. package/dist/remote/relay/convex/component/devices.js +24 -23
  498. package/dist/remote/relay/convex/component/devices.js.map +1 -1
  499. package/dist/remote/relay/convex/component/groups.js +6 -6
  500. package/dist/remote/relay/convex/component/groups.js.map +1 -1
  501. package/dist/remote/relay/convex/component/messages.d.ts.map +1 -1
  502. package/dist/remote/relay/convex/component/messages.js +89 -82
  503. package/dist/remote/relay/convex/component/messages.js.map +1 -1
  504. package/dist/remote/relay/convex/component/provisioning.d.ts +3 -3
  505. package/dist/remote/relay/convex/component/provisioning.d.ts.map +1 -1
  506. package/dist/remote/relay/convex/component/provisioning.js +17 -16
  507. package/dist/remote/relay/convex/component/provisioning.js.map +1 -1
  508. package/dist/remote/relay/convex/component/runtime.d.ts.map +1 -1
  509. package/dist/remote/relay/convex/component/runtime.js +4 -2
  510. package/dist/remote/relay/convex/component/runtime.js.map +1 -1
  511. package/dist/remote/relay/convex/component/schema.js +25 -24
  512. package/dist/remote/relay/convex/component/schema.js.map +1 -1
  513. package/dist/remote/relay/convex/group-server.d.ts +3 -3
  514. package/dist/remote/relay/convex/group-server.js +3 -3
  515. package/dist/remote/relay/convex/relay.d.ts +3 -3
  516. package/dist/remote/relay/convex/relay.d.ts.map +1 -1
  517. package/dist/remote/relay/convex/relay.js +18 -17
  518. package/dist/remote/relay/convex/relay.js.map +1 -1
  519. package/dist/remote/relay/convex/types.d.ts +7 -7
  520. package/dist/remote/relay/convex/types.js +4 -4
  521. package/dist/remote/relay/memory/adapter.js +9 -9
  522. package/dist/remote/relay/memory/adapter.js.map +1 -1
  523. package/dist/remote/relay/types.d.ts +27 -27
  524. package/dist/remote/relay/types.d.ts.map +1 -1
  525. package/dist/safety/fingerprint.d.ts +7 -6
  526. package/dist/safety/fingerprint.d.ts.map +1 -1
  527. package/dist/safety/fingerprint.js +5 -4
  528. package/dist/safety/fingerprint.js.map +1 -1
  529. package/dist/safety/index.d.ts +6 -5
  530. package/dist/safety/index.d.ts.map +1 -1
  531. package/dist/safety/index.js +7 -6
  532. package/dist/safety/index.js.map +1 -1
  533. package/dist/safety/protobuf.js +2 -2
  534. package/dist/safety/protobuf.js.map +1 -1
  535. package/dist/safety/url.d.ts +5 -5
  536. package/dist/safety/url.js +6 -6
  537. package/dist/types/address.d.ts +2 -2
  538. package/dist/types/address.js +2 -2
  539. package/dist/types/api.d.ts +78 -73
  540. package/dist/types/api.d.ts.map +1 -1
  541. package/dist/types/errors.d.ts +63 -403
  542. package/dist/types/errors.d.ts.map +1 -1
  543. package/dist/types/errors.js +62 -537
  544. package/dist/types/errors.js.map +1 -1
  545. package/dist/types/messages.d.ts +16 -16
  546. package/dist/types/messages.d.ts.map +1 -1
  547. package/dist/types/messages.js +7 -7
  548. package/dist/types/messages.js.map +1 -1
  549. package/dist/types/protocol-config.d.ts +52 -49
  550. package/dist/types/protocol-config.d.ts.map +1 -1
  551. package/dist/types/protocol-config.js +36 -34
  552. package/dist/types/protocol-config.js.map +1 -1
  553. package/dist/types/protocol-constants.d.ts +2 -2
  554. package/dist/types/protocol-constants.js +2 -2
  555. package/dist/types/session.d.ts +62 -61
  556. package/dist/types/session.d.ts.map +1 -1
  557. package/dist/types/session.js +13 -14
  558. package/dist/types/session.js.map +1 -1
  559. package/dist/types/trust.d.ts +8 -8
  560. package/dist/types/trust.js +3 -3
  561. package/dist/utils/retry.d.ts.map +1 -1
  562. package/dist/utils/retry.js +2 -4
  563. package/dist/utils/retry.js.map +1 -1
  564. package/docs/ASSURANCE.md +82 -74
  565. package/docs/CLIENT_COMPOSITION.md +19 -15
  566. package/docs/DEVIATIONS.md +507 -425
  567. package/docs/DOCUMENTATION_STANDARDS.md +24 -24
  568. package/docs/E2EE.md +45 -42
  569. package/docs/ERROR_HANDLING.md +29 -105
  570. package/docs/GETTING_STARTED.md +24 -25
  571. package/docs/INTERFACES.md +27 -18
  572. package/docs/PACKAGE_SURFACE.md +23 -21
  573. package/docs/PROTOCOL_POLICY.md +19 -13
  574. package/docs/RECIPES.md +4 -4
  575. package/docs/SECURITY.md +72 -60
  576. package/encoding/README.md +2 -2
  577. package/files/README.md +1 -1
  578. package/groups/README.md +4 -3
  579. package/hooks/README.md +2 -2
  580. package/keys/README.md +15 -14
  581. package/local/store/README.md +82 -67
  582. package/local/store/expo/README.md +17 -12
  583. package/local/store/memory/README.md +4 -3
  584. package/local/store/node/README.md +8 -6
  585. package/local/store/react-native/README.md +14 -12
  586. package/local/store/web/README.md +31 -26
  587. package/local/vault/README.md +4 -4
  588. package/media/README.md +6 -5
  589. package/package.json +1 -1
  590. package/profile/README.md +7 -7
  591. package/remote/README.md +20 -18
  592. package/remote/object-store/README.md +8 -4
  593. package/remote/object-store/convex-r2/README.md +3 -3
  594. package/remote/object-store/s3/README.md +10 -5
  595. package/remote/relay/convex/README.md +5 -5
  596. package/remote/relay/convex/component/README.md +145 -124
  597. package/remote/relay/memory/README.md +6 -5
  598. package/safety/README.md +1 -1
  599. package/sealed-sender/README.md +3 -2
  600. package/types/README.md +1 -1
  601. package/utils/README.md +4 -4
@@ -69,10 +69,10 @@ export const {
69
69
 
70
70
  The callbacks must authenticate and authorize each operation and persist the
71
71
  `requestId -> objectId -> providerKey` mapping. The helper derives expiry from
72
- the actual signed operation, synchronizes provider metadata in an action, and
73
- checks the reserved content type and byte length before completion.
72
+ the actual signed operation and synchronizes provider metadata in an action. It
73
+ also checks the reserved content type and byte length before completion.
74
74
 
75
- Deletion is asynchronous at the provider boundary: the public mutation
75
+ Deletion is asynchronous at the provider boundary. The public mutation
76
76
  atomically records the application removal and asks the R2 component to schedule
77
77
  its retried deletion action. Applications that need confirmed physical removal
78
78
  must track that completion separately.
@@ -24,11 +24,16 @@ const remoteObjectStore = s3ObjectStore({
24
24
  });
25
25
  ```
26
26
 
27
- The broker must authenticate the caller, make upload reservation idempotent,
28
- generate opaque object identifiers and private provider keys, restrict signed
29
- operations to the reserved key and expected method, and enforce content length
30
- and content type. Bucket names, credentials, and unrestricted SDK clients must
31
- not cross into the application client.
27
+ The broker must:
28
+
29
+ - authenticate the caller
30
+ - make upload reservation idempotent
31
+ - generate opaque object identifiers and private provider keys
32
+ - restrict signed operations to the reserved key and expected method
33
+ - enforce content length and content type
34
+
35
+ Bucket names, credentials, and unrestricted SDK clients must not cross into the
36
+ application client.
32
37
 
33
38
  See the [object-store guide](../README.md) and
34
39
  [media guide](../../../media/README.md).
@@ -6,8 +6,9 @@ to `ISignalProtocolRelayServer`.
6
6
  ## Why it exists
7
7
 
8
8
  Convex generated references retain precise query and mutation types but do not
9
- implement the SDK relay contract directly. The adapter performs that client-side
10
- mapping while leaving backend registration and policy in the application.
9
+ implement the SDK relay contract directly. The adapter maps those references
10
+ onto the contract on the client, and leaves backend registration and policy in
11
+ the application.
11
12
 
12
13
  ## Ownership boundary
13
14
 
@@ -48,9 +49,8 @@ without widening the generated references.
48
49
 
49
50
  To serve groups from this deployment, also mount the
50
51
  [Convex Signal Protocol component](./component/README.md) inside the same namespace
51
- (`convex/signal/groups.ts` and `convex/signal/zkAuth.ts`); the relay
52
- advertises its `groupServer` capability only when both modules are
53
- configured.
52
+ (`convex/signal/groups.ts` and `convex/signal/zkAuth.ts`). The relay
53
+ advertises its `groupServer` capability only when you configure both modules.
54
54
 
55
55
  Public-key reads may be available to authenticated peers, but every write must
56
56
  derive ownership from server-side authentication rather than trusting a
@@ -1,11 +1,16 @@
1
1
  # Convex Signal Protocol component
2
2
 
3
- This installable Convex component owns the complete relay backend: account and
4
- device registration, identity and prekey storage, message queues, sealed-sender
5
- delivery, retry requests, provisioning, sender certificates, canonical
6
- encrypted group state, anonymous group authorization, credential issuance, and
7
- group-send endorsements. The app owns only its
8
- authentication-to-protocol-identity mapping and thin public wrappers.
3
+ This installable Convex component owns the complete relay backend:
4
+
5
+ - account and device registration
6
+ - identity and prekey storage
7
+ - message queues, sealed-sender delivery, and retry requests
8
+ - provisioning and sender certificates
9
+ - canonical encrypted group state and anonymous group authorization
10
+ - credential issuance and group-send endorsements
11
+
12
+ The app owns only its authentication-to-protocol-identity mapping and thin
13
+ public wrappers.
9
14
 
10
15
  ## Install the component
11
16
 
@@ -26,11 +31,11 @@ app.use(signalProtocol, {
26
31
  export default app;
27
32
  ```
28
33
 
29
- The `env` forwarding is load-bearing: Convex components are isolated from the
30
- app's environment variables, so without it the component cannot see the
31
- deployment's `OE_GROUPS_SERVER_SECRET` and every group, credential-issuance,
32
- and sender-certificate call fails at runtime. The messaging, device, key, and
33
- provisioning namespaces work without the secret.
34
+ The `env` forwarding is load-bearing. Convex isolates each component from the
35
+ app's environment variables. Without the forwarding, the component cannot see
36
+ the deployment's `OE_GROUPS_SERVER_SECRET`, and every group,
37
+ credential-issuance, and sender-certificate call fails at runtime. The
38
+ messaging, device, key, and provisioning namespaces work without the secret.
34
39
 
35
40
  The component owns these isolated tables. They do not appear in the app schema
36
41
  and need no package-specific prefixes:
@@ -49,14 +54,13 @@ and need no package-specific prefixes:
49
54
  - `groups`, `groupChanges`, and `groupSnapshots`: canonical encrypted group
50
55
  state, immutable signed changes, and per-version signed snapshots.
51
56
 
52
- The component derives **no** membership map from group state. Group reads and
53
- writes are authorized entirely by zero-knowledge presentations, so `groups`,
54
- `groupChanges`, and `groupSnapshots` never name an account, and there is no
55
- `getGroupMembers` endpoint anywhere in the relay surface. Membership is
56
- local-first: each client resolves fan-out recipients from its own decrypted
57
- group state and passes their user IDs with the send
58
- (`SendOptions.groupMemberUserIds`); the relay expands users to devices via
59
- `getActiveDevices`.
57
+ The component derives **no** membership map from group state. Zero-knowledge
58
+ presentations authorize every group read and write. Therefore `groups`,
59
+ `groupChanges`, and `groupSnapshots` never name an account, and the relay
60
+ surface has no `getGroupMembers` endpoint. Membership is local-first. Each
61
+ client resolves fan-out recipients from its own decrypted group state and
62
+ passes their user IDs with the send (`SendOptions.groupMemberUserIds`). The
63
+ relay expands users to devices through `getActiveDevices`.
60
64
 
61
65
  See [Group metadata privacy](#group-metadata-privacy) for what the relay can
62
66
  still infer from delivery traffic. The absence of a membership endpoint is not
@@ -65,15 +69,19 @@ by itself a metadata-privacy guarantee.
65
69
  The mounted `@convex-dev/rate-limiter` child component separately owns its
66
70
  isolated `rateLimits` table.
67
71
 
68
- The tables store the latest canonical encrypted state, the exact accepted and
69
- signed action bytes, and every historical encrypted snapshot with its cached
70
- S14 baseline signature. They never store the group master key, group secret
71
- parameters, plaintext group attributes, or the server secret.
72
+ The tables store:
73
+
74
+ - the latest canonical encrypted state
75
+ - the exact accepted and signed action bytes
76
+ - every historical encrypted snapshot with its cached S14 baseline signature
77
+
78
+ They never store the group master key, group secret parameters, plaintext group
79
+ attributes, or the server secret.
72
80
 
73
81
  Storage grows with one full encrypted snapshot per accepted version and is
74
82
  never pruned. Old snapshots are load-bearing: `getGroupChanges` serves signed
75
83
  history from them, so deleting rows breaks catch-up for clients behind that
76
- version. A snapshot-compaction protocol is future work; budget storage as
84
+ version. A snapshot-compaction protocol is future work. Budget storage as
77
85
  O(versions × state size) per group.
78
86
 
79
87
  ## Mount the public wrappers
@@ -198,13 +206,15 @@ export const {
198
206
  } = signalRelay.provisioning;
199
207
  ```
200
208
 
201
- `messages` owns identified and sealed delivery, multi-recipient fan-out, retry
202
- queues, and message/device lookup reads. `devices` owns registration, removal,
203
- connection state, and presence. `keys` owns identity provisioning and
204
- compare-and-swap rotation, prekey upload, atomic one-time-key consumption, and
205
- key metadata. `certificates` issues sender certificates for registered
206
- account/device identities. `provisioning` owns the linked-device session state
207
- machine through acknowledgment or rollback.
209
+ - `messages` owns identified and sealed delivery, multi-recipient fan-out,
210
+ retry queues, and message/device lookup reads.
211
+ - `devices` owns registration, removal, connection state, and presence.
212
+ - `keys` owns identity provisioning and compare-and-swap rotation, prekey
213
+ upload, atomic one-time-key consumption, and key metadata.
214
+ - `certificates` issues sender certificates for registered account/device
215
+ identities.
216
+ - `provisioning` owns the linked-device session state machine through
217
+ acknowledgment or rollback.
208
218
 
209
219
  The account-scoped wrappers resolve the caller identity on the server and
210
220
  inject the application `userId`, raw ACI, and optional PNI bytes into the
@@ -216,28 +226,28 @@ the supplied zero-knowledge presentation.
216
226
  `sendUnidentified` and `sendMultiRecipientUnidentified` are the deliberate
217
227
  exception: those sealed-sender paths do **not** call `identify`. They authorize
218
228
  the bearer request with the target's unidentified-access key or verified group
219
- send material, preserving delivery without an authenticated application
220
- session. Rejections are structured `ConvexError` data, and the relay adapter
221
- decides whether to fall back to identified delivery by reading
222
- `data.code === 'UNAUTHORIZED'` — not by matching on the message text. A
223
- deployment that wraps or re-throws component rejections must preserve `code`,
224
- or a sealed send that should have retried on the identified path will surface
225
- as a hard failure instead.
226
-
227
- A recipient's unidentified-access key is registered as a side effect of the
228
- zero-knowledge profile-key credential flow
229
- (`issueProfileKeyCredentialMutation`). Until a recipient has completed that
230
- flow, access-key-authorized sealed sends to them are rejected and the client
231
- falls back to identified delivery — messages still arrive, but without sender
229
+ send material, which keeps delivery available without an authenticated
230
+ application session. Rejections carry structured `ConvexError` data. The relay
231
+ adapter reads `data.code === 'UNAUTHORIZED'` to decide the fallback to
232
+ identified delivery, and never matches on the message text. A deployment that
233
+ wraps or re-throws component rejections must preserve `code`. If it drops
234
+ `code`, a sealed send that must retry on the identified path surfaces as a hard
235
+ failure instead.
236
+
237
+ The zero-knowledge profile-key credential flow
238
+ (`issueProfileKeyCredentialMutation`) registers a recipient's
239
+ unidentified-access key as a side effect. Until a recipient completes that flow,
240
+ the component rejects access-key-authorized sealed sends to them, and the client
241
+ falls back to identified delivery. Messages still arrive, but without sender
232
242
  anonymity. Deployments that want sealed sender for 1:1 messaging must drive
233
243
  the profile-key credential flow during account setup, not lazily.
234
244
 
235
245
  `identify` must return the authenticated account's real ACI, and its real PNI
236
246
  or **no PNI at all**, plus the application-owned `userId` used for relay
237
247
  routing. Never substitute a shared placeholder value for accounts without a
238
- PNI: credentials are matched by ACI-or-PNI alias, so a constant PNI issued to
239
- every account would let any authenticated user act on any PNI-addressed pending
240
- membership. An absent PNI must be absent.
248
+ PNI. The credential layer matches by ACI-or-PNI alias. A constant PNI issued to
249
+ every account would therefore let any authenticated user act on any
250
+ PNI-addressed pending membership. An absent PNI must be absent.
241
251
 
242
252
  ## Retention and rate limiting
243
253
 
@@ -247,11 +257,11 @@ minute, and stale KEM prekeys daily. Cleanup mutations delete bounded batches
247
257
  and schedule immediate continuations until the indexed range is empty.
248
258
 
249
259
  Completing a provisioning session grants the acknowledgment its own full
250
- session TTL. A link that is never acknowledged within that window is rolled
251
- back by the cron: the device it created is deleted together with all of its
252
- key material, queued messages, and heartbeats. Teardown matches the device's
253
- `linkedAt` stamp recorded at completion, so a device legitimately
254
- re-registered into a freed slot is never reaped by a stale session.
260
+ session TTL. The cron rolls back a link that nobody acknowledges within that
261
+ window. It deletes the device the link created, together with all of its key
262
+ material, queued messages, and heartbeats. Teardown matches the device's
263
+ `linkedAt` stamp recorded at completion. A stale session therefore never reaps
264
+ a device that a legitimate re-registration put into the freed slot.
255
265
 
256
266
  Prekey-bundle fetches use the mounted `@convex-dev/rate-limiter` child
257
267
  component. Each authenticated fetcher/target-account pair receives ten fetches
@@ -264,35 +274,35 @@ This version drops two shapes from the `messages` table: the optional
264
274
  `groupId` field, and `plaintext_content` from the `messageType` union.
265
275
 
266
276
  Convex validates every existing document against the new schema **during the
267
- push**, before any of your code runs. A stored row carrying a `groupId`, or
268
- one whose `messageType` is `plaintext_content`, therefore fails the deploy —
269
- and no migration mutation can fix it, because the deploy that would ship the
270
- mutation is the deploy that fails. The order has to be: clear first, deploy
271
- second.
277
+ push**, before any of your code runs. A stored row carrying a `groupId`, or one
278
+ whose `messageType` is `plaintext_content`, therefore fails the deploy. No
279
+ migration mutation can fix it, because the deploy that would ship the mutation
280
+ is the deploy that fails. The order has to be: clear first, deploy second.
272
281
 
273
282
  Messages are transient by design. The table has a seven-day TTL and an hourly
274
- cleanup cron, and undelivered messages are re-requested by clients through the
275
- retry path, so clearing it is a normal operation rather than data loss.
283
+ cleanup cron. Clients re-request undelivered messages through the retry path,
284
+ so clearing the table is a normal operation rather than data loss.
276
285
 
277
- Check whether the deployment has anything to clear — still on the previous
278
- version, since the table lives inside the component rather than the app:
286
+ Check whether the deployment has anything to clear. Run the check while the
287
+ deployment is still on the previous version, because the table lives inside the
288
+ component rather than the app:
279
289
 
280
290
  ```sh
281
291
  npx convex data messages --component signalProtocol
282
292
  ```
283
293
 
284
294
  Add `--prod` or `--deployment <name-or-reference>` to target a deployment other
285
- than your dev one. A deployment that has never relayed a group message and
286
- never had a caller pass `plaintext_content` has no affected rows and needs no
287
- action — no send path in this SDK ever produced the latter.
295
+ than your dev one. A deployment that never relayed a group message, and never
296
+ had a caller pass `plaintext_content`, has no affected rows and needs no
297
+ action. No send path in this SDK ever produced the latter.
288
298
 
289
299
  If there are rows, either wait or clear:
290
300
 
291
- - **Wait.** Stop sending, and the hourly cleanup cron drains the table as the
301
+ - **Wait**. Stop sending, and the hourly cleanup cron drains the table as the
292
302
  seven-day retention window expires. No manual step, but it takes a week.
293
- - **Clear.** In the Convex dashboard, select the `signalProtocol` component,
294
- open the `messages` table, and clear it. Undelivered messages are lost;
295
- clients re-request them over the retry path.
303
+ - **Clear**. In the Convex dashboard, select the `signalProtocol` component,
304
+ open the `messages` table, and clear it. Undelivered messages are lost.
305
+ Clients re-request them over the retry path.
296
306
 
297
307
  Deploy once the table is empty.
298
308
 
@@ -305,11 +315,16 @@ npx oe-groups trust-root
305
315
  ```
306
316
 
307
317
  Add `--prod` for the default production deployment or
308
- `--deployment <name-or-reference>` for another deployment. The command checks
309
- `OE_GROUPS_SERVER_SECRET`, generates a cryptographically random 32-byte seed
310
- only when it is absent, writes it to the selected Convex deployment through
311
- stdin, and prints two labelled base64 roots — the serialized group trust root
312
- and the Ed25519 sender-certificate root. Pin both in the client build; see
318
+ `--deployment <name-or-reference>` for another deployment. The command:
319
+
320
+ - checks `OE_GROUPS_SERVER_SECRET`
321
+ - generates a cryptographically random 32-byte seed only when the secret is
322
+ absent
323
+ - writes the seed to the selected Convex deployment through stdin
324
+ - prints two labelled base64 roots: the serialized group trust root and the
325
+ Ed25519 sender-certificate root
326
+
327
+ Pin both in the client build. See
313
328
  [Sender certificate trust root](#sender-certificate-trust-root) for where each
314
329
  one goes. Never fetch and trust either at runtime.
315
330
 
@@ -333,53 +348,56 @@ group trust root: <base64>
333
348
  sealed sender trust root: <base64>
334
349
  ```
335
350
 
336
- They are pinned in different places and are not interchangeable — the group
351
+ The two roots go in different places and are not interchangeable. The group
337
352
  trust root goes into the group configuration, and the sealed-sender root into
338
- `sealedSender.trustRoots` in the client build. Pin both at build time; never
339
- fetch either from a relay at runtime, since a relay that chooses the root it is
340
- validated against can mint certificates for any sender.
353
+ `sealedSender.trustRoots` in the client build. Pin both at build time. Never
354
+ fetch either from a relay at runtime, because a relay that chooses its own
355
+ validation root can mint certificates for any sender.
341
356
 
342
- Both are derived from the same deployment secret, so rotating
357
+ The component derives both from the same deployment secret, so rotating
343
358
  `OE_GROUPS_SERVER_SECRET` rotates both and strands clients pinned to either
344
359
  previous value.
345
360
 
346
- With `trustRoots` left empty, inbound sealed-sender validation stays disabled
347
- and sends fall back to identified delivery — messages still arrive, but the
348
- sender is disclosed to the relay.
361
+ With `trustRoots` left empty, inbound sealed-sender validation stays disabled,
362
+ and sends fall back to identified delivery. Messages still arrive, but they
363
+ disclose the sender to the relay.
349
364
 
350
365
  ## Group metadata privacy
351
366
 
352
- The relay cannot read message contents, cannot derive membership from group
353
- state, and no longer sees a group identifier on the two channels that used to
354
- carry one.
367
+ The relay cannot read message contents and cannot derive membership from group
368
+ state. It also no longer sees a group identifier on the two channels that used
369
+ to carry one.
355
370
 
356
- **Closed: the distribution identifier in the frame.** The identified send path
371
+ **Closed: the distribution identifier in the frame**. The identified send path
357
372
  stores the framed `SenderKeyMessage` as its `ciphertext`, and that frame's
358
373
  `distributionUuid` is **not** encrypted. It used to embed
359
- `groupId:senderUserId:senderDeviceId:timestamp`, so the group and the sender's
360
- device were readable straight out of the ciphertext column — and, worse than a
361
- column, off every message in flight to any relay on the path. Sealed sender did
362
- not help: it hides the frame from the relay but not from the rest of the path,
363
- and it is disabled until the trust root is exported (see above), so group
364
- traffic takes the identified path anyway. Distribution identifiers are now
365
- opaque random UUIDs carrying no group, sender, device, or clock, as the
366
- reference implementation uses, as the sender-keys specification now requires.
367
-
368
- **Closed: the `groupId` column.** Every `messages` row used to store a plaintext
374
+ `groupId:senderUserId:senderDeviceId:timestamp`. The group and the sender's
375
+ device were therefore readable straight out of the ciphertext column. Worse
376
+ than a column, they were readable off every message in flight to any relay on
377
+ the path.
378
+
379
+ Sealed sender did not help. It hides the frame from the relay, but not from the
380
+ rest of the path. The component also keeps sealed sender disabled until you
381
+ export the trust root (see above), so group traffic takes the identified path
382
+ anyway. Distribution identifiers are now opaque random UUIDs carrying no group,
383
+ sender, device, or clock, as the reference implementation uses, as the
384
+ sender-keys specification now requires.
385
+
386
+ **Closed: the `groupId` column**. Every `messages` row used to store a plaintext
369
387
  `groupId` next to `targetUserId` for the seven-day retention window. The column
370
- is gone. What replaces it is a `sender_key` message type, which tells the
371
- receiver to decrypt the payload as a framed `SenderKeyMessage` and nothing more:
372
- the receiver reads the opaque distribution identifier out of the frame and
373
- resolves the group against its own sender key store. No group identifier
388
+ is gone, and a `sender_key` message type replaces it. The type tells the
389
+ receiver to decrypt the payload as a framed `SenderKeyMessage` and nothing
390
+ more. The receiver reads the opaque distribution identifier out of the frame
391
+ and resolves the group against its own sender key store. No group identifier
374
392
  travels on an envelope, sealed or not.
375
393
 
376
- **Open: the group partition itself.** Removing the identifier removed the
394
+ **Open: the group partition itself**. Removing the identifier removed the
377
395
  group's *name*, not the ability to group rows. Be precise about what is left,
378
396
  because the difference matters and it is easy to overstate:
379
397
 
380
- - The frame's `distributionUuid` is unencrypted and is stored verbatim inside
381
- `messages.ciphertext` — the paragraph above says as much. It is opaque, but
382
- it is stable for the life of a sender key, and nothing rotates keys on a
398
+ - The frame leaves `distributionUuid` unencrypted, and the row stores it
399
+ verbatim inside `messages.ciphertext`. The paragraph above says as much. It
400
+ is opaque, but stable for the life of a sender key. Nothing rotates keys on a
383
401
  timer. Grouping rows by it recovers the recipient set for a sender's group
384
402
  traffic.
385
403
  - Sender keys encrypt once and fan out, so every recipient row of one send
@@ -388,17 +406,18 @@ because the difference matters and it is easy to overstate:
388
406
  - The fan-out stamps one `timestamp` across every recipient row, and passes
389
407
  through one `clientMessageId` when the application supplies one.
390
408
  - `sendMultiRecipientUnidentified` hands the relay the roster explicitly, in
391
- one call — the sealed-sender path names the recipient set outright.
409
+ one call. The sealed-sender path names the recipient set outright.
392
410
 
393
411
  So the relay cannot learn *which* group, or its name, membership list, or
394
- attributes — but it can still partition delivery pairs into unlabeled groups,
395
- and any one of those channels suffices. That is a real improvement on a
396
- plaintext `groupId`, which handed over a stable, meaningful, cross-send label;
397
- it is not anonymity of the partition. The `sender_key` type is also a
398
- single-column filter isolating group traffic from pairwise traffic, which the
399
- old design did not offer — group messages used to hide among `ciphertext` rows.
400
-
401
- **Still visible.** Delivery metadata itself: who sent to whom, when, and how
412
+ attributes. It can still partition delivery pairs into unlabeled groups, and
413
+ any one of those channels suffices. That is a real improvement on a plaintext
414
+ `groupId`, which handed over a stable, meaningful, cross-send label. It is not
415
+ anonymity of the partition. The `sender_key` type is also a single-column
416
+ filter that isolates group traffic from pairwise traffic. The old design did
417
+ not offer that filter, because group messages used to hide among `ciphertext`
418
+ rows.
419
+
420
+ **Still visible**. Delivery metadata itself: who sent to whom, when, and how
402
421
  much. Every relay sees this. Sealed sender removes the sender from the
403
422
  identified half of it.
404
423
 
@@ -406,18 +425,20 @@ identified half of it.
406
425
 
407
426
  `identify` maps an authenticated session to an account (`userId`), with no
408
427
  device. Every account-scoped endpoint therefore authorizes at account
409
- granularity, and the `deviceId` arguments are routing selectors chosen by the
410
- caller rather than authenticated claims. Concretely, any session for an account
411
- can read and delete **any** of that account's device queues
412
- (`getPendingMessages`, `markDelivered`), send as any of its device IDs
413
- (`send.senderDeviceId`), and upload or rotate key material for any of its
414
- devices (`keys`).
415
-
416
- This is the intended model — a compromised session already holds the account —
417
- but it means the component provides no isolation *between* an account's own
418
- devices. Deployments that need device isolation must issue device-scoped
419
- sessions and enforce the binding in their own `identify` wrapper; the component
420
- cannot do it while its identity has no device field.
428
+ granularity, and the caller chooses each `deviceId` argument as a route
429
+ selector rather than an authenticated claim. Concretely, any session for an
430
+ account can:
431
+
432
+ - read and delete **any** of that account's device queues
433
+ (`getPendingMessages`, `markDelivered`)
434
+ - send as any of its device IDs (`send.senderDeviceId`)
435
+ - upload or rotate key material for any of its devices (`keys`)
436
+
437
+ This is the intended model, because a compromised session already holds the
438
+ account. It does mean that the component provides no isolation *between* an
439
+ account's own devices. Deployments that need device isolation must issue
440
+ device-scoped sessions and enforce the binding in their own `identify` wrapper.
441
+ The component cannot do it while its identity has no device field.
421
442
 
422
443
  ## Profile-key issuance threat model
423
444
 
@@ -3,7 +3,8 @@
3
3
  `InMemorySignalProtocolRelayServer` implements `ISignalProtocolRelayServer` in memory for examples
4
4
  and local application development.
5
5
 
6
- Real protocol and cryptography; simulated in-memory infrastructure.
6
+ The protocol and cryptography are real. The adapter simulates the
7
+ infrastructure in memory.
7
8
 
8
9
  ## Why it exists
9
10
 
@@ -29,8 +30,8 @@ await client.syncToServer();
29
30
  ```
30
31
 
31
32
  All registered devices, public keys, mailboxes, and provisioning state disappear
32
- with the adapter. It performs no real account authentication, rate limiting,
33
- abuse prevention, or durable delivery and must not be used in production.
33
+ with the adapter. It does not authenticate accounts, limit rates, prevent
34
+ abuse, or deliver durably. Never use it in production.
34
35
 
35
36
  ## Deterministic failure and recovery exercises
36
37
 
@@ -61,8 +62,8 @@ relay.failures.reconnect("bob", 1);
61
62
  a scenario without rebuilding clients. Authorization rejection raises
62
63
  `SealedSenderAuthError`, allowing the client's documented identified-delivery
63
64
  fallback. One-time-prekey exhaustion withholds both EC and KEM one-time keys but
64
- keeps the KEM last-resort key, so strict-PQ examples exercise the intended
65
- post-quantum recovery path rather than a silent classical downgrade. Failure
65
+ keeps the KEM last-resort key. Strict-PQ examples therefore exercise the
66
+ intended post-quantum recovery path rather than a silent classical downgrade. Failure
66
67
  selection uses the configured seed and delivery count, never `Math.random()` or
67
68
  wall-clock time.
68
69
 
package/safety/README.md CHANGED
@@ -35,7 +35,7 @@ Use the composite safety-number API for contact verification in this SDK
35
35
  profile. The single-key helper is a lower-level reference primitive and does
36
36
  not authenticate the complete composite identity.
37
37
 
38
- The SDK creates comparison data; the application owns QR rendering, scanning,
38
+ The SDK creates comparison data. The application owns QR rendering, scanning,
39
39
  the verification user experience, and storage of the user's trust decision.
40
40
 
41
41
  See the [keys guide](../keys/README.md) and
@@ -6,8 +6,9 @@ that support authenticated sender-anonymous envelope delivery.
6
6
  ## Why it exists
7
7
 
8
8
  A relay may need to authorize delivery without learning sender identity from
9
- the outer request. The access key is derived from profile-key material and can
10
- be presented through the relay's sealed-sender authorization contract.
9
+ the outer request. The module derives the access key from profile-key material.
10
+ A sender can present it through the relay's sealed-sender authorization
11
+ contract.
11
12
 
12
13
  ## Usage
13
14
 
package/types/README.md CHANGED
@@ -25,7 +25,7 @@ const address = ProtocolAddress.create("bob", 1);
25
25
  const encodedKey = asBase64(valueFromValidatedStorage);
26
26
  ```
27
27
 
28
- TypeScript brands document validated representation; they do not validate at
28
+ TypeScript brands document validated representation. They do not validate at
29
29
  runtime by themselves. Use the provided validators or validate at the
30
30
  untrusted boundary before applying a brand.
31
31
 
package/utils/README.md CHANGED
@@ -26,11 +26,11 @@ const bundle = await withRetry(
26
26
  );
27
27
  ```
28
28
 
29
- `withRetry()` uses bounded exponential backoff with optional jitter. Known
30
- protocol and identity failures are not retried; transient network, timeout,
31
- database-lock, and concurrency failures are.
29
+ `withRetry()` uses bounded exponential backoff with optional jitter. It does not
30
+ retry known protocol and identity failures. It does retry transient network,
31
+ timeout, database-lock, and concurrency failures.
32
32
 
33
- Retrying is only safe when the operation is read-only or idempotent. The caller
33
+ Retry only a read-only or idempotent operation. The caller
34
34
  must not wrap an arbitrary mutation without an idempotency contract.
35
35
 
36
36
  See the [error-handling guide](../docs/ERROR_HANDLING.md) and