@bsv/wallet-toolbox 2.4.22 → 2.6.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 (160) hide show
  1. package/CHANGELOG.md +60 -7
  2. package/README.md +52 -1
  3. package/docs/authentication-observability.md +21 -9
  4. package/out/src/CWIStyleWalletManager.d.ts +31 -3
  5. package/out/src/CWIStyleWalletManager.d.ts.map +1 -1
  6. package/out/src/CWIStyleWalletManager.js +164 -56
  7. package/out/src/CWIStyleWalletManager.js.map +1 -1
  8. package/out/src/Wallet.d.ts +3 -3
  9. package/out/src/Wallet.d.ts.map +1 -1
  10. package/out/src/Wallet.js +45 -19
  11. package/out/src/Wallet.js.map +1 -1
  12. package/out/src/index.all.d.ts +1 -0
  13. package/out/src/index.all.d.ts.map +1 -1
  14. package/out/src/index.all.js +1 -0
  15. package/out/src/index.all.js.map +1 -1
  16. package/out/src/index.mobile.d.ts +1 -0
  17. package/out/src/index.mobile.d.ts.map +1 -1
  18. package/out/src/index.mobile.js +1 -0
  19. package/out/src/index.mobile.js.map +1 -1
  20. package/out/src/sdk/WalletStorage.interfaces.d.ts +1 -0
  21. package/out/src/sdk/WalletStorage.interfaces.d.ts.map +1 -1
  22. package/out/src/sdk/types.d.ts +1 -1
  23. package/out/src/sdk/types.d.ts.map +1 -1
  24. package/out/src/sdk/types.js +1 -6
  25. package/out/src/sdk/types.js.map +1 -1
  26. package/out/src/services/Services.d.ts.map +1 -1
  27. package/out/src/services/Services.js +5 -5
  28. package/out/src/services/Services.js.map +1 -1
  29. package/out/src/services/chaintracker/chaintracks/Api/BulkIngestorApi.d.ts +1 -1
  30. package/out/src/services/chaintracker/chaintracks/Api/ChaintracksClientApi.d.ts +11 -0
  31. package/out/src/services/chaintracker/chaintracks/Api/ChaintracksClientApi.d.ts.map +1 -1
  32. package/out/src/services/chaintracker/chaintracks/Chaintracks.d.ts +4 -0
  33. package/out/src/services/chaintracker/chaintracks/Chaintracks.d.ts.map +1 -1
  34. package/out/src/services/chaintracker/chaintracks/Chaintracks.js +97 -33
  35. package/out/src/services/chaintracker/chaintracks/Chaintracks.js.map +1 -1
  36. package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.d.ts +12 -0
  37. package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.d.ts.map +1 -1
  38. package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.js +127 -41
  39. package/out/src/services/chaintracker/chaintracks/GoChaintracksServiceClient.js.map +1 -1
  40. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorChaintracks.d.ts +27 -0
  41. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorChaintracks.d.ts.map +1 -0
  42. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorChaintracks.js +64 -0
  43. package/out/src/services/chaintracker/chaintracks/Ingest/BulkIngestorChaintracks.js.map +1 -0
  44. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorChaintracksSSE.d.ts.map +1 -1
  45. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorChaintracksSSE.js +15 -2
  46. package/out/src/services/chaintracker/chaintracks/Ingest/LiveIngestorChaintracksSSE.js.map +1 -1
  47. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.d.ts.map +1 -1
  48. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.js +8 -6
  49. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainIngestorWs.js.map +1 -1
  50. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.d.ts +11 -5
  51. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.d.ts.map +1 -1
  52. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.js +40 -3
  53. package/out/src/services/chaintracker/chaintracks/Ingest/WhatsOnChainServices.js.map +1 -1
  54. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.d.ts +3 -0
  55. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.d.ts.map +1 -1
  56. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js +33 -8
  57. package/out/src/services/chaintracker/chaintracks/Storage/ChaintracksStorageNoDb.js.map +1 -1
  58. package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.d.ts +16 -1
  59. package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.d.ts.map +1 -1
  60. package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.js +70 -31
  61. package/out/src/services/chaintracker/chaintracks/configureChaintracksIngestors.js.map +1 -1
  62. package/out/src/services/chaintracker/chaintracks/index.mobile.d.ts +3 -0
  63. package/out/src/services/chaintracker/chaintracks/index.mobile.d.ts.map +1 -1
  64. package/out/src/services/chaintracker/chaintracks/index.mobile.js +3 -0
  65. package/out/src/services/chaintracker/chaintracks/index.mobile.js.map +1 -1
  66. package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.d.ts.map +1 -1
  67. package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js +35 -2
  68. package/out/src/services/chaintracker/chaintracks/util/blockHeaderUtilities.js.map +1 -1
  69. package/out/src/services/createDefaultWalletServicesOptions.d.ts +6 -1
  70. package/out/src/services/createDefaultWalletServicesOptions.d.ts.map +1 -1
  71. package/out/src/services/createDefaultWalletServicesOptions.js +48 -19
  72. package/out/src/services/createDefaultWalletServicesOptions.js.map +1 -1
  73. package/out/src/services/networkConfig.d.ts +10 -21
  74. package/out/src/services/networkConfig.d.ts.map +1 -1
  75. package/out/src/services/networkConfig.js +49 -11
  76. package/out/src/services/networkConfig.js.map +1 -1
  77. package/out/src/services/providers/WhatsOnChain.d.ts +8 -2
  78. package/out/src/services/providers/WhatsOnChain.d.ts.map +1 -1
  79. package/out/src/services/providers/WhatsOnChain.js +21 -2
  80. package/out/src/services/providers/WhatsOnChain.js.map +1 -1
  81. package/out/src/signer/methods/completeSignedTransaction.d.ts.map +1 -1
  82. package/out/src/signer/methods/completeSignedTransaction.js +54 -13
  83. package/out/src/signer/methods/completeSignedTransaction.js.map +1 -1
  84. package/out/src/signer/methods/createAction.d.ts.map +1 -1
  85. package/out/src/signer/methods/createAction.js +14 -10
  86. package/out/src/signer/methods/createAction.js.map +1 -1
  87. package/out/src/signer/methods/verifyUnlockScripts.d.ts.map +1 -1
  88. package/out/src/signer/methods/verifyUnlockScripts.js +257 -21
  89. package/out/src/signer/methods/verifyUnlockScripts.js.map +1 -1
  90. package/out/src/storage/StorageIdb.d.ts +2 -0
  91. package/out/src/storage/StorageIdb.d.ts.map +1 -1
  92. package/out/src/storage/StorageIdb.js +49 -3
  93. package/out/src/storage/StorageIdb.js.map +1 -1
  94. package/out/src/storage/StorageKnex.d.ts +6 -0
  95. package/out/src/storage/StorageKnex.d.ts.map +1 -1
  96. package/out/src/storage/StorageKnex.js +140 -5
  97. package/out/src/storage/StorageKnex.js.map +1 -1
  98. package/out/src/storage/StorageProvider.d.ts +23 -0
  99. package/out/src/storage/StorageProvider.d.ts.map +1 -1
  100. package/out/src/storage/StorageProvider.js +64 -1
  101. package/out/src/storage/StorageProvider.js.map +1 -1
  102. package/out/src/storage/index.all.d.ts +1 -0
  103. package/out/src/storage/index.all.d.ts.map +1 -1
  104. package/out/src/storage/index.all.js +1 -0
  105. package/out/src/storage/index.all.js.map +1 -1
  106. package/out/src/storage/methods/actionPlanning.d.ts +14 -0
  107. package/out/src/storage/methods/actionPlanning.d.ts.map +1 -1
  108. package/out/src/storage/methods/actionPlanning.js +55 -0
  109. package/out/src/storage/methods/actionPlanning.js.map +1 -1
  110. package/out/src/storage/methods/availableManagedChange.d.ts +1 -0
  111. package/out/src/storage/methods/availableManagedChange.d.ts.map +1 -1
  112. package/out/src/storage/methods/availableManagedChange.js.map +1 -1
  113. package/out/src/storage/methods/createAction.d.ts.map +1 -1
  114. package/out/src/storage/methods/createAction.js +225 -131
  115. package/out/src/storage/methods/createAction.js.map +1 -1
  116. package/out/src/storage/methods/generateChange.d.ts.map +1 -1
  117. package/out/src/storage/methods/generateChange.js +29 -14
  118. package/out/src/storage/methods/generateChange.js.map +1 -1
  119. package/out/src/storage/methods/getBeefForTransaction.d.ts +7 -0
  120. package/out/src/storage/methods/getBeefForTransaction.d.ts.map +1 -1
  121. package/out/src/storage/methods/getBeefForTransaction.js +196 -16
  122. package/out/src/storage/methods/getBeefForTransaction.js.map +1 -1
  123. package/out/src/storage/methods/processAction.d.ts.map +1 -1
  124. package/out/src/storage/methods/processAction.js +36 -15
  125. package/out/src/storage/methods/processAction.js.map +1 -1
  126. package/out/src/storage/remoting/KnexPaymentReplayStore.d.ts +12 -0
  127. package/out/src/storage/remoting/KnexPaymentReplayStore.d.ts.map +1 -0
  128. package/out/src/storage/remoting/KnexPaymentReplayStore.js +46 -0
  129. package/out/src/storage/remoting/KnexPaymentReplayStore.js.map +1 -0
  130. package/out/src/storage/remoting/KnexSessionManager.d.ts +20 -0
  131. package/out/src/storage/remoting/KnexSessionManager.d.ts.map +1 -1
  132. package/out/src/storage/remoting/KnexSessionManager.js +74 -16
  133. package/out/src/storage/remoting/KnexSessionManager.js.map +1 -1
  134. package/out/src/storage/remoting/StorageServer.d.ts +21 -1
  135. package/out/src/storage/remoting/StorageServer.d.ts.map +1 -1
  136. package/out/src/storage/remoting/StorageServer.js +143 -5
  137. package/out/src/storage/remoting/StorageServer.js.map +1 -1
  138. package/out/src/storage/remoting/edgePolicy.d.ts +27 -0
  139. package/out/src/storage/remoting/edgePolicy.d.ts.map +1 -1
  140. package/out/src/storage/remoting/edgePolicy.js +165 -15
  141. package/out/src/storage/remoting/edgePolicy.js.map +1 -1
  142. package/out/src/storage/schema/KnexMigrations.d.ts +1 -0
  143. package/out/src/storage/schema/KnexMigrations.d.ts.map +1 -1
  144. package/out/src/storage/schema/KnexMigrations.js +41 -2
  145. package/out/src/storage/schema/KnexMigrations.js.map +1 -1
  146. package/out/src/storage/schema/entities/EntityProvenTx.d.ts +2 -1
  147. package/out/src/storage/schema/entities/EntityProvenTx.d.ts.map +1 -1
  148. package/out/src/storage/schema/entities/EntityProvenTx.js +8 -3
  149. package/out/src/storage/schema/entities/EntityProvenTx.js.map +1 -1
  150. package/out/src/storage/storageProviderHelpers.d.ts.map +1 -1
  151. package/out/src/storage/storageProviderHelpers.js +8 -2
  152. package/out/src/storage/storageProviderHelpers.js.map +1 -1
  153. package/out/src/utility/ScriptTemplateBRC29.d.ts +3 -2
  154. package/out/src/utility/ScriptTemplateBRC29.d.ts.map +1 -1
  155. package/out/src/utility/ScriptTemplateBRC29.js +13 -5
  156. package/out/src/utility/ScriptTemplateBRC29.js.map +1 -1
  157. package/out/src/utility/utilityHelpers.d.ts.map +1 -1
  158. package/out/src/utility/utilityHelpers.js +2 -0
  159. package/out/src/utility/utilityHelpers.js.map +1 -1
  160. package/package.json +5 -3
package/CHANGELOG.md CHANGED
@@ -6,6 +6,58 @@ attention to changes that materially alter behavior or extend functionality.
6
6
 
7
7
  ## wallet-toolbox (unreleased)
8
8
 
9
+ - Make ChainTracks credential-free by default on mainnet, testnet, and
10
+ TerraTestNet through the public Arcade/go-chaintracks v2 HTTP and SSE APIs.
11
+ Add explicit STN and Terra Scaling TestNet support, exact per-network genesis
12
+ headers, isolated in-memory storage, and remove silent testnet aliases.
13
+ - Add prioritized bulk/live source failover, locally validated last-good height
14
+ operation, source health reporting, bounded request timeouts, browser-safe SSE
15
+ reconnection, network checks, and a globally rate-limited anonymous
16
+ WhatsOnChain fallback for mainnet/testnet. WhatsOnChain keys remain optional
17
+ and rejected configured keys retry header/info requests anonymously.
18
+ - Preserve the default automatically negotiated in-memory `noSend` batching and
19
+ `sendWith` lifecycle introduced in #289. Expand inherited txid-only proof
20
+ ancestors for cold clients, preserve caller-declared known txids, report the
21
+ actual viable-change funding shortfall, and document aborting listed staged
22
+ actions by transaction ID.
23
+ - Collapse fragmented `createAction` storage work into one atomic write
24
+ transaction, batch proof retrieval and compound-proof validation, overlap
25
+ independent proof reads with persistence, bulk-insert untagged outputs, and
26
+ batch canonical P2PKH verification. The retained 153-input authenticated
27
+ remote PXC workload is below 500 ms at p95.
28
+ - Reuse parsed root and counterparty keys and one BRC-42 shared secret per
29
+ counterparty while signing managed BRC-29 inputs, keep funding selection and
30
+ transaction-size accounting linear, and avoid redundant BEEF validation,
31
+ unused process reads, and unconditional commission reads on the successful
32
+ path. Generated scripts, signatures, fees, input ordering, BEEF bytes, and
33
+ error diagnostics remain equivalence-tested.
34
+ - Add bounded-cardinality spans for proof decode/merge, persistence, signing,
35
+ verification, result assembly, serialization, and server-side processing.
36
+ No telemetry header or protocol field is added; BRC-103/104, AuthFetch, Auth
37
+ Express Middleware, AuthSocket, JSON-RPC, and wallet wire behavior are unchanged.
38
+ - Coalesce only recent timestamp-only touches for already-authenticated shared
39
+ Knex sessions, while immediately persisting every authentication and
40
+ certificate transition. This removes a synchronous replicated PXC write from
41
+ the normal RPC path; exact per-request persistence remains available with
42
+ `touchIntervalMs: 0`.
43
+ - Make expired action-batch reservations non-blocking in indexed queries and
44
+ repair MySQL rollback support indexes. Existing databases migrate through the
45
+ normal Knex path, and full PXC down-to-empty/re-upgrade is regression-tested.
46
+ - Make UMP account lookup resilient to stale SLAP advertisements and partial
47
+ overlay failure. One verified matching token establishes an existing account;
48
+ otherwise one clean empty response establishes a new account. Malformed,
49
+ rejected, empty, and unavailable peers cannot veto a verified token, and
50
+ malformed or unavailable peers cannot veto a clean empty response. Lookups
51
+ with no usable response remain errors; WAB existing-account continuity still
52
+ prevents replacement-wallet onboarding.
53
+ - Resolve competing verified UMP tokens on on-chain proof. A candidate spent
54
+ anywhere in another candidate's BEEF ancestry is superseded (evidence merged
55
+ across hosts serving different depths; ancestry walked iteratively so deep
56
+ update chains cannot exhaust the stack). Forked candidates resolve only when
57
+ exactly one provably consumed a same-identity predecessor token, which
58
+ requires the account's keys; anything less decisive stays an error so a
59
+ wrong token can never be chosen silently. Resolved conflicts report a
60
+ `supersededTokens` count in lookup telemetry.
9
61
  - Plan legacy `createAction` funding against the exact unreserved managed-change
10
62
  set before persistence, claim the selected inputs atomically in one storage
11
63
  transaction, and fail economically impossible fragmented wallets before
@@ -127,10 +179,10 @@ attention to changes that materially alter behavior or extend functionality.
127
179
  `auth-express-middleware@2.1.1` likewise declares its `mime-types` runtime
128
180
  import so strict package managers do not fail when loading the built packages.
129
181
 
130
- - Release prep for `2.4.2`: proof completion now discovers every local
131
- transaction row sharing the proven txid, repairs notification-set drift from
132
- concurrent multi-user `internalizeAction` calls, and idempotently completes
133
- any local copy omitted by a last-writer-wins notification update.
182
+ - Release prep for `2.4.2`: proof completion now discovers every local
183
+ transaction row sharing the proven txid, repairs notification-set drift from
184
+ concurrent multi-user `internalizeAction` calls, and idempotently completes
185
+ any local copy omitted by a last-writer-wins notification update.
134
186
 
135
187
  - Release prep for `2.4.1`: define one managed-change policy across Knex and IndexedDB allocation,
136
188
  counting, default balance reporting, `balanceAndUtxos`, and `noSendChange`.
@@ -173,7 +225,8 @@ attention to changes that materially alter behavior or extend functionality.
173
225
  ## wallet-toolbox 2.1.20
174
226
 
175
227
  - Update cdn.projectbabbage.com valid blockheaders file hash.
176
- -
228
+ -
229
+
177
230
  ## wallet-toolbox 2.1.19
178
231
 
179
232
  - Merge PR#146. GenerateChange change to better handle dust situations. Redundant trimInputBeef knownTxids safety check.
@@ -196,7 +249,7 @@ attention to changes that materially alter behavior or extend functionality.
196
249
  ## wallet-toolbox 2.1.15
197
250
 
198
251
  - audit fix
199
-
252
+
200
253
  ## wallet-toolbox 2.1.14
201
254
 
202
255
  - fix update timestamp on all updated currencies
@@ -233,7 +286,7 @@ attention to changes that materially alter behavior or extend functionality.
233
286
 
234
287
  ## wallet-toolbox 2.1.9
235
288
 
236
- - Fix batch sending bug in TaskSendWaiting
289
+ - Fix batch sending bug in TaskSendWaiting
237
290
 
238
291
  ## wallet-toolbox 2.1.8
239
292
 
package/README.md CHANGED
@@ -34,6 +34,34 @@ The toolbox publishes three npm packages from this repo:
34
34
  - **[`@bsv/wallet-toolbox-client`](https://www.npmjs.com/package/@bsv/wallet-toolbox-client)** — Browser build; excludes Node-only backends (Knex/SQLite/MySQL)
35
35
  - **[`@bsv/wallet-toolbox-mobile`](https://www.npmjs.com/package/@bsv/wallet-toolbox-mobile)** — Mobile build; IndexedDB and remote storage only
36
36
 
37
+ ### ChainTracks sources and networks
38
+
39
+ Wallet services do not require a WhatsOnChain key for ChainTracks. Mainnet,
40
+ testnet, and TerraTestNet use the public Arcade/go-chaintracks v2 HTTP and SSE
41
+ surfaces by default. Bulk batches still pass through local serialization, hash,
42
+ continuity, and genesis checks; providers are tried in priority order; and a
43
+ synchronized tracker can continue serving its last-good checked data during a
44
+ provider outage. WhatsOnChain remains a mainnet/testnet fallback and anonymous
45
+ requests are serialized below its documented public rate.
46
+
47
+ The supported chain identifiers are `main`, `test`, `stn`, `ttn`, and `tstn`
48
+ (`mock` remains available for test utilities). STN and Terra Scaling TestNet do
49
+ not have operator-independent public endpoints: set `STN_CHAINTRACKS_URL` or
50
+ `TSTN_CHAINTRACKS_URL`, use the matching Arcade environment variable, or inject
51
+ an explicit `ChaintracksClientApi`. URLs ending in `/v2` use the reconnecting
52
+ go-chaintracks client; existing legacy v1 URLs and explicit clients remain
53
+ compatible. Browser and mobile distributions expose the same fetch/SSE client
54
+ without Node `Buffer` or filesystem dependencies.
55
+
56
+ Arcade is the browser-safe HTTPS/SSE gateway for Teranode-backed header data.
57
+ Direct Teranode P2P is not included in browser/mobile artifacts.
58
+
59
+ Core ChainTracks factories accept a final source-options argument when an
60
+ application must override the defaults. Set `disableChaintracks`, `disableCdn`,
61
+ or `disableWhatsOnChain` to `true` to opt out of an automatic source, or pass an
62
+ explicit `chaintracks` client to retain an existing deployment topology. All
63
+ earlier positional arguments remain unchanged.
64
+
37
65
  ## Getting Started
38
66
 
39
67
  ### Installation
@@ -105,6 +133,7 @@ The retained fragmented-funding benchmark is runnable with:
105
133
 
106
134
  ```bash
107
135
  pnpm bench:create-action-funding
136
+ pnpm bench:create-action-beef
108
137
  ```
109
138
 
110
139
  Against unmodified commit `c212b5ee7`, a representative 102-input SQLite plan
@@ -112,6 +141,19 @@ fell from 622 queries, 102 database transactions, and 107.3 ms to 17 queries,
112
141
  one transaction, and 8.8 ms. Query and transaction counts remain flat when the
113
142
  selected input count grows; networked database deployments should benefit most.
114
143
 
144
+ The proof-bearing benchmark also exercises the authenticated remote wallet,
145
+ real BRC-103 storage RPC, BRC-29 signing, packed WASM digest verification, and
146
+ 24-level proofs grouped by block. On the PXC staging topology, 20 independent
147
+ 153-input samples measured 376.0 ms p50 and 461.6 ms p95; the corresponding
148
+ direct storage cohort measured 99.3 ms p50 and 137.4 ms p95. A normal one-input
149
+ authenticated cohort measured 78.6 ms p50 and 105.6 ms p95. All 3,080 signature
150
+ verdicts passed. A selective production-shaped database copy with 110 fragmented
151
+ inputs measured 75.5 ms p50 and 155.4 ms p95 for direct storage. The benchmark
152
+ captures client, server HTTP, authentication, RPC, storage, signing,
153
+ verification, and serialization spans and retains gates of 100 ms p50 / 150 ms
154
+ p95 for the normal cohort and 500 ms p95 for the 153-input cohort. These are
155
+ regression gates, not universal hardware guarantees.
156
+
115
157
  Trace context remains local to the telemetry carrier and sink. Wallet Toolbox
116
158
  does not add telemetry headers to AuthFetch, so BRC-103/104, Auth Express
117
159
  Middleware, AuthSocket, JSON-RPC, and mixed-version remote storage behavior are
@@ -133,7 +175,9 @@ await storage.migrate(storageName, storageIdentityKey)
133
175
  await storage.makeAvailable()
134
176
 
135
177
  const sessionManager = new KnexSessionManager(storage.knex, {
136
- ttlMs: 24 * 60 * 60 * 1000
178
+ ttlMs: 24 * 60 * 60 * 1000,
179
+ // Optional. Set to 0 when every authenticated use must update the row.
180
+ touchIntervalMs: 60 * 1000
137
181
  })
138
182
 
139
183
  const server = new StorageServer(storage, {
@@ -158,6 +202,13 @@ const server = new StorageServer(storage, {
158
202
  server.start()
159
203
  ```
160
204
 
205
+ Shared Knex sessions immediately persist authentication, nonce, identity, and
206
+ certificate-state transitions. For an already-authenticated row, the default
207
+ manager coalesces only timestamp-only usage touches for up to one minute. This
208
+ avoids a synchronous replicated write on every RPC while keeping durable expiry
209
+ within a bounded minute of the most recent use. Use `touchIntervalMs: 0` to
210
+ retain exact per-request timestamp persistence.
211
+
161
212
  Both stages return HTTP 429 with `ERR_RATE_LIMITED`. For multi-process or
162
213
  multi-replica deployments, configure a shared `express-rate-limit` store in
163
214
  both options so limits are aggregate rather than per process. Never use a
@@ -58,20 +58,32 @@ not affect authentication or wallet behavior.
58
58
  `authenticationFlow` starts as `unknown`. A password cannot create a wallet
59
59
  until account lookup has completed.
60
60
 
61
- An empty UMP answer means `new-user` only when every selected overlay host
62
- settled successfully and returned an empty output list. Timeout, host failure,
63
- malformed response, semantic rejection, or a malformed UMP token raises
64
- `UMPTokenLookupError`. Multiple distinct valid UMP tokens are also treated as
65
- ambiguous instead of choosing one by response order. Applications should
66
- present retry and account-recovery options for these errors, never a
67
- new-password prompt.
61
+ UMP account lookup prefers usable evidence over peer unanimity. Exactly one
62
+ verified token matching the requested presentation or recovery hash means
63
+ `existing-user`, regardless of empty, malformed, rejected, or unavailable peer
64
+ responses. When no token verifies, one host's valid empty output list is enough
65
+ to mean `new-user`; malformed and unavailable peers cannot veto that result.
66
+ Multiple distinct verified UMP tokens resolve on on-chain proof alone. A token
67
+ update spends its predecessor's outpoint, so a candidate spent anywhere in
68
+ another candidate's transaction ancestry (walked through each candidate's BEEF,
69
+ with evidence merged across hosts serving different depths) is superseded.
70
+ Forked candidates with no spend relationship resolve only when exactly one of
71
+ them provably consumed a same-identity UMP token — spending a token requires
72
+ the account's keys, so this demonstrates continuity of control, whereas an
73
+ independently minted competitor is typically the residue of an erroneous
74
+ re-onboarding. A resolved conflict reports `supersededTokens` in the completed
75
+ event. Anything less decisive — true forks, competing proven continuations, or
76
+ candidates without examinable evidence — remains ambiguous, and a lookup with
77
+ neither a verified token nor a clean empty response raises
78
+ `UMPTokenLookupError`. Applications should present retry and account-recovery
79
+ options for these errors, never a new-password prompt.
68
80
 
69
81
  WAB completion uses an explicit `accountStatus` or `existingUser` response when
70
82
  available. For older WAB servers it derives the status from the established
71
83
  protocol: a new account returns the temporary presentation key, while an
72
84
  existing account returns its stored key. If WAB identifies an existing account
73
- but UMP authoritatively appears absent, `WABAccountContinuityError` prevents
74
- new-wallet creation.
85
+ but UMP lookup returns no verified token, `WABAccountContinuityError` prevents
86
+ new-wallet creation even when an overlay host returned a clean empty result.
75
87
 
76
88
  Temporary WAB authentication state expires after ten minutes by default and is
77
89
  cleared when authentication is cancelled, completed, or destroyed.
@@ -154,7 +154,7 @@ export interface UMPTokenInteractor {
154
154
  *
155
155
  * @param hash The hash of the presentation key.
156
156
  * @returns The UMP token if found; otherwise, undefined.
157
- * @throws Implementations should throw when absence cannot be established authoritatively.
157
+ * @throws Implementations should throw when no verified token or clean empty response is available.
158
158
  */
159
159
  findByPresentationKeyHash: (hash: number[]) => Promise<UMPToken | undefined>;
160
160
  /**
@@ -163,7 +163,7 @@ export interface UMPTokenInteractor {
163
163
  *
164
164
  * @param hash The hash of the recovery key.
165
165
  * @returns The UMP token if found; otherwise, undefined.
166
- * @throws Implementations should throw when absence cannot be established authoritatively.
166
+ * @throws Implementations should throw when no verified token or clean empty response is available.
167
167
  */
168
168
  findByRecoveryKeyHash: (hash: number[]) => Promise<UMPToken | undefined>;
169
169
  /**
@@ -191,7 +191,7 @@ export interface UMPTokenLookupDiagnostics {
191
191
  }
192
192
  export type UMPTokenLookupFailureReason = 'lookup-unavailable' | 'lookup-incomplete' | 'token-malformed' | 'token-ambiguous';
193
193
  /**
194
- * Raised when UMP absence cannot be established authoritatively.
194
+ * Raised when a UMP lookup yields neither a verified token nor a clean empty response.
195
195
  *
196
196
  * Callers must offer retry/recovery rather than treating this error as a new
197
197
  * account. Diagnostics contain counts only and never hashes, keys, or tokens.
@@ -251,9 +251,37 @@ export declare class OverlayUMPTokenInteractor implements UMPTokenInteractor {
251
251
  */
252
252
  findByRecoveryKeyHash(hash: number[]): Promise<UMPToken | undefined>;
253
253
  private findToken;
254
+ /**
255
+ * Picks the newest rendition among distinct verified tokens, when possible.
256
+ *
257
+ * The on-chain UMP protocol expresses token updates by consumption: the
258
+ * transaction creating a new rendition spends the previous rendition's
259
+ * outpoint (there is no rendition counter field in the current format).
260
+ * A candidate is therefore superseded when any other candidate's ancestry
261
+ * (available from its BEEF) spends the candidate's outpoint.
262
+ *
263
+ * @returns The single unsuperseded candidate, or undefined when supersession
264
+ * cannot be established for every stale candidate (e.g. forked tokens).
265
+ */
266
+ private resolveNewestToken;
267
+ /**
268
+ * Whether `tx` spends an input whose source output (available in the BEEF)
269
+ * decodes as a UMP token sharing the candidate's presentation or recovery
270
+ * hash — on-chain proof that the candidate is an update of a same-identity
271
+ * predecessor rather than an independently minted token.
272
+ */
273
+ private consumesSameIdentityToken;
274
+ /**
275
+ * Accumulates every outpoint spent by `tx` and by the ancestor transactions
276
+ * embedded in its BEEF, so supersession is detected even when intermediate
277
+ * renditions are absent from the lookup answer. Iterative so arbitrarily
278
+ * long update chains cannot exhaust the call stack.
279
+ */
280
+ private collectSpentOutpoints;
254
281
  private emptyLookupDiagnostics;
255
282
  private toLookupDiagnostics;
256
283
  private lookupDiagnosticAttributes;
284
+ private captureLookupCompleted;
257
285
  private captureLookupFailure;
258
286
  /**
259
287
  * Creates or updates (replaces) a UMP token on-chain. If `oldTokenToConsume` is provided,
@@ -1 +1 @@
1
- {"version":3,"file":"CWIStyleWalletManager.d.ts","sourceRoot":"","sources":["../../src/CWIStyleWalletManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,aAAa,EACb,eAAe,EACf,eAA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qBAAqB,CACzB,IAAI,EAAE,yBAAyB,EAC/B,UAAU,CAAC,EAAE,uCAAuC,GACnD,OAAO,CAAC,2BAA2B,CAAC,CAGtC;IAEK,qBAAqB,CACzB,IAAI,EAAE,yBAAyB,EAC/B,UAAU,CAAC,EAAE,uCAAuC,GACnD,OAAO,CAAC,0BAA0B,CAAC,CAGrC;IAEK,oBAAoB,CACxB,IAAI,EAAE,wBAAwB,EAC9B,UAAU,CAAC,EAAE,uCAAuC,GACnD,OAAO,CAAC,0BAA0B,CAAC,CAGrC;IAEK,eAAe,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,uCAAuC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAQ/G;IAEK,qBAAqB,CACzB,CAAC,EAAE,EAAE,EACL,UAAU,CAAC,EAAE,uCAAuC,GACnD,OAAO,CAAC,mBAAmB,CAAC,CAQ9B;IAEK,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,uCAAuC,GAAG,OAAO,CAAC,eAAe,CAAC,CAGrG;IAEK,kBAAkB,CACtB,IAAI,EAAE,aAAa,EACnB,UAAU,CAAC,EAAE,uCAAuC,GACnD,OAAO,CAAC,eAAe,CAAC,CAG1B;IAEK,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,uCAAuC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAGvG;IAEK,UAAU,CAAC,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,EAAE,uCAAuC,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAGvG;CACF"}
@@ -226,7 +226,7 @@ function isValidProfile(value) {
226
226
  profile.createdAt >= 0);
227
227
  }
228
228
  /**
229
- * Raised when UMP absence cannot be established authoritatively.
229
+ * Raised when a UMP lookup yields neither a verified token nor a clean empty response.
230
230
  *
231
231
  * Callers must offer retry/recovery rather than treating this error as a new
232
232
  * account. Diagnostics contain counts only and never hashes, keys, or tokens.
@@ -326,60 +326,161 @@ class OverlayUMPTokenInteractor {
326
326
  throw new UMPTokenLookupError('lookup-unavailable', diagnostics, { cause: error });
327
327
  }
328
328
  const diagnostics = this.toLookupDiagnostics(resolution);
329
- if (resolution.answer.outputs.length === 0) {
330
- const authoritative = resolution.progress.isFinal &&
331
- resolution.progress.hostCount > 0 &&
332
- resolution.progress.completedHosts === resolution.progress.hostCount &&
333
- resolution.progress.successfulHosts === resolution.progress.hostCount &&
334
- resolution.progress.emptyHosts === resolution.progress.hostCount &&
335
- resolution.progress.failedHosts === 0 &&
336
- resolution.progress.rejectedHosts === 0 &&
337
- resolution.progress.freeformHosts === 0;
338
- if (!authoritative) {
339
- this.captureLookupFailure(lookupKind, 'lookup-incomplete', diagnostics, startedAt);
340
- throw new UMPTokenLookupError('lookup-incomplete', diagnostics);
341
- }
342
- this.telemetry.capture({
343
- name: 'wallet-toolbox.ump.lookup.completed',
344
- component: 'wallet-toolbox.ump',
345
- severity: 'info',
346
- correlationId: diagnostics.correlationId,
347
- attributes: {
348
- lookupKind,
349
- result: 'not-found',
350
- durationMs: Date.now() - startedAt,
351
- ...this.lookupDiagnosticAttributes(diagnostics)
352
- }
353
- });
354
- return undefined;
355
- }
356
329
  const tokens = this.parseLookupAnswers(resolution.answer);
357
330
  const expectedHash = question.query[lookupKind === 'presentation' ? 'presentationHash' : 'recoveryHash'].toLowerCase();
358
- const everyOutputValidAndMatching = tokens.length === resolution.answer.outputs.length &&
359
- tokens.every(token => sdk_1.Utils.toHex(lookupKind === 'presentation' ? token.presentationHash : token.recoveryHash).toLowerCase() ===
360
- expectedHash);
361
- if (!everyOutputValidAndMatching || tokens.length === 0) {
362
- this.captureLookupFailure(lookupKind, 'token-malformed', diagnostics, startedAt);
363
- throw new UMPTokenLookupError('token-malformed', diagnostics);
364
- }
365
- if (tokens.length !== 1) {
331
+ const matchingTokens = tokens.filter(token => sdk_1.Utils.toHex(lookupKind === 'presentation' ? token.presentationHash : token.recoveryHash).toLowerCase() ===
332
+ expectedHash);
333
+ // A verified token is positive account-existence evidence. Empty, malformed,
334
+ // rejected, or unavailable peers cannot override it. The resolver de-duplicates
335
+ // identical outputs, so multiple matching tokens represent distinct records.
336
+ // Competing records are usually stale renditions: a token update spends its
337
+ // predecessor's outpoint, so the newest rendition is the sole candidate not
338
+ // spent by another candidate's transaction history. Only unrelated (forked)
339
+ // tokens remain indeterminate.
340
+ if (matchingTokens.length > 1) {
341
+ const newest = this.resolveNewestToken(matchingTokens, resolution.answer.outputs);
342
+ if (newest != null) {
343
+ this.captureLookupCompleted(lookupKind, 'found', diagnostics, startedAt, {
344
+ supersededTokens: matchingTokens.length - 1
345
+ });
346
+ return newest;
347
+ }
366
348
  const reason = 'token-ambiguous';
367
349
  this.captureLookupFailure(lookupKind, reason, diagnostics, startedAt);
368
350
  throw new UMPTokenLookupError(reason, diagnostics);
369
351
  }
370
- this.telemetry.capture({
371
- name: 'wallet-toolbox.ump.lookup.completed',
372
- component: 'wallet-toolbox.ump',
373
- severity: 'info',
374
- correlationId: diagnostics.correlationId,
375
- attributes: {
376
- lookupKind,
377
- result: 'found',
378
- durationMs: Date.now() - startedAt,
379
- ...this.lookupDiagnosticAttributes(diagnostics)
352
+ if (matchingTokens.length === 1) {
353
+ this.captureLookupCompleted(lookupKind, 'found', diagnostics, startedAt);
354
+ return matchingTokens[0];
355
+ }
356
+ // A clean empty response is sufficient negative evidence once no verified
357
+ // token exists. Malformed outputs and failed peers are ignored so they cannot
358
+ // deny onboarding by advertising corrupt data or remaining unavailable.
359
+ if (resolution.progress.emptyHosts > 0) {
360
+ this.captureLookupCompleted(lookupKind, 'not-found', diagnostics, startedAt);
361
+ return undefined;
362
+ }
363
+ const reason = resolution.answer.outputs.length > 0 ? 'token-malformed' : 'lookup-incomplete';
364
+ this.captureLookupFailure(lookupKind, reason, diagnostics, startedAt);
365
+ throw new UMPTokenLookupError(reason, diagnostics);
366
+ }
367
+ /**
368
+ * Picks the newest rendition among distinct verified tokens, when possible.
369
+ *
370
+ * The on-chain UMP protocol expresses token updates by consumption: the
371
+ * transaction creating a new rendition spends the previous rendition's
372
+ * outpoint (there is no rendition counter field in the current format).
373
+ * A candidate is therefore superseded when any other candidate's ancestry
374
+ * (available from its BEEF) spends the candidate's outpoint.
375
+ *
376
+ * @returns The single unsuperseded candidate, or undefined when supersession
377
+ * cannot be established for every stale candidate (e.g. forked tokens).
378
+ */
379
+ resolveNewestToken(matchingTokens, outputs) {
380
+ const candidates = new Map();
381
+ for (const token of matchingTokens) {
382
+ if (token.currentOutpoint == null)
383
+ return undefined;
384
+ candidates.set(token.currentOutpoint, token);
385
+ }
386
+ // Hosts may serve the same token with different BEEF depth, so evidence
387
+ // for a candidate is merged across every copy rather than first-wins: a
388
+ // shallow copy must not mask the supersession proof a deeper copy carries.
389
+ const evidenceByCandidate = new Map();
390
+ for (const output of outputs) {
391
+ try {
392
+ const tx = sdk_1.Transaction.fromBEEF(output.beef);
393
+ const outpoint = `${tx.id('hex')}.${output.outputIndex}`;
394
+ if (!candidates.has(outpoint))
395
+ continue;
396
+ const evidence = evidenceByCandidate.get(outpoint) ?? { txs: [], spent: new Set() };
397
+ evidence.txs.push(tx);
398
+ this.collectSpentOutpoints(tx, evidence.spent, new Set());
399
+ evidenceByCandidate.set(outpoint, evidence);
400
+ }
401
+ catch {
402
+ // Malformed outputs never produced candidates; nothing to correlate.
380
403
  }
404
+ }
405
+ // Without an evidence transaction for every candidate, an unexamined
406
+ // candidate would trivially survive — refuse to guess.
407
+ if (evidenceByCandidate.size !== candidates.size)
408
+ return undefined;
409
+ const survivors = [...candidates.keys()].filter(outpoint => ![...evidenceByCandidate.entries()].some(([other, { spent }]) => other !== outpoint && spent.has(outpoint)));
410
+ if (survivors.length === 1)
411
+ return candidates.get(survivors[0]);
412
+ // Forked candidates: no spend relationship connects them. Updating a token
413
+ // requires unlocking its predecessor, so a candidate whose transaction
414
+ // provably consumed a same-identity token demonstrates continuity of key
415
+ // control; a freshly minted competitor (funding inputs only) is the anomaly
416
+ // — typically a historical erroneous re-onboarding. Prefer the sole proven
417
+ // continuation; anything less decisive stays indeterminate.
418
+ const provenContinuations = survivors.filter(outpoint => {
419
+ const evidence = evidenceByCandidate.get(outpoint);
420
+ const token = candidates.get(outpoint);
421
+ return (evidence != null && token != null && evidence.txs.some(tx => this.consumesSameIdentityToken(tx, token)));
381
422
  });
382
- return tokens[0];
423
+ if (provenContinuations.length !== 1)
424
+ return undefined;
425
+ return candidates.get(provenContinuations[0]);
426
+ }
427
+ /**
428
+ * Whether `tx` spends an input whose source output (available in the BEEF)
429
+ * decodes as a UMP token sharing the candidate's presentation or recovery
430
+ * hash — on-chain proof that the candidate is an update of a same-identity
431
+ * predecessor rather than an independently minted token.
432
+ */
433
+ consumesSameIdentityToken(tx, token) {
434
+ const presentationHash = sdk_1.Utils.toHex(token.presentationHash);
435
+ const recoveryHash = sdk_1.Utils.toHex(token.recoveryHash);
436
+ for (const input of tx.inputs) {
437
+ const source = input.sourceTransaction;
438
+ if (source == null || input.sourceOutputIndex == null)
439
+ continue;
440
+ const sourceOutput = source.outputs[input.sourceOutputIndex];
441
+ if (sourceOutput == null)
442
+ continue;
443
+ try {
444
+ const decoded = sdk_1.PushDrop.decode(sourceOutput.lockingScript);
445
+ if (decoded.fields == null)
446
+ continue;
447
+ const fields = stripVerifiedPushDropSignature(decoded.fields, decoded.lockingPublicKey);
448
+ if (fields.length < 11 || fields[6]?.length !== 32 || fields[7]?.length !== 32)
449
+ continue;
450
+ if (sdk_1.Utils.toHex(fields[6]) === presentationHash || sdk_1.Utils.toHex(fields[7]) === recoveryHash) {
451
+ return true;
452
+ }
453
+ }
454
+ catch {
455
+ continue;
456
+ }
457
+ }
458
+ return false;
459
+ }
460
+ /**
461
+ * Accumulates every outpoint spent by `tx` and by the ancestor transactions
462
+ * embedded in its BEEF, so supersession is detected even when intermediate
463
+ * renditions are absent from the lookup answer. Iterative so arbitrarily
464
+ * long update chains cannot exhaust the call stack.
465
+ */
466
+ collectSpentOutpoints(tx, spent, visited) {
467
+ const pending = [tx];
468
+ while (pending.length > 0) {
469
+ const current = pending.pop();
470
+ const txid = current.id('hex');
471
+ if (visited.has(txid))
472
+ continue;
473
+ visited.add(txid);
474
+ for (const input of current.inputs) {
475
+ const sourceTxid = input.sourceTXID ?? input.sourceTransaction?.id('hex');
476
+ if (sourceTxid == null || input.sourceOutputIndex == null)
477
+ continue;
478
+ spent.add(`${sourceTxid}.${input.sourceOutputIndex}`);
479
+ if (input.sourceTransaction != null) {
480
+ pending.push(input.sourceTransaction);
481
+ }
482
+ }
483
+ }
383
484
  }
384
485
  emptyLookupDiagnostics(correlationId) {
385
486
  return {
@@ -420,6 +521,21 @@ class OverlayUMPTokenInteractor {
420
521
  outputCount: diagnostics.outputCount
421
522
  };
422
523
  }
524
+ captureLookupCompleted(lookupKind, result, diagnostics, startedAt, extraAttributes = {}) {
525
+ this.telemetry.capture({
526
+ name: 'wallet-toolbox.ump.lookup.completed',
527
+ component: 'wallet-toolbox.ump',
528
+ severity: 'info',
529
+ correlationId: diagnostics.correlationId,
530
+ attributes: {
531
+ lookupKind,
532
+ result,
533
+ durationMs: Date.now() - startedAt,
534
+ ...this.lookupDiagnosticAttributes(diagnostics),
535
+ ...extraAttributes
536
+ }
537
+ });
538
+ }
423
539
  captureLookupFailure(lookupKind, reason, diagnostics, startedAt, error) {
424
540
  this.telemetry.capture({
425
541
  name: 'wallet-toolbox.ump.lookup.indeterminate',
@@ -690,15 +806,7 @@ class OverlayUMPTokenInteractor {
690
806
  }
691
807
  if (resolution.answer.outputs.length === 0) {
692
808
  const p = resolution.progress;
693
- const authoritative = p.isFinal &&
694
- p.hostCount > 0 &&
695
- p.completedHosts === p.hostCount &&
696
- p.successfulHosts === p.hostCount &&
697
- p.emptyHosts === p.hostCount &&
698
- p.failedHosts === 0 &&
699
- p.rejectedHosts === 0 &&
700
- p.freeformHosts === 0;
701
- if (!authoritative) {
809
+ if (p.emptyHosts === 0) {
702
810
  const diagnostics = this.toLookupDiagnostics(resolution);
703
811
  this.captureLookupFailure('outpoint', 'lookup-incomplete', diagnostics, startedAt);
704
812
  throw new UMPTokenLookupError('lookup-incomplete', diagnostics);