@open-e2ee/signal-protocol-sdk 8.0.0 → 8.1.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 (66) hide show
  1. package/ADAPTERS.md +2 -2
  2. package/CHANGELOG.md +35 -0
  3. package/README.md +4 -4
  4. package/SECURITY.md +2 -2
  5. package/dist/client/client.d.ts.map +1 -1
  6. package/dist/client/client.js +2 -1
  7. package/dist/client/client.js.map +1 -1
  8. package/dist/client/hosted-transport.d.ts +9 -0
  9. package/dist/client/hosted-transport.d.ts.map +1 -1
  10. package/dist/client/hosted-transport.js +49 -13
  11. package/dist/client/hosted-transport.js.map +1 -1
  12. package/dist/internal/protocol/zk/credentials/attributes.d.ts.map +1 -1
  13. package/dist/internal/protocol/zk/credentials/attributes.js +2 -1
  14. package/dist/internal/protocol/zk/credentials/attributes.js.map +1 -1
  15. package/dist/internal/protocol/zk/credentials/credentials.d.ts.map +1 -1
  16. package/dist/internal/protocol/zk/credentials/credentials.js +8 -6
  17. package/dist/internal/protocol/zk/credentials/credentials.js.map +1 -1
  18. package/dist/internal/protocol/zk/credentials/presentation.d.ts.map +1 -1
  19. package/dist/internal/protocol/zk/credentials/presentation.js +19 -13
  20. package/dist/internal/protocol/zk/credentials/presentation.js.map +1 -1
  21. package/dist/internal/protocol/zk/groups/lizard.d.ts +8 -0
  22. package/dist/internal/protocol/zk/groups/lizard.d.ts.map +1 -1
  23. package/dist/internal/protocol/zk/groups/lizard.js +18 -5
  24. package/dist/internal/protocol/zk/groups/lizard.js.map +1 -1
  25. package/dist/internal/protocol/zk/groups/profile-key-commitment.d.ts.map +1 -1
  26. package/dist/internal/protocol/zk/groups/profile-key-commitment.js +7 -6
  27. package/dist/internal/protocol/zk/groups/profile-key-commitment.js.map +1 -1
  28. package/dist/internal/protocol/zk/groups/profile-key-encryption.d.ts.map +1 -1
  29. package/dist/internal/protocol/zk/groups/profile-key-encryption.js +3 -2
  30. package/dist/internal/protocol/zk/groups/profile-key-encryption.js.map +1 -1
  31. package/dist/internal/protocol/zk/groups/uid-encryption.d.ts.map +1 -1
  32. package/dist/internal/protocol/zk/groups/uid-encryption.js +3 -2
  33. package/dist/internal/protocol/zk/groups/uid-encryption.js.map +1 -1
  34. package/dist/internal/protocol/zk/proofs/point-multiplication.d.ts +53 -0
  35. package/dist/internal/protocol/zk/proofs/point-multiplication.d.ts.map +1 -0
  36. package/dist/internal/protocol/zk/proofs/point-multiplication.js +164 -0
  37. package/dist/internal/protocol/zk/proofs/point-multiplication.js.map +1 -0
  38. package/dist/internal/protocol/zk/proofs/sho.d.ts +1 -0
  39. package/dist/internal/protocol/zk/proofs/sho.d.ts.map +1 -1
  40. package/dist/internal/protocol/zk/proofs/sho.js.map +1 -1
  41. package/dist/internal/protocol/zk/proofs/statement.d.ts.map +1 -1
  42. package/dist/internal/protocol/zk/proofs/statement.js +11 -11
  43. package/dist/internal/protocol/zk/proofs/statement.js.map +1 -1
  44. package/dist/local/store/index.d.ts +2 -2
  45. package/dist/local/store/index.js +2 -2
  46. package/dist/local/store/sqlite/web/driver.d.ts.map +1 -1
  47. package/dist/local/store/sqlite/web/driver.js +3 -1
  48. package/dist/local/store/sqlite/web/driver.js.map +1 -1
  49. package/dist/local/store/sqlite/web/protocol.d.ts +1 -1
  50. package/dist/local/store/sqlite/web/protocol.d.ts.map +1 -1
  51. package/dist/local/store/sqlite/web/worker.d.ts +7 -4
  52. package/dist/local/store/sqlite/web/worker.d.ts.map +1 -1
  53. package/dist/local/store/sqlite/web/worker.js +48 -18
  54. package/dist/local/store/sqlite/web/worker.js.map +1 -1
  55. package/dist/local/store/web-sqlite/adapter.d.ts +3 -0
  56. package/dist/local/store/web-sqlite/adapter.d.ts.map +1 -1
  57. package/dist/local/store/web-sqlite/adapter.js +3 -0
  58. package/dist/local/store/web-sqlite/adapter.js.map +1 -1
  59. package/docs/ASSURANCE.md +13 -12
  60. package/docs/ERROR_HANDLING.md +1 -1
  61. package/docs/PACKAGE_SURFACE.md +3 -1
  62. package/examples/browser/index.html +1 -1
  63. package/local/store/README.md +41 -21
  64. package/local/store/web/README.md +5 -0
  65. package/local/store/web-sqlite/README.md +8 -0
  66. package/package.json +1 -1
@@ -24,29 +24,31 @@ without coupling the client to a database or platform.
24
24
 
25
25
  ### Web
26
26
 
27
- - `IndexedDbSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/web`
28
-
29
- Use this for browser applications. It implements the full core store
30
- contract, including SESAME records, sender-key state, retry message records,
31
- and recovery helpers. It graduated from experimental by completing every
32
- gate on the checklist below. Deployment still requires the origin-security
33
- review described in the [web adapter guide](./web/README.md).
34
-
35
27
  - `webSqliteStore` and `WebSqliteSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/web-sqlite`
36
28
  - `resetWebSqliteStore` and `createPreKeyMaintenanceStore` from the same entry
37
29
 
38
- This store keeps the same state in an SDK-owned SQLite database in the origin
39
- private file system. SQLite3 Multiple Ciphers encrypts the whole file in a Wasm
40
- worker, and the database key lives in a secret vault, by default IndexedDB in
41
- the same origin. The page's Content Security Policy must allow
42
- `'wasm-unsafe-eval'`. A context without the origin private file system gets
43
- `OPFS_UNAVAILABLE`. The [web SQLite store guide](./web-sqlite/README.md) covers
44
- the policy, the tabs, and the security boundary. This store is experimental:
45
- one item on its graduation checklist below is open.
30
+ Use this for browser applications where the origin private file system
31
+ works. It keeps the full core store state in an SDK-owned SQLite database in
32
+ the origin private file system. SQLite3 Multiple Ciphers encrypts the whole
33
+ file in a Wasm worker, and the database key lives in a secret vault, by
34
+ default IndexedDB in the same origin. The page's Content Security Policy must
35
+ allow `'wasm-unsafe-eval'`. A context without the origin private file system
36
+ gets `OPFS_UNAVAILABLE`. The [web SQLite store guide](./web-sqlite/README.md)
37
+ covers the policy, the tabs, and the security boundary. It graduated from
38
+ experimental by completing every gate on the checklist below.
46
39
 
47
40
  A Tauri 2 app uses this store in its webview. See the
48
41
  [Tauri section](./web-sqlite/README.md#tauri).
49
42
 
43
+ - `IndexedDbSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/web`
44
+
45
+ Use this where the origin private file system is not available, and
46
+ `webSqliteStore` fails with `OPFS_UNAVAILABLE`. It implements the full core
47
+ store contract, including SESAME records, sender-key state, retry message
48
+ records, and recovery helpers. It graduated from experimental by completing
49
+ every gate on the checklist below. Deployment still requires the
50
+ origin-security review described in the [web adapter guide](./web/README.md).
51
+
50
52
  ### Bare React Native
51
53
 
52
54
  - `reactNativeStore` and `ReactNativeSignalProtocolStore` from `@open-e2ee/signal-protocol-sdk/local/store/react-native`
@@ -119,7 +121,7 @@ environment an adapter must honor its promises in, not the subject of a test.
119
121
  source repository, and `npm run soak:web-store` runs longer sessions
120
122
  on demand.
121
123
 
122
- `WebSqliteSignalProtocolStore` (experimental, with one item open):
124
+ `WebSqliteSignalProtocolStore` (graduated, and the gates keep running):
123
125
 
124
126
  - [x] Storage contract suites pass in real Chromium, Firefox, and WebKit.
125
127
  The suites are the same modules the jest gate runs. They run against
@@ -154,9 +156,27 @@ environment an adapter must honor its promises in, not the subject of a test.
154
156
  no row of the write, no pinned identity, and the one-time prekey stays.
155
157
  The store stays open. After the clamp is removed, the same commit
156
158
  succeeds, new writes land, and `PRAGMA integrity_check` returns `ok`.
159
+ A first open under a 1 MB and a 4 MB quota rejects with the same typed
160
+ error, and it writes no database key and no database file. After the
161
+ clamp is removed, the open succeeds. A store with two pool files opens,
162
+ reads, and writes under a 3 MB quota that has no room for a new pool.
157
163
  Runs in Chromium on the schedule above. The quota clamp is a DevTools
158
164
  protocol call, so Firefox and WebKit do not run it.
159
- - [ ] Soak evidence. No soak gate runs against this store.
165
+ - [x] Soak evidence: a long run holds latency, memory, and file size flat.
166
+ A soak gate drives the store in real Chromium tabs in three phases:
167
+ 150 open/write/read/close cycles in one tab, one session of 2,000
168
+ churn operations over 250 sessions, and 100 writes that two tabs make
169
+ in turn, so that the file moves to the other tab at each write. Each
170
+ write is read back, and `PRAGMA integrity_check` returns `ok` after
171
+ each phase and after each open. A closed store leaves no worker in the
172
+ tab and no lock of the store in the origin. The gate fails if the
173
+ late-run median of latency, of the page heap, or of the worker heap
174
+ grows beyond a small tolerance over the early-run median, if the Wasm
175
+ memory of the worker grows after the first third of the churn, or if
176
+ the database file grows by more than 10% and 64 KiB over the churn.
177
+ Runs in Chromium on each change to the main branch and on each pull
178
+ request that is ready for review. `npm run soak:web-sqlite` also runs
179
+ it in Firefox and WebKit on demand, without the memory checks.
160
180
 
161
181
  `KeyValueSignalProtocolStore` (graduated, and the gates keep running):
162
182
 
@@ -305,9 +325,9 @@ The host application must use idempotent writes keyed by message ID.
305
325
  - `@open-e2ee/signal-protocol-sdk/local/store/react-native` is the same SQLite
306
326
  store for bare React Native, on op-sqlite and the react-native-keychain vault.
307
327
  - An adapter carries the experimental label until every item on its
308
- graduation checklist is a named, continuously running CI gate. The IndexedDB
309
- web adapter and the key-value adapter completed theirs. The web SQLite store
310
- has one item open.
328
+ graduation checklist is a named, continuously running CI gate. The web
329
+ SQLite store, the IndexedDB web adapter, and the key-value adapter completed
330
+ theirs.
311
331
  - Storage adapters should expose the real package contract instead of app-specific wrappers.
312
332
 
313
333
  ## Related Docs
@@ -66,6 +66,11 @@ and [MDN Content Security Policy guide](https://developer.mozilla.org/docs/Web/H
66
66
 
67
67
  ## Operational status
68
68
 
69
+ In a browser where the origin private file system works, use the
70
+ [web SQLite store](../web-sqlite/README.md). Use this adapter where the origin
71
+ private file system is not available, and `webSqliteStore` fails with
72
+ `OPFS_UNAVAILABLE`.
73
+
69
74
  The adapter covers the core store contract, including atomic security commits,
70
75
  SESAME state, sender-key state, and retry records. Every gate on its
71
76
  graduation checklist in the parent [storage guide](../README.md) runs
@@ -84,6 +84,14 @@ transaction. Each tab reads the writes of the other tabs.
84
84
  the files, for example a tab that is closing. The file is unchanged. Retry
85
85
  the open later.
86
86
 
87
+ ## Full storage
88
+
89
+ When the origin storage quota is full, the open rejects with
90
+ `StorageQuotaExceededError` (`STORAGE_QUOTA_EXCEEDED`). An open that fails
91
+ this way on a new store writes no key and no database file. A write on an open
92
+ store rejects with the same error. SQLite rolls the write back, and the store
93
+ stays open. Free space, then open again or retry the write.
94
+
87
95
  ## Content Security Policy
88
96
 
89
97
  The engine compiles WebAssembly in its worker. A Content Security Policy
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-e2ee/signal-protocol-sdk",
3
- "version": "8.0.0",
3
+ "version": "8.1.0",
4
4
  "description": "Pure TypeScript Signal Protocol SDK for encrypted chat in Expo, React Native, browsers, and Node. Post-quantum by default.",
5
5
  "keywords": [
6
6
  "open-e2ee",