@bsv/expo-wallet-toolbox 0.5.0 → 0.9.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 (200) hide show
  1. package/CHANGELOG.md +2000 -0
  2. package/README.md +66 -1
  3. package/core/amountFormatHelpers.ts +258 -36
  4. package/core/backup/RemoteSyncReader.ts +133 -24
  5. package/core/backup/appData.ts +157 -0
  6. package/core/backup/client.ts +15 -1
  7. package/core/backup/codec.ts +149 -11
  8. package/core/backup/constants.ts +30 -1
  9. package/core/backup/cursor.ts +31 -2
  10. package/core/backup/push.ts +71 -5
  11. package/core/backup/restore.ts +104 -16
  12. package/core/backup/restoreOnImport.ts +94 -30
  13. package/core/backup/status.ts +13 -8
  14. package/core/config.tsx +12 -5
  15. package/core/constants.ts +14 -1
  16. package/core/contacts/contactActivity.ts +153 -0
  17. package/core/contacts/contactCache.ts +41 -0
  18. package/core/contacts/contactsStore.ts +183 -0
  19. package/core/context/ExchangeRateContext.tsx +34 -27
  20. package/core/context/LocalStorageProvider.tsx +43 -40
  21. package/core/context/UserContext.tsx +18 -7
  22. package/core/context/VaultContext.tsx +49 -2
  23. package/core/context/WalletConnectionContext.tsx +203 -11
  24. package/core/context/WalletContext.tsx +685 -171
  25. package/core/demo/demoAssets.ts +60 -0
  26. package/core/demo/demoLedger.ts +240 -0
  27. package/core/demo/demoMandalaRuntime.ts +96 -0
  28. package/core/demo/demoMode.ts +38 -0
  29. package/core/demo/demoWallet.ts +25 -0
  30. package/core/demo/index.ts +26 -0
  31. package/core/demo/useDemo.ts +59 -0
  32. package/core/headers/OfflineFirstChaintracks.ts +99 -17
  33. package/core/headers/headerStore.ts +33 -14
  34. package/core/headers/syncHeaders.ts +12 -1
  35. package/core/i18n/translations.tsx +2186 -98
  36. package/core/identity/contactLink.ts +36 -0
  37. package/core/identity/handleRegistry/client.ts +314 -0
  38. package/core/identity/handleRegistry/keyPinStore.ts +70 -0
  39. package/core/identity/handleRegistry/profileCert.ts +254 -0
  40. package/core/identity/handleRegistry/registration.ts +559 -0
  41. package/core/identity/handleRegistry/resolver.ts +315 -0
  42. package/core/identity/handleRegistry/rules.ts +104 -0
  43. package/core/index.ts +53 -5
  44. package/core/localpay/build.ts +225 -24
  45. package/core/localpay/pending.ts +110 -7
  46. package/core/localpay/pendingAbortAuthority.ts +95 -0
  47. package/core/localpay/pendingAborts.ts +266 -26
  48. package/core/localpay/session.ts +42 -17
  49. package/core/localpay/settlementAck.ts +10 -1
  50. package/core/localpay/transport/socket.ts +52 -3
  51. package/core/localpay/verify.ts +100 -10
  52. package/core/mandala/abortGuard.ts +96 -20
  53. package/core/mandala/createRuntime.ts +206 -33
  54. package/core/mandala/drain.ts +89 -11
  55. package/core/mandala/inboxPrehold.ts +186 -0
  56. package/core/mandala/permissionModule.ts +202 -20
  57. package/core/mandala/settlementStore.ts +24 -2
  58. package/core/mandala/types.ts +40 -5
  59. package/core/monitor/MonitorSupervisor.ts +121 -0
  60. package/core/monitor/TaskBackupPush.ts +15 -1
  61. package/core/monitor/TaskCreditInbox.ts +1 -1
  62. package/core/monitor/TaskDrainOutbox.ts +15 -1
  63. package/core/monitor/TaskSendOffline.ts +15 -1
  64. package/core/net/online.ts +49 -0
  65. package/core/net/publicDestination.ts +91 -0
  66. package/core/net/validateArcUrl.ts +22 -0
  67. package/core/numberFormat.ts +19 -0
  68. package/core/offline/cancelParked.ts +134 -13
  69. package/core/offline/payerHold.ts +100 -24
  70. package/core/offline/plan.ts +37 -8
  71. package/core/pay/beefRepair.ts +6 -2
  72. package/core/pay/damagedInbox.ts +24 -0
  73. package/core/pay/rails/address.ts +107 -12
  74. package/core/pay/rails/handle.ts +117 -22
  75. package/core/pay/rails/index.ts +45 -7
  76. package/core/pay/rails/nativeIntent.ts +61 -0
  77. package/core/pay/receiveHistory.ts +93 -0
  78. package/core/pay/recordProof.ts +21 -7
  79. package/core/pay/refreshProofGuard.ts +42 -1
  80. package/core/pay/watchlist.ts +5 -2
  81. package/core/peerpay/control.ts +17 -18
  82. package/core/peerpay/handleResendRequests.ts +58 -4
  83. package/core/peerpay/outbox.ts +3 -1
  84. package/core/recovery/backupMaterial.ts +61 -0
  85. package/core/recovery/createWallet.ts +95 -0
  86. package/core/recovery/recoverWallet.ts +120 -0
  87. package/core/recovery/restoreWallet.ts +170 -0
  88. package/core/recovery/secret.ts +92 -0
  89. package/core/recovery/shareCollector.ts +71 -0
  90. package/core/recovery/shareParsing.ts +87 -0
  91. package/core/recovery/shares.ts +116 -0
  92. package/core/recovery/useRecoveryDeps.ts +70 -0
  93. package/core/services/arcTokenStorage.ts +52 -0
  94. package/core/services/arcadeBroadcastProvider.ts +233 -52
  95. package/core/services/autoApprovePolicy.ts +105 -0
  96. package/core/services/callbackToken.ts +19 -0
  97. package/core/services/capWalletArgs.ts +14 -2
  98. package/core/services/connectionAuthority.ts +98 -0
  99. package/core/services/exchangeRate.ts +36 -13
  100. package/core/services/externalOrigin.ts +16 -2
  101. package/core/services/secrets/kek.ts +126 -29
  102. package/core/services/secrets/migration.ts +16 -4
  103. package/core/services/secrets/store.ts +42 -14
  104. package/core/services/vault/VaultKeyService.ts +228 -45
  105. package/core/services/vault/chainRecovery.ts +483 -0
  106. package/core/services/vault/driver.ts +9 -1
  107. package/core/services/vault/enrolledSerialRegistry.ts +150 -0
  108. package/core/services/vault/guard.ts +218 -32
  109. package/core/services/vault/hardwareLease.ts +19 -0
  110. package/core/services/vault/metaAuthority.ts +210 -0
  111. package/core/services/vault/pivReset.ts +64 -23
  112. package/core/services/vault/r1comb.ts +139 -3
  113. package/core/services/vault/session.ts +25 -4
  114. package/core/services/vault/transfers.ts +868 -172
  115. package/core/services/vault/types.ts +19 -4
  116. package/core/services/vault/vaultStore.ts +256 -29
  117. package/core/services/walletArgLimits.ts +45 -2
  118. package/core/services/walletConnectionValidation.ts +76 -6
  119. package/core/services/walletServiceConfig.ts +40 -27
  120. package/core/storage/StorageExpoSQLite.ts +88 -47
  121. package/core/storage/methods/findSql.ts +24 -2
  122. package/core/storage/methods/listActionsSql.ts +8 -5
  123. package/core/storage/methods/listOutputsSql.ts +2 -2
  124. package/core/storage/methods/offlineActions.ts +10 -1
  125. package/core/storage/methods/processOfflineActions.ts +117 -25
  126. package/core/storage/methods/reviewStatusSql.ts +7 -2
  127. package/core/storage/schema/createTables.ts +155 -2
  128. package/core/stores/ConnectionStore.ts +34 -0
  129. package/core/toolboxConfig.ts +104 -0
  130. package/core/toolboxTypes.ts +40 -0
  131. package/core/userAvatar.ts +79 -0
  132. package/core/walletDbRegistry.ts +63 -0
  133. package/core/walletMonitor.ts +25 -4
  134. package/core/walletRepair/releaseStuckReservations.ts +72 -0
  135. package/core/walletRepair/shouldMarkUnspendable.ts +20 -0
  136. package/core/walletRepair/spenderConsumesOutpoint.ts +29 -0
  137. package/package.json +7 -7
  138. package/ui/activityFilter.ts +115 -0
  139. package/ui/backupShares.ts +26 -169
  140. package/ui/components/pay/AddressReceive.tsx +13 -6
  141. package/ui/components/pay/AssetPicker.tsx +30 -9
  142. package/ui/components/pay/MessageBoxConfig.tsx +16 -0
  143. package/ui/components/pay/NearbyFlow.tsx +480 -243
  144. package/ui/components/pay/PaymentSuccessOverlay.tsx +85 -10
  145. package/ui/components/pay/RecipientField.tsx +84 -70
  146. package/ui/components/pay/StepBar.tsx +32 -0
  147. package/ui/components/pay/UniversalSend.tsx +827 -205
  148. package/ui/components/ui/AlertCard.tsx +38 -5
  149. package/ui/components/ui/PencilEditField.tsx +109 -0
  150. package/ui/components/ui/PermissionSheet.tsx +197 -66
  151. package/ui/components/ui/SlideOverFromRight.tsx +86 -0
  152. package/ui/components/vault/EnrollWizard.tsx +61 -13
  153. package/ui/components/vault/vaultErrorCopy.ts +3 -1
  154. package/ui/components/wallet/ActivityRow.tsx +227 -123
  155. package/ui/components/wallet/AmountInput.tsx +26 -8
  156. package/ui/components/wallet/AssetSwitcherDropdown.tsx +22 -2
  157. package/ui/components/wallet/Balance.tsx +42 -23
  158. package/ui/components/wallet/BiometricAdvisoryModal.tsx +16 -3
  159. package/ui/components/wallet/ContactActivityList.tsx +149 -0
  160. package/ui/components/wallet/ContactSigil.tsx +49 -0
  161. package/ui/components/wallet/EditPictureSheet.tsx +99 -0
  162. package/ui/components/wallet/FitAmount.tsx +148 -0
  163. package/ui/components/wallet/IconPickerSheet.tsx +168 -0
  164. package/ui/components/wallet/IdentifierRow.tsx +69 -0
  165. package/ui/components/wallet/ImportFromBackupPrompt.tsx +35 -13
  166. package/ui/components/wallet/ProfileButton.tsx +62 -0
  167. package/ui/components/wallet/UserAvatar.tsx +85 -0
  168. package/ui/components/wallet/avatarIcons.ts +122 -0
  169. package/ui/exportTransactions.ts +36 -4
  170. package/ui/hooks/useContactsStore.ts +10 -0
  171. package/ui/hooks/useExportWalletData.ts +25 -2
  172. package/ui/hooks/useMandala.ts +18 -1
  173. package/ui/hooks/useOnline.ts +65 -20
  174. package/ui/importDatabases.ts +339 -24
  175. package/ui/index.ts +33 -2
  176. package/ui/isImageUrl.ts +6 -0
  177. package/ui/printRecoveryShares.ts +9 -10
  178. package/ui/recoveryPrompts.ts +91 -0
  179. package/ui/resolveIdentity.ts +31 -9
  180. package/ui/screens/ConnectionsScreen.tsx +86 -19
  181. package/ui/screens/ContactScreen.tsx +289 -0
  182. package/ui/screens/ContactsScreen.tsx +373 -0
  183. package/ui/screens/IdentifierScreen.tsx +256 -0
  184. package/ui/screens/NewContactScreen.tsx +362 -0
  185. package/ui/screens/PairScreen.tsx +74 -2
  186. package/ui/screens/PayScreen.tsx +20 -7
  187. package/ui/screens/ProfileScreen.tsx +783 -0
  188. package/ui/screens/SettingsScreen.tsx +10 -4
  189. package/ui/screens/TransactionDetailScreen.tsx +419 -0
  190. package/ui/screens/TrustScreen.tsx +100 -5
  191. package/ui/screens/VaultScreen.tsx +410 -61
  192. package/ui/screens/VaultTransferScreen.tsx +59 -7
  193. package/ui/screens/WalletCheckScreen.tsx +17 -6
  194. package/ui/screens/WalletConfigScreen.tsx +124 -28
  195. package/ui/screens/WalletHomeScreen.tsx +640 -104
  196. package/ui/screens/detailActionKeys.ts +55 -0
  197. package/ui/tokenFormat.ts +44 -4
  198. package/ui/tokenStatus.ts +21 -0
  199. package/ui/txStatus.ts +48 -5
  200. package/core/storage/LocalStorageAdapter.ts +0 -58
package/CHANGELOG.md CHANGED
@@ -1,5 +1,2005 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.9.0
4
+
5
+ 0.8.0 has release notes below but was never published to npm. Hosts upgrading
6
+ from 0.7.0 should read both sections.
7
+
8
+ ### Upgrading from 0.7.0
9
+
10
+ - **Peer range `@bsv/wallet-toolbox-mobile` ^2.14.3** (was ^2.14.0). Replace
11
+ `patches/@bsv+wallet-toolbox-mobile+2.14.0.patch` with this repo's
12
+ `patches/@bsv+wallet-toolbox-mobile+2.14.3.patch`; the old file does not
13
+ apply to 2.14.3. `patches/@bsv+sdk+2.8.2.patch` is unchanged.
14
+ - **`useWallet().logout` returns `Promise<boolean>`** (was `() => void`). It
15
+ resolves once teardown finishes (monitor stop, database purge, secret
16
+ erasure, cache sweeps), and to `false` if the secrets layer could not
17
+ confirm erasure (XR-107). Await it before treating Delete Wallet or sign-out
18
+ as complete, and before navigating or rebuilding.
19
+ - **Already breaking in 0.8.0** (see that section): `LocalStorageAdapter` and
20
+ its exports are removed; `configureToolbox` rejects a non-https,
21
+ non-local backup, Mandala or MessageBox origin (XR-064/XR-065); a host's own
22
+ `RestorePrompts` must implement `confirmReplace()`.
23
+ - **SQLite:** new nullable `transactions.noSendExpiry*` columns and
24
+ `token_settlements.relevantVout` are added in place on open. No host action,
25
+ unless external tooling reads the database file.
26
+
27
+ ### Vault v7: chain-published recovery, no salt at rest (INT-01/02/03/04/06/10, XQ-012, XR-005/006)
28
+
29
+ Closes the availability and exclusion gaps the external security review's
30
+ ledger tracked under these rows: a clean device (mnemonic + one enrolled
31
+ YubiKey + its PIN) could not locate or spend an existing Vault output
32
+ without the old SQLite database or an encrypted backup, and the only copy
33
+ of a v6 output's salt lived in plaintext in that same local
34
+ `customInstructions` — a stolen DB/export/device-backup, plus a stolen
35
+ committed key and its PIN, could spend without the mnemonic.
36
+
37
+ - **v7 recovery metadata** (`r1comb.ts`): the v6 shape minus `salt` — 8
38
+ exact fields, `v===7`, no legacy reinterpretation, structurally unable to
39
+ carry a salt at rest. `decodeVaultInstructions` is now the union decoder
40
+ (v6 ?? v7); the v6 decoder/encoder are unchanged and still the only path
41
+ for existing outputs. Salt derivation itself is unchanged (same
42
+ `createHmac`, same `[2,'vault salt']` domain, same serial framing) — for
43
+ v7 it is re-derived in memory whenever needed and never persisted.
44
+ - **On-chain marker + descriptor**: every v7 vault output is now followed by
45
+ two explicit outputs — a 1-sat P2PKH **marker**
46
+ (`wallet.getPublicKey([2,'vault marker'], keyID` `` `${chain}:${k}` ``
47
+ `, counterparty:'self')`, an ordinary indexer can answer) and a 0-sat
48
+ `OP_FALSE OP_RETURN 'r1c7' <ciphertext>` **descriptor** carrying the exact
49
+ v7 record, BRC-2 (AES-256-GCM) encrypted under
50
+ `[2,'vault descriptor']` at the same chain-scoped keyID. Neither goes in
51
+ any basket. `guard.ts`'s `VAULT_PROTOCOL_NAMES` reserves both new protocol
52
+ names in the same change that starts creating them, so a paired
53
+ non-admin BRC-100 caller can never derive a marker key or decrypt a
54
+ descriptor. `validateDepositPlan` and the re-lock/withdraw-remainder path
55
+ now pin all three outputs (vault, marker, descriptor) byte-exact, the
56
+ same discipline the vault output alone used to get; `estimateRelockFee`
57
+ reserves their byte cost too. Crash-recovery reconciliation
58
+ (`isValidHeldVaultDeposit`) recognizes the new 3-4-output shape so a v7
59
+ deposit interrupted mid-flight does not wedge every later vault
60
+ operation behind `action-pending`.
61
+ - **`core/services/vault/chainRecovery.ts`** (new): `recoverVaultFromChain`
62
+ scans for the marker at index `k=1,2,…`, and for every candidate
63
+ transaction it finds, locates the `[vault, marker, descriptor]` triple by
64
+ the marker's exact position, decrypts the descriptor, hard-requires its
65
+ claimed index and chain match the scan position, re-derives the salt,
66
+ rebuilds the lock byte-exactly and compares it to the real output,
67
+ requires it unspent, and internalizes it into the `admin vault` basket —
68
+ before finally calling the existing `recoverVaultMetaFromOutputs`
69
+ unchanged. A found-but-unusable record at one index is reported
70
+ distinctly and never stops the scan; an unconfirmed candidate is
71
+ reported as pending rather than thrown. The injected `VaultChainLookup`
72
+ interface keeps the module network-agnostic and unit-testable;
73
+ `wocChainLookup` is the production WhatsOnChain implementation. The
74
+ YubiKey is never needed to restore — only to spend afterward, through
75
+ the completely unchanged withdraw path.
76
+ - **UI**: VaultScreen's not-enrolled hero gains "Restore vault from the
77
+ blockchain", offered whenever a wallet identity exists and the vault is
78
+ available (never gated on YubiKey support). New i18n keys in all 12
79
+ languages; non-English copy is machine-drafted and awaits
80
+ native-speaker review, same as every previous translation batch in this
81
+ changelog.
82
+
83
+ **Residuals, disclosed rather than silently left open:**
84
+
85
+ - Existing v6 outputs are unaffected and still need the local DB or an
86
+ encrypted backup until they are re-locked (which converts them to v7).
87
+ No migration rewrites old rows, and this release adds no nudge to do so.
88
+ - Recovery claims **confirmed** deposits. `internalizeAction`'s own SPV
89
+ gate requires a BUMP or a present raw-input ancestor chain; assembling
90
+ arbitrary-depth unconfirmed ancestor BEEF was considered and rejected as
91
+ open-ended complexity for a narrow confirmation-window edge case, not
92
+ required by the availability guarantee's core promise (surviving loss of
93
+ a *settled* deposit). An unconfirmed candidate is surfaced as "pending
94
+ confirmation," never silently dropped.
95
+ - ARC/indexer acceptance of a transaction carrying a ~45 KB R1C lock plus a
96
+ 1-sat P2PKH plus a ~1.5 KB `OP_RETURN` in one broadcast has not been
97
+ verified against a live network in this change; likewise `wocChainLookup`'s
98
+ exact WhatsOnChain response-shape assumptions (history endpoint, spent-output
99
+ endpoint) were not exercised against the live API. Both need a network
100
+ smoke test before this is fully relied upon in production;
101
+ `recoverVaultFromChain`'s own scan/authentication logic does not depend
102
+ on either being exactly right and is unit-tested against an in-memory
103
+ chain double.
104
+ - A basketless marker output is not tracked by `guard.ts`'s vault
105
+ inventory. Read-only verification of the real `WalletPermissionsManager`
106
+ confirms a non-admin originator can name its outpoint in `createAction`
107
+ without any basket or protocol permission (spending it still requires a
108
+ signature from its key, which is reserved the same way the descriptor
109
+ key is) — financial exposure is 1 satoshi, and a stranger spending or
110
+ reserving it does not remove the marker transaction or its address's
111
+ history from any indexer, so it cannot defeat recovery. Accepted, not
112
+ fixed.
113
+ - The physical-hardware run (a real, previously-enrolled YubiKey signing
114
+ through the full chain-recovered-lock-to-withdraw path on a wiped
115
+ device) remains the standing hardware gate this repository already
116
+ treats as unrun for the Vault generally; it is proven here only with
117
+ `MockYubiKey`'s real P-256 math.
118
+
119
+ ### Payments and export: device report fixes (2026-09-25)
120
+
121
+ - **@bsv/wallet-toolbox-mobile 2.14.0 → 2.14.3.** 2.14.3 ships both toolbox
122
+ fixes below upstream (bsv-blockchain/ts-stack#638), so their patch-package
123
+ hunks are gone; the patch file is now
124
+ `patches/@bsv+wallet-toolbox-mobile+2.14.3.patch` and carries the earlier
125
+ hunks unchanged. Also in 2.14.1–2.14.3: `discoverByAttributes` re-filters
126
+ overlay results the way the overlay searched them. In 2.14.0 an `any`
127
+ search compared a certificate field literally named `any`, so ContactsScreen
128
+ network search and the Pay recipient search never showed a network result;
129
+ they now match whole words (stopwords ignored, no stemming), `userName`
130
+ exactly. The exact-spend amount moved from a symbol on the createAction
131
+ result to a shared WeakMap (no app code reads it).
132
+ - **Nearby payments failed with "generateChangeSdk error: required fee
133
+ error 23 !== 33"** (toolbox, fixed in 2.14.3). In 2.14.0,
134
+ `shapeSurplusChangeOutputs` split the change into outputs of exactly
135
+ `changeInitialSatoshis` — the basket's `minimumDesiredUTXOValue`, still the
136
+ legacy 32 in every wallet created before the bump — below the 40-sat dust
137
+ floor at 100 sat/kB. `removeDustOutputs` then stripped them without
138
+ returning the fee paid for their bytes, and the final check rejected the
139
+ plan. Split outputs are now floored at the dust floor. Hit most payments
140
+ funded from one coin with a small surplus, on every wallet-funded rail.
141
+ Regression: `__tests__/localpay/nearbyOneCoinChangeShaping.test.ts` (real
142
+ Wallet + StorageExpoSQLite; reproduces the exact error on 2.14.0).
143
+ - **"Cancel payment" refused with "The action reference was not issued by
144
+ this permissions manager"** (toolbox, owner-approved; fixed in 2.14.3).
145
+ `WalletPermissionsManager.abortAction` accepted only a reference still in
146
+ its in-memory map, which `signAction` and every restart empty, so a signed
147
+ noSend payment could never be cancelled, and `replayPendingAborts` could
148
+ never release one either. The wallet's own admin originator may now abort
149
+ any of its actions; every other originator keeps the issued-reference and
150
+ same-originator checks. The app's token-settlement and Vault abort guards
151
+ still run first. Regression:
152
+ `__tests__/context/permissionsManagerAdminAbort.test.ts`.
153
+ - **Cancel only while a payment never left the device**
154
+ (`detailActionKeys.ts`, `ActivityRow`): plain Cancel is offered only when
155
+ there is no offline record for the payment; a parked one keeps its
156
+ chain-checked cancel, and any recorded hand-over (queued, posting, sent,
157
+ acknowledged, rejected, import_hold) offers none, since the payee may hold
158
+ it.
159
+ - **"Request confirmation from recipient"** (`tx_action_request_confirmation`,
160
+ 12 languages): the transaction details menu re-delivers an outgoing
161
+ message-box, Nearby or token payment over the message box (the existing
162
+ `onSendPaymentDetails`, which also releases a parked payment on success).
163
+ - **Export Wallet Data hung on iOS** (`AlertCard`, `useExportWalletData`).
164
+ Since the unencrypted-export warning (XR-086), `showAlert` resolved on the
165
+ tap while the alert's native modal was still presented, so the share sheet
166
+ was presented on that modal and dismissed with it, and `shareAsync` never
167
+ settled. `showAlert` now resolves once the modal is dismissed (iOS
168
+ `onDismiss`; after the fade on Android; a fallback timer so a modal that
169
+ never presented cannot hold the queue), and the export spinner starts only
170
+ after the warning is confirmed.
171
+
172
+ ### Vault: replace a key by adding first; locks hold 2 to 5 keys (owner rule, 2026-09-25)
173
+
174
+ - **Remove needs three keys.** VaultScreen's key menu offers Remove only when
175
+ the vault has more than `VAULT_MIN_KEYS` active keys and no removal is
176
+ pending; before, it always offered Remove and refused afterwards. The
177
+ service and store refusals (`last-keys`) are unchanged.
178
+ - **A sixth key, never locked to.** New `VAULT_MAX_ACTIVE_KEYS` = 6
179
+ (`VaultKeyService.ts`, mirrored in `vaultStore.ts`): a full vault can add
180
+ the replacement key before removing the key it replaces, and one re-lock at
181
+ five covers both. `isVaultMeta`, `vaultStore.addKey` and `addVaultKey`
182
+ accept six; a seventh is still `too-many-keys`. `VAULT_MAX_KEYS` (5, the
183
+ R1C lock ceiling) is unchanged.
184
+ - **Nothing locks to six, or to one.** New `too-many-active-keys` error:
185
+ `newVaultOutput` (deposit, re-lock, partial-withdrawal remainder) and
186
+ `relockVault` (before its fee estimate) refuse unless the key list is 2..5.
187
+ A full withdrawal creates no Vault output and stays allowed.
188
+ - **Removing a key no output commits finishes at once** (`beginVaultKeyRemoval`):
189
+ it used to return `complete: false` whenever the vault held any output, so
190
+ removing a key added but not yet re-locked to (the add-then-remove flow)
191
+ opened a re-lock that could only fail with `vault-empty`. It now checks
192
+ whether any output commits that key; if none does, the removal completes
193
+ with no re-lock. A held deposit (which may still commit the key) makes
194
+ that case wait with `action-pending`, and an output committing the key
195
+ that appears between the two scans cancels the removal as before.
196
+ - **UI at six keys**: no Add; Deposit disabled with
197
+ `vault_err_too_many_active_keys`; a partial withdrawal is refused (before
198
+ any card tap) only when its remainder would go back into the vault, so a
199
+ remainder under the floor still offers withdrawing everything; the
200
+ coverage badge does not open a re-lock; the header drops "of 5" (`vault_key_section_over_limit`); after
201
+ adding the sixth, no automatic re-lock sheet, and the wizard's done step
202
+ says to remove the replaced key (`vault_add_key_done_over_limit`, button
203
+ "Done"). Three new strings in 12 languages.
204
+
205
+ ### Vault: key removal finishes on network acceptance (physical-device report, 2026-09-25)
206
+
207
+ - **Finalize on acceptance** (`transfers.ts`, owner decision): a key removal
208
+ used to stay pending — deposits and withdrawals blocked, the removed key
209
+ listed as "re-lock to finish" — until its re-lock was mined and proven
210
+ (`completed`). `finalizeVaultKeyRemoval` now clears the tombstone once the
211
+ re-lock is accepted by the network (`unproven`: ARC returned an accepted
212
+ status). New `ACCEPTED_ACTION_STATUSES` = `unproven`, `completed`; any
213
+ other Vault action status (`sending` included) still blocks, and a failed
214
+ withdrawal or re-lock still blocks. Should an accepted re-lock still be
215
+ dropped, its sources return as outputs committed to a key the vault no
216
+ longer lists, and the removed-key badge offers the re-lock again.
217
+ - **Untagged broadcast write** (`transfers.ts`): `relockVault` marked a
218
+ removal's tombstone `broadcast` without re-tagging the meta. The tag
219
+ covers `pendingRemoval.state`, so the stored meta stopped verifying and
220
+ every later check fell back to a full chain re-authentication (failing
221
+ closed whenever that scan could not see the re-lock output). It is now
222
+ tagged like every other meta write.
223
+ - **VaultScreen / VaultTransferScreen**: a removal whose re-lock is broadcast
224
+ but not yet accepted said "Re-lock the vault first", and the removed key's
225
+ row opened a second re-lock sheet (which would have been refused as
226
+ `vault-empty`, since no output still commits that key). The screens now
227
+ say the re-lock was sent and deposits and withdrawals open again once the
228
+ network accepts it (`vault_removal_awaiting_network`,
229
+ `vault_key_removal_awaiting_network`, 12 languages); the row is inert in
230
+ that state. The screen re-runs `finalizeVaultKeyRemoval` every 30 s and on
231
+ return to the foreground while it waits. Withdraw is drawn disabled when
232
+ it is.
233
+
234
+ ### Vault: forged-state, session, and chain-recovery hardening (external security review)
235
+
236
+ - **Enrollment and meta forgery (XR-001, XR-002).** A `ready` enrollment draft
237
+ and the local `VaultMeta` record were previously trusted by shape alone — a
238
+ SecureStore-only attacker (no YubiKey, no wallet root) could inject a forged
239
+ draft, or inflate `VaultMeta`'s revision and key set, and have it committed
240
+ as spend authority with zero possession or hardware check.
241
+ `enrollKey`/`resumeEnrollmentDraft` now tag a `ready` draft with a wallet-
242
+ root HMAC the instant they write it (`computeVaultDraftAuthorityTag`, reusing
243
+ the `vault meta` protocol namespace `guard.ts` reserves), and
244
+ `requireReadyEnrollmentDrafts` verifies that tag before trusting a draft as
245
+ authority. Every meta-writing path (create, add/remove key, rename, restore)
246
+ now tags the record with a wallet-root HMAC over the fields that confer spend
247
+ authority, and `requireAuthenticatedMeta` re-derives the true key set from
248
+ chain history whenever a tag is missing or invalid before any deposit, re-
249
+ lock, or re-vaulted withdrawal remainder proceeds. `addVaultKey` additionally
250
+ re-verifies an existing meta's own tag before appending to it, closing a
251
+ laundering path where a forged meta could gain a valid tag merely because the
252
+ legitimate user's next action happened to add a key. Separately,
253
+ `EnrollWizard`'s add-key mode no longer auto-commits the first `ready` draft
254
+ it finds on mount — it now requires an explicit, named confirmation (new keys
255
+ `vault_resume_draft_confirm_title`/`_body`/`_use`/`_discard`) before use, and
256
+ discards a declined draft.
257
+ - **Backup-attestation gate before enroll/deposit (XR-003).** Creating a wallet
258
+ from the Vault entry point used to route straight to enrollment or deposit
259
+ with no requirement that the auto-generated mnemonic was ever written down.
260
+ `VaultScreen` and `VaultTransferScreen` now block deposit and enrollment
261
+ behind `requireBackupAttested()`, routing to the existing backup ceremony
262
+ first whenever the current identity has no attestation record. New keys
263
+ `vault_seed_not_preserved_title`/`_body`/`_cta`.
264
+ - **Superseded hardware session (XR-004).** `hardwareLease.ts` now tracks a
265
+ monotonic generation; `enrollKey` and `resetPivApplication` — the only
266
+ `withKeySession` callers that mutate vault state from inside the session
267
+ closure — check a `VaultSessionGuard` before writing, so a stalled native
268
+ call that eventually resumes after a retry has already taken over the lease
269
+ can no longer race a mutation in behind it. The existing "an abandoned call
270
+ frees the lease for a retry" availability behavior is unchanged.
271
+ - **Slot-replacement and reset guards (XR-008, XQ-014).** Replacing an occupied
272
+ Vault slot now also checks `vaultStore.enrolledSerialsAcrossChains` and
273
+ `meta.pendingRemoval`, not just the current chain's key list, so an explicit
274
+ slot-replacement consent can no longer erase a signer still live under
275
+ another chain or mid-removal — mirroring the guard `pivReset` already
276
+ applied. A new device-wide, non-secret `enrolledSerialRegistry.ts` (bare
277
+ serials only, never pubkeys or keys) closes `pivReset`'s remaining cross-
278
+ identity blind spot: a serial recorded as enrolled anywhere on the device —
279
+ even under a different wallet identity SecureStore can't enumerate — now
280
+ refuses a PIV reset unconditionally, with no override. The reset-consent copy
281
+ that overclaimed "no vault on this device claims" this key is corrected to
282
+ disclose the actual uncertainty instead.
283
+ - **Held signed withdraw/relock reconciliation (XR-006/INT-03).** The existing
284
+ "Finish the interrupted deposit" recovery (0.8.0) only recognized a held
285
+ deposit shape; a crash between `signAction` and `sendWith` on a withdrawal or
286
+ re-lock instead froze every later Vault operation with no vault-specific way
287
+ to clear it, and the resolve button treated any non-`'failed'` result —
288
+ including "nothing held" — as success. `resolveHeldVaultDeposit` now also
289
+ recognizes a held, signed vault-withdraw/vault-relock action and resends the
290
+ exact already-signed bytes (never a new transaction, never `abortAction`);
291
+ `VaultScreen` now surfaces "nothing held" as its own message rather than a
292
+ false success toast. New key `vault_resolve_held_deposit_none`.
293
+ - **Reload reconciles on every mount, not only an empty cache
294
+ (INT-07/XR-007).** `VaultScreen.reload()` previously called the chain-
295
+ authenticated `recoverVaultMetaFromOutputs` only when no local record existed
296
+ at all, so a stale-but-present cached record (e.g. surviving a reinstall)
297
+ could permanently wedge every later Vault action. It now always reconciles,
298
+ relying on the existing revision/key-set ratchet to keep the cache whenever
299
+ the scan doesn't supersede it, and falls back to the last-read cache (rather
300
+ than a hard error) when the scan itself fails or is offline.
301
+ - **`hasVaultMeta` race on cold start (INT-08).** `VaultContext` recomputed its
302
+ device-local `hasVaultMeta` flag only on ceremony-phase transitions, which on
303
+ a cold start settled to `false` before `WalletContext`'s async wallet-build
304
+ chain ever configured the vault scope — hiding an already-funded vault from
305
+ Home/Settings for the rest of the session. `vaultStore` gains an
306
+ `onScopeChange` subscription so the check re-fires the moment the scope
307
+ actually configures, not only at mount.
308
+ - **Chain-recovery integrity (Availability review; INT-01/INT-06/XQ-012).**
309
+ `wocChainLookup`'s output-status check previously failed open — any response
310
+ shape it didn't recognize, including a schema mismatch, was read as "unspent"
311
+ rather than "unknown," and "unknown" is the one answer
312
+ `recoverVaultFromChain` must never treat as spendable; it now requires an
313
+ explicit `spentTxId: null` before reporting unspent. Its address-history
314
+ lookup likewise silently mapped a rate limit, a 5xx, or a thrown exception to
315
+ an empty "no marker here" result, which could stop a scan short of a real,
316
+ higher-index deposit; it now throws on any non-2xx response or exception so
317
+ the scan's own problem-reporting (not a silent miss) handles it. The scan
318
+ loop itself had no bound on consecutive lookup/derivation failures — a
319
+ reproducible livelock, confirmed by a hung 2+ minute run against the unfixed
320
+ code — and is now bounded by `VAULT_RECOVERY_MAX_CONSECUTIVE_PROBLEMS`, with
321
+ a second cap (`VAULT_RECOVERY_MAX_CANDIDATES_PER_INDEX`) limiting how many
322
+ candidate transactions per index one scan will inspect (a marker address's
323
+ history is public, so a stranger could otherwise force unbounded decrypt-and-
324
+ discard work by dusting it). The bounded-scan abort now throws a
325
+ `VaultError('chain-scan-failed', ...)` with translated copy in every locale,
326
+ instead of a plain `Error` that fell through to generic fallback text. The
327
+ lookup's base58check encoding now uses `@bsv/sdk`'s own public
328
+ `Utils.toBase58Check` instead of an unaudited hand-rolled implementation.
329
+ - **RPC-boundary hardening (XR-019, XR-020, XR-102).** A non-admin (paired)
330
+ caller's `listOutputs` had no bound at all in `guardVaultAccess`; it is now
331
+ capped at 200 rows (25 when `includeTransactions` is set, since each such row
332
+ carries a full BEEF) and an existing offset ceiling, refused before the call
333
+ reaches the underlying wallet — a host whose connected app calls
334
+ `listOutputs` with a larger limit now gets `VaultAccessDenied` instead of a
335
+ large response. The address-rail, PeerPay, and Mandala/FT protocol namespaces
336
+ were never reserved the way Vault's own namespaces are, so a paired origin
337
+ could call the allowlisted `createSignature`/`getPublicKey` RPC methods
338
+ directly against them and receive a spend-ready signature for those rails
339
+ with no prompt at all; they are now denied the same way. A forged
340
+ `pending_aborts` entry naming the public `ADMIN_ORIGINATOR` could ride the
341
+ admin bypass straight past the vault-inventory check on replay; `guard.ts`
342
+ now opts a replayed admin abort into the same inventory check a non-admin
343
+ caller gets (`VAULT_ABORT_REPLAY_MARKER`), leaving a live interactive admin
344
+ abort unaffected.
345
+ - **Proof bar.** Six standing regression proofs now run as a single suite:
346
+ script acceptance for N=1..5 with an independent P-256 check, the CRT-forgery
347
+ harness, a clean-device I1 recovery proof, the I2 exclusion matrix (mnemonic-
348
+ only, stolen-DB-and-key, wrong PIN, unenrolled key, DB-without-mnemonic,
349
+ external caller), an I3 rail-isolation proof against every rail with a real
350
+ wallet/storage, and a no-production-mock proof that the mock YubiKey driver
351
+ is unreachable outside `__DEV__` at the runtime, source, build-profile, and
352
+ UI layers. `scripts/run-proof-bar.cjs` runs all six in order and prints a
353
+ pass/fail summary.
354
+ - **Production build gate.** `EXPO_PUBLIC_VAULT_ENABLED` is off again in the
355
+ production EAS build profile — Vault output creation stays disabled in
356
+ production until a v7 lock has actually been broadcast/mined and run once
357
+ against a physical YubiKey; development and dev-physical profiles keep it on.
358
+ An already-funded vault is not stranded by this: the entry point stays
359
+ visible whenever local Vault meta exists, and a full withdrawal is not gated
360
+ by the flag — only new deposits, re-locks, and withdrawal remainders are.
361
+
362
+ - **A held Vault transaction is never reported resolved on a bare status
363
+ claim (NEW-07).** `resolveHeldVaultDeposit` used to skip releasing a held,
364
+ already-signed Vault transaction when a chain service answered 'mined' or
365
+ 'known', so a wrong or malicious service made the app report success while
366
+ the signed bytes were never broadcast. It now always releases the wallet's
367
+ own signed bytes through the existing `sendWith` path and derives success
368
+ (and the broadcast vs already-known distinction) only from the toolbox's
369
+ confirmed release result.
370
+
371
+ ### Secrets and biometrics
372
+
373
+ - **Delete Wallet now actually erases everything, and fails closed if it can't
374
+ verify that (XQ-008, XR-107).** "Delete Wallet" closed the SQLite connection
375
+ but never deleted the underlying `.db` file(s) or the `walletDbRegistry`
376
+ entry — rebuilding with the same mnemonic silently reattached the "deleted"
377
+ wallet's full local history. `logout()` now purges every registered filename
378
+ for the identity/chain via `walletDbRegistry.purgeRegisteredDbFiles`, and
379
+ also sweeps the legacy plaintext secrets namespace
380
+ (mnemonic/recoveredKey/password) that lived outside the envelope scheme. Both
381
+ the legacy sweep's and the envelope KEK's deletions are now verified rather
382
+ than trusted blind: `deleteAllSecrets()`/`logout()`/`WalletConfigScreen` all
383
+ propagate a real success/failure result end to end, and a failed erasure now
384
+ shows a dedicated alert (new keys
385
+ `delete_wallet_failed_title`/`delete_wallet_failed_body`) and leaves the row
386
+ enabled for retry instead of reporting a clean deletion that didn't happen.
387
+ - **KEK provisioning can no longer be silently downgraded or hijacked (XR-108,
388
+ XR-109, XR-111, XR-116).** A self-consistent but forged `{policy:'degraded',
389
+ kekId}` sentinel could previously ride the app's own automatic degraded-to-
390
+ biometric upgrade and silently overwrite the real biometric KEK with an
391
+ attacker's key; `upgradeToBiometric()` now reads the existing authenticated
392
+ KEK first and refuses the upgrade outright if one is already there, and
393
+ `doUnlock()` no longer treats a failed/refused mandatory upgrade as a
394
+ successful unlock. A parseable-but-wrong-shape sentinel (a truncated write, a
395
+ future/rolled-back version) used to read as "no wallet ever provisioned" and
396
+ trigger a full KEK re-provision that orphans any other already-sealed secret;
397
+ it's now treated as corrupt, not absent. `destroyKek()` and the migration's
398
+ final legacy sweep now read back and retry a delete before reporting success,
399
+ rather than trusting an unauthenticated SecureStore delete that iOS silently
400
+ no-ops; `upgradeToBiometric()`'s own delete-then-trust step gets the same
401
+ read-back-and-refuse-on-survival treatment.
402
+ - **Legacy plaintext can no longer be served after a failed migration
403
+ (XR-112).** A cancelled or failed biometric-provisioning ceremony during
404
+ legacy-secret migration used to fall through to reading the raw,
405
+ unauthenticated pre-envelope mnemonic/recoveredKey directly — a fully
406
+ signing-capable wallet built from one declined OS prompt, no cryptographic
407
+ control involved. The migration-failure branch no longer special-cases a
408
+ plaintext read; a failed migration now correctly reports no secret at all and
409
+ retries on the next launch.
410
+ - **Custom ARC API token moved off plaintext storage (XR-106).** The optional
411
+ custom ARC endpoint's bearer token — sent on every broadcast to that endpoint
412
+ — was persisted in plain `AsyncStorage` and shown unmasked. It now lives in
413
+ the platform SecureStore (`core/services/arcTokenStorage.ts`), with a one-
414
+ time migration of any existing plaintext value; `WalletConfigScreen`'s token
415
+ field is now `secureTextEntry`.
416
+ - **Degraded (non-biometric) KEK provisioning is now disclosed (XR-114).** A
417
+ release device with no strong biometrics enrolled got an unauthenticated KEK
418
+ with the same "Protect your assets with Face ID or your fingerprint" promise
419
+ as a fully protected device. `BiometricAdvisoryModal` takes a `degraded` prop
420
+ that swaps in an honest disclosure (new key
421
+ `biometric_advisory_body_degraded`); `resolveProvisioningPolicy` is now re-
422
+ exported from the package root so a host screen can check it without a new
423
+ context method.
424
+ - Documented, not code-fixed: `kek.ts`'s delete-then-add rotation comment
425
+ overclaimed a guarantee that does not hold on Android — `deleteItemImpl`
426
+ there never calls `keyStore.deleteEntry`, so a rotation cycle silently reuses
427
+ the existing hardware key (XQ-013). Not exploitable on its own (the KEK value
428
+ is still fresh-random and still biometric-gated); fixing it needs a native-
429
+ module patch, recorded as an open assurance gap rather than fixed here.
430
+
431
+ ### Pairing and paired RPC
432
+
433
+ - **Superseded sockets are actually torn down (XR-018).**
434
+ `connect()`/`reconnect()` used to overwrite the live socket reference without
435
+ closing or detaching the one it replaced, so approving a second pairing (or
436
+ reconnecting a saved session) while one was already live left the first
437
+ socket's `onmessage` closure — still holding a valid `WalletClient`, topic,
438
+ and identity — decrypting and dispatching RPC for as long as the relay kept
439
+ it open. A `connectionGenerationRef` now gates every handler (`onopen`,
440
+ `onmessage`, `onerror`, `onclose`) so a superseded socket's already-in-flight
441
+ decrypt can no longer reach `handleRpc`. Disconnect and logout now actually
442
+ tear down the live paired socket too: `WalletConnectionContext` exports
443
+ `disconnectActivePairedSession()` so `WalletContext.logout()` (a React
444
+ ancestor of the connection provider) can call it directly, and
445
+ `ConnectionsScreen`'s Disconnect action calls the context's `disconnect()`
446
+ first rather than only flipping stored status and sending a best-effort
447
+ revoke message a non-cooperative peer can ignore.
448
+ - **Replay-watermark durability (XR-021).** The anti-replay sequence watermark
449
+ advanced in memory immediately before dispatching a mutating RPC call, with
450
+ its only durable write a fire-and-forget one in `disconnect()`/`onclose` — a
451
+ crash in between let a retained relay message be replayed and re-executed on
452
+ reconnect. The accepted sequence is now durably written and awaited before
453
+ dispatch, with the message dropped (never dispatched) if that write itself
454
+ fails; a follow-up serializes the check-write-advance sequence per connection
455
+ so two concurrent messages can't each pass a stale check and land their
456
+ durable writes out of order.
457
+ - **Origin display matches what gets approved (XR-023).** `PairScreen`'s
458
+ approval card used to render the raw, uncanonicalized origin with default
459
+ tail-truncation, so a long attacker-signed origin could show a trustworthy
460
+ prefix while clipping the real registrable-domain suffix — and
461
+ canonicalization only ran after the user had already looked and pressed
462
+ Approve. The card now canonicalizes on mount (showing the error state instead
463
+ of Approve/Reject if that fails) and truncates from the middle, so the domain
464
+ suffix always survives.
465
+ - **Private-network destinations refused (XR-024).** Neither the pairing origin
466
+ parser nor the relay-URL validator checked what class of address a hostname
467
+ named — a self-signed pairing payload could point straight at a
468
+ loopback/RFC1918/link-local/`.internal` address with no DNS trickery needed.
469
+ Both now refuse via a shared `isPrivateNetworkHost` check (a floor, not a
470
+ firewall — a public hostname that only resolves to a private address via DNS
471
+ rebinding is not caught).
472
+ - **Bounded relay discovery reads (XR-025).** A length-less, non-streaming
473
+ relay response could be buffered in full before its size was ever checked;
474
+ that one specific shape (no `Content-Length`, no stream reader) now fails
475
+ closed instead.
476
+ - **Aggregate RPC byte budget and a crypto-call size cap (XR-026).**
477
+ `MAX_IN_FLIGHT_RPC` only bounded message count — several concurrently in-
478
+ flight messages could each be near the 5 MiB per-message ceiling, multiplying
479
+ peak memory. Concurrent messages on one connection now also share a
480
+ `MAX_IN_FLIGHT_RPC_BYTES` budget equal to the existing single-message
481
+ ceiling. Separately, `encrypt`/`decrypt`/`createHmac`/`verifyHmac`/`createSig
482
+ nature`/`verifySignature` had no per-call size cap at all beyond the
483
+ transport ceiling; they now share a 1 MiB `cryptoPayload` ceiling (halved on
484
+ low-tier devices). A connected app sending an oversized crypto-call payload,
485
+ or enough concurrent large messages to cross the shared budget, now has the
486
+ call/message dropped or refused where it previously went through.
487
+ - **Saved-connection authenticity (XR-027).** A saved pairing record was plain,
488
+ unauthenticated `AsyncStorage` JSON, checked only against the wallet's own
489
+ public identity key on reconnect — insufficient to prove the record wasn't
490
+ substituted. Approval now stages a wallet-root HMAC over the connection tuple
491
+ (`connection authority` protocol namespace) that `add()` attaches to the
492
+ record; reconnect verifies it and treats a missing/failed tag as "needs re-
493
+ approval" (new key `reconnect_needs_reapproval`) rather than silently
494
+ trusting it. A companion, more limited hardening requires an explicit
495
+ confirmation naming the canonicalized origin before any reconnect at all (new
496
+ keys `reconnect_confirm_title`/`reconnect_confirm_message`) — full binding
497
+ would need an admin-scoped wallet threaded into `connect()`/`reconnect()`,
498
+ left as a larger follow-up.
499
+ - **Auto-approve authority disclosed at pairing time (XR-028).** Approving a
500
+ pairing silently grants that origin standing auto-spend authority (up to the
501
+ persisted per-request threshold and the shared rolling 24h cap added in
502
+ 0.8.0). The approval card now names both before Approve is tapped; the
503
+ underlying policy itself (a non-zero default threshold, and a cap shared
504
+ across all origins rather than per-origin) is unchanged and still flagged as
505
+ provisional pending product sign-off.
506
+
507
+ ### Backup and restore
508
+
509
+ - **Wallet Check no longer reads a different identity's backup cursor as this
510
+ wallet's own (XR-009).** `getBackupUploadState()` filtered by a bare,
511
+ unscoped key prefix, so a same-device wallet swap (logout, then a new
512
+ identity on the same install) could report the new wallet "backed up" using
513
+ the old one's leftover cursor. It now takes `(chain, pseudonym)` and filters
514
+ by the fully-scoped key; `logout()` sweeps `backupCursor-*` alongside the
515
+ existing balance-cache sweep; `WalletContext` exposes a new
516
+ `getBackupPseudonym(chain)` getter so the UI never needs the primary key
517
+ itself.
518
+ - **LocalPay and PeerPay in-flight state now survives encrypted backup (XR-011,
519
+ XR-012, XR-055).** `key_value_store` — and so a receiver's acknowledged-but-
520
+ not-yet-internalized Nearby/QR payment, an outbound PeerPay delivery
521
+ checkpoint, and every issued conventional-receive-address date — was entirely
522
+ outside the twelve toolbox-table `CHUNK_ENTITIES` the backup codec knew
523
+ about; a device loss before internalize/delivery completed could permanently
524
+ strand real money even with a perfect seed-plus-backup restore of everything
525
+ else. A new additive `appData` field on the existing per-chunk envelope
526
+ (dropped by any reader that predates it, so mixed builds keep working) now
527
+ carries `localpay_pending`, `peerpay_outbox`, and a new durable, count-capped
528
+ issued-receive-date history (`core/pay/receiveHistory.ts`) through push,
529
+ restore, and cross-device merge, applied through the same `setKeyValue` path
530
+ — never `internalizeAction`, broadcast, or abort — so a replayed row is
531
+ picked up by this device's own existing consumers exactly as if it had
532
+ written it itself. `WalletCheckScreen`'s repair loop now scans every recorded
533
+ issued-receive date instead of a fixed 30-day window, and the manual receive-
534
+ screen stepper widens to roughly ten years. Disclosed, not fixed: an
535
+ `appData`-only chunk can still never be sent alone (the toolbox's own sync
536
+ protocol treats an all-empty chunk as end-of-log), so isolated
537
+ LocalPay/PeerPay/receive-address activity in a window with no other wallet-
538
+ entity change can still miss a push — pinned end-to-end by a new test and
539
+ documented at each call site; `offline_actions` and `token_linkage_payloads`
540
+ remain out of scope for this pass.
541
+ - **Restore-side resource bounds (XR-013).** Neither the remote sync index
542
+ (`RemoteSyncReader.ensureIndex()`) nor the restore-side body reader had any
543
+ cap beyond a server-supplied page-size hint and a time deadline. A
544
+ `MAX_INDEX_ENTRIES` ceiling (50,000) and a `MAX_RESTORE_RESPONSE_BYTES` check
545
+ against `Content-Length` (checked before any body reader is invoked) now
546
+ bound both — partial, since a response that omits `Content-Length` entirely
547
+ still can't be bounded on this platform's `fetch`.
548
+ - **A restored chunk must match its own index entry (XR-014).**
549
+ `RemoteSyncReader.fetchAndDecode()` decrypted whatever bytes were returned
550
+ for a sequence without checking them against that sequence's own indexed
551
+ size/hash, so a malicious or compromised backup host could serve one
552
+ sequence's genuinely-authentic ciphertext back under a different sequence
553
+ number. Restore now rejects a length/sha256 mismatch. Documented as not a
554
+ full fix: the envelope still doesn't bind device/generation/sequence into
555
+ what it authenticates, and there's no persisted rollback checkpoint — both
556
+ need a broader format change.
557
+ - **Every device in a multi-device manifest is now replayed on import
558
+ (XR-015).** `restoreOnImport` used to replay only the single highest-ranked
559
+ device's log; each device's log is an independent, non-overlapping history,
560
+ so a second device's unique records (a change output, a BRC-29 receipt) could
561
+ be permanently unreplayed after restore. It now replays every device present
562
+ in the manifest into the same storage, merging by record identity exactly as
563
+ ordinary live multi-device sync already does.
564
+ - **Clock-rollback recovery (XR-016).** An incremental push window only ever
565
+ advances forward; a device clock moving backward could permanently orphan a
566
+ record stamped below an already-closed window. `PushCursor` now tracks the
567
+ highest wall-clock time ever observed and forces a full-snapshot rotation
568
+ whenever the current time falls behind it.
569
+ - Locked, not changed: Android's `expo.android.allowBackup: false` (shipped in
570
+ 0.8.0) now has a regression test guarding it (XQ-005); the iOS backup-
571
+ exclusion question and the malformed-but-SQLite-magic-passing import question
572
+ remain open, needing a real device build to exercise.
573
+
574
+ ### Mandala tokens
575
+
576
+ - **Legacy settlement rows can no longer hide from the abort guard (XR-033).**
577
+ `token_settlements.reference` shipped later than the table itself, added by a
578
+ bare nullable `ALTER` with no backfill — every pre-migration row reads
579
+ `reference: undefined` forever, making it invisible to the abort guard's
580
+ lookup regardless of which action is later aborted. The same migration step
581
+ now backfills a blocked legacy row's reference from the `transactions` table
582
+ (the same mapping `abortAction` itself matches against); anything the
583
+ backfill can't resolve is covered by a coarser
584
+ `hasUnresolvedLegacyBlockedRows()` check that refuses every abort while any
585
+ such row exists, rather than risk releasing inputs a legacy row still has a
586
+ claim on.
587
+ - **Token-abort guard fails closed (XR-034, XR-035).** A settlement-lookup
588
+ fault or a not-yet-built runtime previously read as "no blocking row, abort
589
+ is safe" — a transient DB error is not evidence a payment is safe to release.
590
+ The guard now distinguishes "no Mandala endpoints configured for this chain"
591
+ (provably no token action) from "the runtime hasn't built yet" or "a lookup
592
+ faulted" (real rows may be unreadable), refusing in the latter two cases. The
593
+ handle rail's settlement-journal write after a hand-over — the only durable
594
+ evidence a transfer happened — is now retried on a transient fault
595
+ (`upsertSettlementDurably`) rather than best-effort, closing the same root
596
+ cause XR-035's regression test locks. `abortPeerPayNosend` also now checks
597
+ its own `abortAction` result instead of assuming success.
598
+ - **Token-bearing offline holds aren't drainable until their journal lands
599
+ (XR-036).** A token payment's offline-queue row used to go straight to
600
+ `'queued'` (drainable) before its settlement journal write was confirmed; a
601
+ process kill or transient write fault in that window let the automatic drain
602
+ post a token transaction the overlay never admitted.
603
+ `holdSentPaymentOffline`, `parkSentPaymentOffline`, and
604
+ `releaseParkedPayment` now keep a token-bearing row at `'parked'` until the
605
+ journal write is confirmed.
606
+ - **Cached admissions are scoped to the vout that actually needs them
607
+ (XR-038).** A genuine, verified admission for any output of a multi-output
608
+ token transaction previously stood in for the whole transaction's submission
609
+ — a payer's own admitted change output could carry an unrelated, never-
610
+ admitted output along with it. Admission caching now requires every vout the
611
+ current walk actually needs to be inside the admission's own
612
+ `outputsToAdmit`, backed by a new `TokenSettlementRow.relevantVout` column
613
+ and the existing (previously unused) parent-vout edge data.
614
+ - **Fail closed on an unreliable token-input classification (XR-039).** A
615
+ `listTokenOutpoints()` failure used to forward a `createAction` unchanged
616
+ instead of forcing Mandala's own consent review — a transient listing fault
617
+ or a basket over 10,000 outputs silently skipped the one thing that routes a
618
+ token spend's inputs to a token-aware review. It now forces the Mandala label
619
+ on any listing failure, and the listing itself paginates to completion
620
+ instead of reading one capped page.
621
+ - **Every asset of a multi-asset approval is now shown (XR-040).**
622
+ `PermissionSheet` rendered only the primary asset/amount fields of what could
623
+ be a multi-asset `createAction`/`internalizeAction` — a connected app could
624
+ place an innocuous asset first and an unshown transfer right behind it in the
625
+ same approval. Every line is now rendered (numbered when more than one), and
626
+ a malformed or oversized `lines` payload now blocks approval outright instead
627
+ of falling back to the old primary-only view.
628
+ - **Relinquish consent now names what's being removed (XR-041).** "Wants to
629
+ remove a Mandala token holding" named no asset, amount, or outpoint. The
630
+ prompt now resolves the target against this device's own current basket
631
+ listing (never the caller's claim) and names asset, amount, and outpoint —
632
+ refusing the whole call if it can't be conclusively resolved.
633
+ - **A verified admission can't be undone by a later unsigned refusal
634
+ (XR-042).** An overlay's positive verdicts are signature-verified; its
635
+ negative (`refused`/`evicted`) verdicts are raw, unauthenticated HTTP — but
636
+ both were fed to settlement state unconditionally. A row already carrying a
637
+ verified admission for a txid is now left alone (or treated as a stall)
638
+ rather than downgraded by a later unsigned refusal.
639
+ - **Token decimals bounded everywhere one is read (XR-043).** An extreme
640
+ `decimals` value from a session QR or a registry entry had no upper bound;
641
+ `formatTokenAmount(500, Number.MAX_SAFE_INTEGER)` reliably threw `RangeError:
642
+ Invalid string length`, and the crash re-triggered on every later render
643
+ since the metadata persists. Decode, registry resolution, formatting/parsing,
644
+ and the input mask now all clamp or reject outside `[0, 18]` — a host calling
645
+ `formatTokenAmount`/`parseTokenAmount` directly with an out-of-range value
646
+ now gets `null` back instead of a thrown exception.
647
+ - **Issuer and asset fingerprint shown before send (XR-044).** Two assets
648
+ sharing a ticker (a look-alike distributed by a malicious issuer) were
649
+ visually indistinguishable through the whole select-to-send flow. The asset
650
+ switcher, asset picker, and the Send review step now all show `issuerName ·
651
+ fingerprint` alongside the ticker.
652
+ - **Real token actions now reach the consent gate (XR-037).** Two different
653
+ constants both named `MANDALA_ACTION_LABEL` — one for home-screen
654
+ recognition, one for the P-routed `listActions` consent gate — and only the
655
+ former was ever applied to a nearby build or a handle-rail credit, so a real
656
+ Mandala action's metadata (txid, satoshis, description) was visible to a
657
+ paired caller's `listActions` with no consent prompt of any kind. Both labels
658
+ are now applied at every write site; `guard.ts`'s external-facing
659
+ `sanitizeAction` also now strips `customInstructions` directly as defense in
660
+ depth, rather than relying solely on a vendored patch doing it one layer
661
+ down.
662
+ - **Token conservation enforced before crediting a nearby tip (XR-099).**
663
+ `verifyFramePayment`'s token branch checked ownership, asset, and ancestry-
664
+ admission, but never that token input value covers token output value —
665
+ Mandala's own COVER walk has no notion of amount at all. A payer could spend
666
+ a small admitted coin into an output naming any larger amount and have it
667
+ credited. A new `tokenConservationHolds` check sums the tip's own direct
668
+ token inputs against its outputs for the frame's asset and refuses
669
+ (`not_covered`) if they don't cover it.
670
+ - A held withdraw/relock now resolves cleanly for tokens too, and
671
+ `wrapAbortActionForSettlements`/`processAction` fail the whole batch closed
672
+ rather than report an indeterminate held/not-held classification when
673
+ `token_settlements` can't be read for a broadcast decision (XR-045) — see
674
+ Wallet repair, proofs, headers, and broadcast below for the shared broadcast-
675
+ guard change.
676
+
677
+ ### Nearby / LocalPay
678
+
679
+ - **Pending-abort queue integrity and authenticated replay (XR-088, XR-102).**
680
+ A read/parse failure against the local pending-abort queue collapsed to
681
+ "empty," so the next queue write silently erased every other durable, not-
682
+ yet-replayed abort reference; a fault now refuses the write instead of
683
+ overwriting. Every queued abort reference is now HMAC-tagged at write time
684
+ (`pending abort authority` protocol namespace) and re-verified before replay
685
+ — a forged or untagged `pending_aborts` KV entry naming a live action
686
+ reference is now dropped rather than replayed, surfaced to the user via a new
687
+ notice (keys `local_pay_pending_abort_dropped_title`/`_body`) pointing at
688
+ Activity's manual per-row cancel.
689
+ - **Bounded inbound frame/ack decode (XR-090).** The shared base64-decode-then-
690
+ AES-GCM-decrypt-then-parse layer every transport (AWDL, Nearby, BLE) funnels
691
+ through had no size ceiling of its own. It now rejects an oversized encoded
692
+ or decoded payload before `atob()`/decrypt/parse ever runs (reusing
693
+ `@bsv/air-gap`'s existing 64 KiB frame ceiling; a much smaller ceiling for
694
+ acks); the Android Nearby native receive path is mirrored for the same gap
695
+ but is unverified without a device build.
696
+ - **Never trust the payee's QR ticker/decimals for a real, unresolved holding
697
+ (XR-091).** A local ticker-resolution failure for a real, spendable holding
698
+ used to fall back to the payee's own unauthenticated session ticker/decimals.
699
+ It now fails closed to an "asset unidentified" state that disables Send,
700
+ rather than adopting the QR's claim — a brand-new, never-before-seen offline
701
+ asset (no local holding at all) is unaffected, since it has no known figure
702
+ to override.
703
+ - **A malformed pending queue is quarantined, not read as empty (XR-092).** Any
704
+ syntactically valid non-array JSON under the LocalPay pending key used to
705
+ silently become an empty queue — and the very next save then destructively
706
+ overwrote whatever it actually held. It now takes the same quarantine-and-
707
+ notify path a JSON parse failure already does.
708
+ - **Settlement-ack verification is bound to the payee's own output (XR-093).**
709
+ A verified admission for a sibling output on the same transaction (e.g. the
710
+ payer's own change) previously counted as proof of the payee's own
711
+ settlement. Verification now requires a matching output index too.
712
+ - **Two remaining unconditional-release paths on a decline are closed (XR-095,
713
+ XR-103).** WalletHomeScreen's generic Activity "Abort" action could release a
714
+ parked nearby payment's inputs with no chain-status check, bypassing the
715
+ dedicated cancel-parked flow's gate; it now respects the same `!parked` guard
716
+ the row's own action chip already applied. A decline whose chain status is
717
+ genuinely unresolved — or whose txid the chain already shows — is now parked
718
+ (or refused) rather than released, closing the remaining window where a lying
719
+ or merely-early decline could race a real payment.
720
+ - **Ambiguous send outcomes are now parked, not dead-ended (XR-096).** A screen
721
+ unmount mid-`radio.send()`, or a radio failure whose frame is too large to
722
+ fall back to a QR, previously left a signed reservation with no durable
723
+ trace. Both now park the payment (the oversized case gets a real recovery
724
+ path too, since a message-box resend has no QR size limit).
725
+ - **Single-flight guards on Send and on session settlement (XR-097, XR-098).**
726
+ Nearby Send lacked a synchronous re-entrancy guard, so two overlapping
727
+ presses could each build and reserve their own noSend action with only one
728
+ recoverable; the session claim itself (check, persist, burn) was three
729
+ separate operations that a radio delivery could race against a QR scan for
730
+ the same session. Both are now atomic — a single synchronous latch on Send,
731
+ and a single locked `claimAndSavePending` for the settlement claim.
732
+ - **Overlay unreachability is no longer read as "not admitted" (XR-100).**
733
+ `cancelParkedPayment`'s token check only special-cased a definite
734
+ `'admitted'` verdict; a genuinely unreachable overlay fell through to the
735
+ same-as-offline BSV check with no verification at all. It now routes an
736
+ unreachable/unavailable overlay through the same "unverifiable" confirmation
737
+ gate the BSV-rail check already uses, once a settlement row proves the
738
+ payment was genuinely handed over.
739
+ - **Oversized notes can no longer strand a payment (XR-101).** A received peer
740
+ note has no wire-level length cap; `internalizeAction`'s real 2000-byte
741
+ description limit throws rather than truncating, so a hand-crafted oversized
742
+ note could make every retry fail until the pending-attempts ceiling
743
+ permanently stranded an already-accepted payment. The constructed description
744
+ is now truncated on a UTF-8 byte boundary before `internalizeAction` is
745
+ called (display-only; the payment itself is unaffected).
746
+ - **Overlay identity anchored to device config (XR-104).**
747
+ `buildTokenPaymentFrame`'s exported, documented entry point read the payee's
748
+ session-claimed overlay identity/URL directly, which could redirect this
749
+ device's `SpecificKeyLinkage` disclosure to a verifier of the payee's
750
+ choosing; the app's own single caller already guarded against this ad hoc,
751
+ but the exported function itself did not. It's now read from device config,
752
+ never the session.
753
+ - **Stale offline-queue bookkeeping is reconciled (XQ-009).** A
754
+ `networkAlreadyHas` check trusted a bare `'mined'/'known'` status string with
755
+ no proof — now also requires a validated Merkle proof
756
+ (`EntityProvenTx.fromTxid`) against this device's own chain tracker before
757
+ treating that as confirmation the network already has a transaction.
758
+ Separately, a row legitimately marked `'sent'` had no path back to
759
+ reconciliation if its backing request later moved to `'invalid'` (a reorg, a
760
+ proof timeout); `reconcileStaleSentActions()` now revisits and reclassifies
761
+ such rows.
762
+
763
+ ### PeerPay / handle rail
764
+
765
+ - **Duplicate-delivery detection narrowed to the structured code (XR-046).**
766
+ `isDuplicateMessageError` matched free prose in a thrown error's message,
767
+ entirely attacker/host-controlled; it now requires `@bsv/message-box-
768
+ client`'s own structured `ERR_DUPLICATE_MESSAGE` code, which the client
769
+ validates before embedding.
770
+ - **Inbox shape-check bounded (XR-047).** An unbounded
771
+ `transaction`/derivation-string length in a poisoned inbox message re-
772
+ triggered a full scan on every poll and background credit pass; both are now
773
+ capped against the existing shared `walletArgLimits` ceilings before the scan
774
+ runs.
775
+ - **Retried entries are re-verified before broadcast (XR-048).** A retried
776
+ outbox entry's persisted `txid` was handed to `broadcastNoSend` with no check
777
+ that it actually corresponded to the entry's own token; a tampered store or
778
+ restore could point it at an unrelated pending action. The txid is now re-
779
+ derived from the entry's own token and required to match before broadcasting.
780
+ - **Abandon no longer releases inputs the recipient may already hold
781
+ (XR-049).** Abandoning a delivered/delivering handle payment used to call
782
+ `abortAction` whenever it happened to succeed — never safe once a signed
783
+ token may already be with the recipient. Abandon now never calls
784
+ `abortAction`; it only drops the local tracking row. A companion fix keeps
785
+ the row (with the error recorded) rather than removing it unconditionally
786
+ when an abort attempt during abandon fails or throws.
787
+ - **Broadcast confirmation requires a positive result (XR-050).** Any
788
+ `sendWith` result shape other than an explicit matching `'failed'` entry was
789
+ previously read as success; it now requires an explicit match with
790
+ `'sending'`/`'unproven'` status, failing closed on
791
+ missing/empty/unrelated/duplicate/unknown-status results.
792
+ - **Resend requests are authenticated against the recorded recipient
793
+ (XR-051).** A `resend_request` control message from any authenticated sender
794
+ with a guessed real txid could force the full resend workflow repeatedly,
795
+ forever. It's now checked against the payment's actual recorded/resolved
796
+ recipient before any work happens.
797
+ - **Retry side effects re-read the row first (XR-052).** A retry's network
798
+ calls could complete anyway even after a concurrent user-triggered
799
+ abandon/cancel removed the outbox row mid-flight. The row is now re-fetched
800
+ immediately before each side-effecting call, and the retry stops cleanly if
801
+ it's gone.
802
+ - **Overridden delivery host shown before send (XR-053).** A `peerpay:` link's
803
+ `url` extension can silently redirect delivery to a different MessageBox host
804
+ with no identity binding; the review screen now shows the host whenever one
805
+ is link-supplied (new key `pay_review_delivery_host`) — the underlying trust
806
+ gap (no signed delivery receipt) is unchanged and not claimed as closed.
807
+ - **Generic Activity abort refuses an unaccounted-for send (XR-012).** The
808
+ Activity screen's generic Abort button had no PeerPay awareness at all; a
809
+ restored wallet with no outbox row for an already-delivered/delivering send
810
+ could have its inputs released on a payment the recipient may already hold. A
811
+ new `isAbortSafe` check (also used internally by the existing cancel flow)
812
+ now refuses it (new key `tx_abort_maybe_delivered`).
813
+
814
+ ### Address rail and the Pay screen
815
+
816
+ - **Bounded sweep work (XR-054).** A dusted receive address's sweep re-fetched,
817
+ verified, and internalized every distinct-txid UTXO on every 30-second pass
818
+ with an O(n^2) grouping step; sweeps are now capped at 200 distinct
819
+ transactions per pass (anything left over is picked up on the next pass —
820
+ nothing is lost or double-credited) with the grouping made linear.
821
+ - **Sweep receipt amount comes from the verified transaction (XR-056).** The
822
+ "Received" overlay and background notification summed the untrusted indexer
823
+ listing's claimed value rather than the cryptographically-committed output
824
+ amount on the already-parsed, already-verified transaction; the wallet's
825
+ actual balance was never affected, but the displayed figure could be wrong.
826
+ It now sums from the parsed transaction's own output.
827
+ - **`sendToAddress` rejects non-P2PKH addresses itself (XR-057).** The P2SH-
828
+ rejection guarantee this rail relies on lived entirely inside `@bsv/sdk`'s
829
+ internals with no repo-owned check; `sendToAddress` now rejects any non-
830
+ mainnet/testnet-P2PKH version byte before building a locking script,
831
+ independent of the SDK.
832
+ - **Bounded UTXO listings and BEEF/hex response sizes (XR-059).** An oversized
833
+ indexer response could force unbounded per-txid network fanout and unbounded
834
+ hex-decode/merge work; `getUtxosForAddress` is now capped at
835
+ `MAX_UTXO_LISTING_ROWS` (2000) and hex bodies at `MAX_HEX_RESPONSE_CHARS`
836
+ (8,000,000) on both the address-sweep and PeerPay reorg-repair paths, and
837
+ later extended to `WalletContext.refreshProof`'s own merkle-BUMP and raw-tx
838
+ hex reads.
839
+ - **Every conventional-receive date is scanned for recovery, not a fixed window
840
+ (XR-055)** — see Backup and restore above; the address-rail side of that fix
841
+ widens `recoveryDatesToScan` and the manual receive-screen stepper.
842
+ - **Synchronous send latches (XR-061, XR-097).** `UniversalSend.handleSend` and
843
+ Nearby's own send path each relied only on async React state for mutual
844
+ exclusion, so two press activations landing in the same JS turn could
845
+ independently invoke a value-moving rail call. Both now set a synchronous
846
+ ref-backed latch as their first statement, before any `await`.
847
+
848
+ ### Wallet repair, proofs, headers, and broadcast
849
+
850
+ - **Verify the alleged spender before marking a UTXO unspendable (XR-031).**
851
+ Wallet Check committed `spendable:false` as soon as two chain-service sources
852
+ agreed an output was spent, before ever checking that the alleged spender's
853
+ own inputs referenced that outpoint. It now fetches and verifies the
854
+ spender's BEEF first and requires an actual matching input.
855
+ - **Stuck-reservation release is corroborated (XR-032).**
856
+ `releaseStuckReservations` restored every input reserved by a locally
857
+ `'failed'` transaction unconditionally, with no check against the safer
858
+ `proven_tx_reqs` status set the sibling repair path already uses; it now only
859
+ releases a reservation whose spender's proof-request rows are all in the
860
+ safe/terminal set.
861
+ - **Header-sync and broadcast-log bounds (XR-060).** A `getHeaders` response
862
+ could return far more than was requested with no check on the returned
863
+ length; header sync now truncates to exactly what was asked for. Broadcast
864
+ response bodies logged in full with no size cap; logging is now capped at
865
+ 2000 characters (classification still runs over the full body).
866
+ - **Orphan-mempool is no longer treated as a double spend (XR-062).** ARC's
867
+ `SEEN_IN_ORPHAN_MEMPOOL` status — an ordinary propagation-timing condition,
868
+ not a proven conflict — was classified identically to a real double-spend and
869
+ triggered the same terminal rejection cascade for a chained/offline payment.
870
+ It now sets a retryable service-error instead.
871
+ - **Broadcast body reads are bounded by time and size (XR-063, and the XR-060
872
+ remainder).** The ARC/WhatsOnChain broadcast providers cleared their timeout
873
+ as soon as headers arrived, before reading a potentially stalling or
874
+ oversized body — hanging the whole broadcast attempt with no fallback ever
875
+ tried. The body read is now raced against the same deadline as the
876
+ connection, and capped at `MAX_BROADCAST_BODY_BYTES` (1,000,000 bytes).
877
+ - **Custom ARC endpoint policy (XR-064).** A custom ARC URL was persisted with
878
+ no scheme/origin validation, and a saved API token could silently carry over
879
+ to a newly entered, unrelated host. It now requires https (with a loopback
880
+ dev exception, new key `arc_url_https_required`), clears a token when the
881
+ origin changes, and requires an explicit accepted ARC status or matching txid
882
+ before treating a broadcast response as successful (closing a bare `200 {}`
883
+ response that previously suppressed the real HTTPS fallback chain).
884
+ - **Backup/Mandala/MessageBox origin policy (XR-065).** These three
885
+ configurable origins had no scheme policy at all (unlike the handle
886
+ registry's own); they now share the same https-required
887
+ (loopback/RFC1918-dev-exception) check.
888
+ - **`taalApiKey` no longer aliases `whatsOnChainApiKey` (XR-066).** A key
889
+ scoped to WhatsOnChain was silently sent to TAAL's own broadcast origin too.
890
+ A host that relied on the old fallback must now set
891
+ `EXPO_PUBLIC_TAAL_API_KEY` explicitly (README updated); no wallet funds were
892
+ ever at risk from this, only quota/credential exposure.
893
+ - **Unknown chain string fails safe to testnet, not mainnet (XQ-011).** A
894
+ corrupted or garbage persisted network value resolved broadcast to the live
895
+ mainnet endpoint, the most privileged branch — every sibling consumer of the
896
+ same value already collapsed safely. It now matches them.
897
+ - **`recordProof`'s directly-fetched raw tx is hash-checked (XR-029).** The
898
+ BUMP/root check only proves the requested txid is confirmed; nothing checked
899
+ that a separately-fetched raw-tx response actually hashed to that txid before
900
+ completing a transaction on it. It now requires `doubleSha256(rawTx) ===
901
+ txid`.
902
+ - **Only an authoritative 404 proves chain absence (XR-030).** A manual proof
903
+ refresh treated any non-2xx response (a rate limit, a 5xx, an auth error)
904
+ identically to a definitive 404 and released reserved inputs on a stale row;
905
+ now only a 404 counts as proof of absence.
906
+ - **Proof-of-work required outside the validated header window (XR-068).** A
907
+ miss or reorg-tail chaintracks answer was trusted on a bare, unauthenticated
908
+ `merkleRoot` with no PoW/linkage check at all; it's now required to satisfy
909
+ its own declared target before being trusted or cached (partial — no chain-
910
+ of-custody to a trusted checkpoint yet, so a forger who could actually mine a
911
+ low-difficulty historical header is still out of scope of this fix).
912
+ - **Token broadcast guard fails closed on a read fault (XR-045).**
913
+ `tokenSettlementTxids()` collapsed a genuine `token_settlements` read failure
914
+ to the same empty result as "no token requests in this batch," so a transient
915
+ fault could let an unadmitted token request post straight past overlay
916
+ admission. It now throws on a read failure, and the one caller that can
917
+ actually broadcast holds the whole batch rather than deciding off an
918
+ incomplete answer.
919
+ - **No overlapping background task passes (XR-105).** `TaskSendOffline` and
920
+ `TaskBackupPush` had no dedup guard against a watchdog restart racing a hung
921
+ pass, unlike two sibling tasks already protected; both now share the same in-
922
+ flight guard.
923
+
924
+ ### Database import and export
925
+
926
+ - **CSV export can no longer carry a live spreadsheet formula (XR-078).** A
927
+ remote-supplied note beginning with `=`, `+`, `-`, `@`, a tab, or a CR became
928
+ a live formula on open in a spreadsheet application. Untrusted free-text
929
+ columns (description/tags/labels) are now formula-neutralized (OWASP leading-
930
+ apostrophe mitigation); a follow-up fix scoped that neutralization away from
931
+ the trusted, app-derived numeric/txid/status/blockHeight columns it had
932
+ initially been applied to as well, which it had been corrupting (e.g. turning
933
+ every outgoing amount into text).
934
+ - **Unencrypted export now warns first (XR-086).** `exportAllWalletDatabases()`
935
+ hands a raw, unencrypted SQLite image to the OS share sheet with no
936
+ passphrase step; a warning naming what the file contains, with a real cancel,
937
+ now appears first (new keys
938
+ `export_unencrypted_title`/`export_unencrypted_message`). Full at-rest
939
+ encryption is a larger, deferred product decision (the importing device would
940
+ need a way to get the key back).
941
+ - **Import file size ceiling (XR-087).** A picked backup was read into memory
942
+ with no size check at all. A 256 MiB ceiling is now enforced against both the
943
+ picker-reported size and the actual read length before any deserialization
944
+ (new keys `import_oversized_file`/`import_oversized_file_detail`).
945
+ - **Raw database imports are authenticated before becoming active (XR-079, and
946
+ the narrower XR-080/XR-084 variants it also closes).** Identity, chain, and
947
+ freshness were derived purely from the picked filename, never the file's
948
+ contents — a same-filename import could overwrite the live database, a same-
949
+ suffix foreign database could win the next build's file selection, and the
950
+ spendability-reconciliation pass an encrypted restore always runs was skipped
951
+ entirely. An import now requires the deserialized image's own settings row to
952
+ match the currently unlocked wallet's identity and chain, rejects a filename
953
+ timestamp more than 5 minutes in the future, always synthesizes a destination
954
+ filename distinct from every live or registered one (never reusing the picked
955
+ name), and routes through the same `reviewSpendableOutputs` reconciliation
956
+ pass an encrypted restore uses.
957
+ - **Imported queues and caches are quarantined at the import boundary, never
958
+ trusted as live state (XR-081, XR-083, XR-085).** A wholesale-imported
959
+ database could seed the live LocalPay pending queue with a frame that never
960
+ passed ownership/session/asset verification (now stripped on import), plant a
961
+ forged `proven_txs` row that could later let a forged proof pass as chain-
962
+ proven (now stripped), or silently auto-rebroadcast an already-aborted
963
+ `queued`/`posting` `offline_actions` row the instant the app goes online (now
964
+ rewritten to a new `'import_hold'` status the automatic drain never selects,
965
+ surfaced in Activity as "Held (imported)" — new key `tx_status_import_hold` —
966
+ with no UI yet to promote a held row back to queued, a deliberate, disclosed
967
+ gap). `refreshProof` and the WalletHomeScreen activity query both recognize
968
+ `'import_hold'` so a stale imported row can't be mistaken for a failed one
969
+ and have its inputs released via the manual Refresh action.
970
+ - **Weakened or extra schema objects are rejected, not silently kept forever
971
+ (XR-082).** A crafted image could keep an allowed table/index's name while
972
+ dropping a `UNIQUE`/`NOT NULL` constraint, or smuggle in an extra
973
+ trigger/view/virtual table/table — `CREATE ... IF NOT EXISTS` never repairs
974
+ an existing weakened definition. Import now compares each allowed object's
975
+ actual definition (as an order-independent, whitespace-normalized
976
+ column/constraint set, so a genuine additive migration's reordered columns
977
+ are still tolerated) against a disposable in-memory reference schema, and
978
+ rejects anything outside the allow-list entirely.
979
+
980
+ ### Identity, registry, trust, and network destination policy
981
+
982
+ - **A shared public-destination check closes several SSRF-shaped gaps
983
+ (XR-073).** Nothing previously bound a foreign paymail domain's advertised
984
+ capability templates or SRV target, a user-typed trust-provider domain, a
985
+ trust manifest's icon URL, a search-result avatar, or the identity-avatar
986
+ resolver's http(s)/UHRP fallback to an actual public internet destination —
987
+ each could be pointed at a loopback/RFC1918/link-local address with no DNS
988
+ trickery needed. A shared `isPublicHttpsUrl`
989
+ (`core/net/publicDestination.ts`) — a floor, not a firewall, since there's no
990
+ synchronous DNS resolution on this runtime to catch rebinding — is now
991
+ applied at all of them: handle-registry discovery, `TrustScreen`'s manifest
992
+ fetch and icon prefetch, `searchIdentities()`'s avatar mapping, and
993
+ `resolveAvatarURL`'s http(s)/UHRP branches.
994
+ - **Trust-manifest fetch bounded and its deadline covers the body (XR-074,
995
+ XR-075).** The manifest fetch had no byte cap at all, and its timeout was
996
+ disarmed as soon as headers arrived — a slow or dripping body could hang the
997
+ loading state forever. It's now capped at 64 KiB with the same deadline
998
+ racing the body read, not just the connection.
999
+ - **Downgraded trust-provider imports refused (XR-076).** An explicit `http://`
1000
+ domain was accepted verbatim, and a manifest fetch followed redirects with no
1001
+ origin check. Both are now refused outright — an explicit `http://` domain
1002
+ fails before any request, and the manifest fetch fails closed on any
1003
+ redirect.
1004
+ - **Handle-registry bodies bounded by byte count (XR-077).** Every handle-
1005
+ registry read shared one timeout-only body reader; a foreign or compromised
1006
+ registry could pace an unbounded body just under the deadline. A 256 KiB
1007
+ ceiling now applies before any JSON parse.
1008
+ - **Deep-linked identity keys are never rendered as "Your Identifier"
1009
+ (XR-070).** A crafted `bsv-wallet://identifier?identityKey=...` deep link
1010
+ could render an attacker's key as the user's own QR/copy/share target. The
1011
+ screen now always fetches and displays only the wallet's own key; a route-
1012
+ supplied key is only ever compared against it, never rendered.
1013
+ - **Trust-on-first-use key pinning for paymails (XR-071).** A compromised or
1014
+ malicious registry — including the pinned one — could mint a fresh
1015
+ certificate redirecting an already-resolved paymail to a different key. The
1016
+ first key ever resolved for a paymail is now pinned; a later certificate
1017
+ under a different key for the same paymail is dropped regardless of which
1018
+ registry served it (a from-scratch resolution of a paymail never seen before
1019
+ is inherently unprotected by TOFU, and is out of scope).
1020
+
1021
+ ### Vendored toolbox patch
1022
+
1023
+ - **`abortAction` fails closed on an unresolved chain status (XQ-016).**
1024
+ `@bsv/wallet-toolbox-mobile` 2.14.0's `StorageProvider.abortAction` treated a
1025
+ thrown/timed-out/non-success chain-status lookup as safe to invalidate and
1026
+ release a `nosend` action's reserved inputs — including one already handed to
1027
+ a counterparty over PeerPay or LocalPay, turning a chain-status outage into a
1028
+ payer-side double-spend race. The patch (`patches/@bsv+wallet-toolbox-
1029
+ mobile+2.14.0.patch`) now retries the chain-status check once and, if still
1030
+ unresolved, throws instead of invalidating — every in-app `abortAction`
1031
+ caller already handles a thrown result sensibly, and Vault's own abort calls
1032
+ (strictly unsigned-only) are unaffected. Verified end to end through Vault's
1033
+ own retry-heal path, not only in isolation.
1034
+
1035
+ ### Storage schema
1036
+
1037
+ - **`transactions` table gains the vendor's BRC-177 `noSendExpiry*` columns
1038
+ (NEW-01).** `@bsv/wallet-toolbox-mobile` 2.14.0 reads and writes
1039
+ `noSendExpiryState`/`noSendExpiryReclaimTxid` and related columns this
1040
+ package's schema never added — every `'failed'` transition of a signed
1041
+ `nosend` transaction (an aborted action, a failed broadcast, a proof-check
1042
+ timeout, or the periodic invalid-request sweep) threw "no such column"
1043
+ instead of completing, wedging state inconsistently app-wide. A new
1044
+ idempotent `ensureTransactionsColumns` migration (called from `createTables`,
1045
+ so both a fresh and an existing database pick it up) adds the columns, and
1046
+ `findSql.ts`'s column lists are updated so a `noRawTx`-projected read doesn't
1047
+ silently drop them.
1048
+
1049
+ ### Copy and translations
1050
+
1051
+ 24 new keys across the sections above, in all 12 languages:
1052
+ `delete_wallet_failed_title`, `delete_wallet_failed_body`,
1053
+ `vault_resume_draft_confirm_title`, `vault_resume_draft_confirm_body`,
1054
+ `vault_resume_draft_confirm_use`, `vault_resume_draft_confirm_discard`,
1055
+ `vault_seed_not_preserved_title`, `vault_seed_not_preserved_body`,
1056
+ `vault_seed_not_preserved_cta`, `vault_resolve_held_deposit_none`,
1057
+ `reconnect_needs_reapproval`, `reconnect_confirm_title`,
1058
+ `reconnect_confirm_message`, `arc_url_https_required`,
1059
+ `export_unencrypted_title`, `export_unencrypted_message`,
1060
+ `import_oversized_file`, `import_oversized_file_detail`,
1061
+ `tx_abort_maybe_delivered`, `tx_status_import_hold`,
1062
+ `local_pay_pending_abort_dropped_title`,
1063
+ `local_pay_pending_abort_dropped_body`, `biometric_advisory_body_degraded`,
1064
+ `pay_review_delivery_host`. `vault_reset_unknown_ack` is also corrected in
1065
+ every locale: it previously told the user a physically-occupied, locally-
1066
+ unrecognized YubiKey slot definitely belonged to no vault on this device, a
1067
+ certainty SecureStore's per-identity isolation cannot actually support; it now
1068
+ discloses the uncertainty instead of overclaiming it. Non-English copy is
1069
+ machine-drafted and awaits native-speaker review, same as every previous
1070
+ translation batch in this changelog.
1071
+
1072
+ ### Known residuals
1073
+
1074
+ Full disposition of every ledger row (fixed, already-fixed, invalid, needs-
1075
+ hardware-or-network, out-of-scope, or partial-with-a-recorded-blocker) and its
1076
+ proof artifacts are in `docs/security/external-review-closure.md`. Residuals
1077
+ surfaced above, collected here for visibility:
1078
+
1079
+ - The physical-hardware run (a real, previously-enrolled YubiKey through a full
1080
+ chain-recovered-lock-to-withdraw path) is still unrun for the Vault
1081
+ generally, and production keeps Vault output creation disabled until a v7
1082
+ lock has actually been broadcast, mined, and exercised on physical hardware.
1083
+ - Backup's `appData` channel still can't carry an isolated, single-entity
1084
+ change on its own (an all-empty chunk is the sync protocol's own end-of-log
1085
+ signal), and `offline_actions`/`token_linkage_payloads` are still outside
1086
+ encrypted backup; the restore path still can't bound a response with no
1087
+ declared `Content-Length`, and the chunk envelope still doesn't bind
1088
+ device/generation/sequence into what it authenticates.
1089
+ - Full saved-connection binding still needs an admin-scoped wallet threaded
1090
+ into `connect()`/`reconnect()`; the auto-approve default threshold and shared
1091
+ daily cap remain provisional pending product sign-off.
1092
+ - PeerPay and LocalPay still have no signed delivery/non-delivery receipt
1093
+ protocol — a dishonest decline made while the payee is genuinely offline, or
1094
+ one that reaches the chain only after this device's own check runs, is
1095
+ handled by detect-and-warn, not prevention.
1096
+ - Header validation outside the locally-validated window still has no chain-of-
1097
+ custody back to a trusted checkpoint, so a forger capable of mining a valid
1098
+ low-difficulty historical header is not excluded by this pass alone.
1099
+ - The iOS backup-exclusion question and the malformed-but-SQLite-magic-passing
1100
+ import question both need a real device build to close; an imported,
1101
+ quarantined `'import_hold'` offline-action row still has no in-app path to be
1102
+ reviewed and re-promoted to `'queued'`.
1103
+ - Android's KEK delete-then-add cycle still does not rotate the underlying
1104
+ hardware key (a vendored `expo-secure-store` limitation, not exploitable on
1105
+ its own).
1106
+
1107
+ ### Also in this release
1108
+
1109
+ - **TAAL and GorillaPool fallback broadcasts failed on every attempt.**
1110
+ `createTaalBroadcastService`/`createGorillaPoolBroadcastService`
1111
+ (`arcadeBroadcastProvider.ts`) posted to `${arcUrl}/tx`; both are standard
1112
+ ARC and serve `POST /v1/tx`, so every call 404'd and neither ever worked as
1113
+ a fallback when Arcade was down or rejected a transaction. Arcade (which
1114
+ serves `/tx` at its root) is unchanged. The dead teratest TAAL host
1115
+ (`arc-teratest.taal.com`) is dropped; `WalletContext` adds TAAL only on
1116
+ `main` and `test`.
1117
+ - **Pairing QR signatures verify in the `@bsv/wallet-relay` 0.5.x format.**
1118
+ `buildPairingSignatureMessage` (`walletConnectionValidation.ts`) had drifted
1119
+ to a domained `bsv-wallet-pairing-v1|topic|backendIdentityKey|protocolID|
1120
+ origin|expiry` transcript, while wallet-relay backends sign
1121
+ `topic|backendIdentityKey|origin|expiry`, so every real pairing QR failed
1122
+ with "Signature is not valid". Any future transcript change must be
1123
+ coordinated with wallet-relay and its backends.
1124
+ - **Recovery shares print as separate jobs (XR-110, partial).**
1125
+ `printRecoveryShares()` sent every share in one `Print.printAsync` job, so
1126
+ one retained job (spooler, print service, printer memory) could hold enough
1127
+ shares to rebuild the wallet. `generatePrintHTML()` takes an optional
1128
+ `only` index, and each share is now its own one-page job. Still open (a
1129
+ product decision): no paced, confirmed per-share flow or "1 of N"
1130
+ disclosure, so someone watching the whole print session still sees every
1131
+ share.
1132
+ - **A failed restore no longer leaves a reusable, partly replayed database
1133
+ (XR-017).** The restore picked and registered its SQLite file before replay,
1134
+ and on failure only closed it, so a later build that skipped replay could
1135
+ reselect it and publish it as a working wallet with missing history, proofs
1136
+ or BRC-29 receipts. `walletDbRegistry` gains `unregisterDb`; the failure
1137
+ path unregisters and deletes the file, but only when this build created
1138
+ it, never an existing identity's live database.
1139
+ - **A failed build-time release is retried durably, and pending-abort writes
1140
+ no longer race (XR-088).** When `releasingOnFailure()`'s own `abortAction`
1141
+ failed after a post-sign build error it only logged. `buildPaymentFrame`/
1142
+ `buildTokenPaymentFrame` take an optional `queueFailedAbort`, which
1143
+ `NearbyFlow` wires to `queuePendingAbort` as the decline path already did.
1144
+ `queuePendingAbort` and `replayPendingAborts` now share one
1145
+ `withPendingAbortsLock` chain, so a queue write during a replay can no
1146
+ longer drop a new reference or resurrect one that just aborted.
1147
+ - **Vault withdrawal retry no longer treats a refused input release as
1148
+ freed.** `abortActions`/`abortReservingOutpoints` counted an orphan as freed
1149
+ as soon as `abortAction` was called, so `createSignableVaultTx` retried
1150
+ against an input that was never released instead of surfacing the original
1151
+ error. An orphan now counts only once its abort resolves.
1152
+ - **Imported held rows no longer count as queued payments (XR-085
1153
+ follow-up).** `WalletHomeScreen`'s queued count excluded only `rejected`
1154
+ and `parked`, so an `import_hold` row reached `<OfflineNotice>` with "Send
1155
+ now" and "Show code". It is now excluded; Activity still shows it as "Held
1156
+ (imported)".
1157
+ - **The legacy `Balance` component no longer shows another context's cached
1158
+ balance (XR-058).** It cached under one global AsyncStorage key
1159
+ (`cached_wallet_balance`) and painted it on mount before checking for an
1160
+ active wallet. The cache is now per network
1161
+ (`cached_wallet_balance_${selectedNetwork}`), nothing paints until a wallet
1162
+ on that network is active, and logout also removes the old unscoped key.
1163
+
1164
+ ## 0.8.0
1165
+
1166
+ ### Wallet recovery and creation module
1167
+
1168
+ Everything the host's mnemonic and scan-shares screens used to decide inline
1169
+ — classify the import, store the secret, drop the other secret kind, build
1170
+ or rebuild, read the backup-replay outcome, attest — now lives in
1171
+ `core/recovery/` as plain functions over an injected deps object, unit-tested
1172
+ without rendering a screen. The screens keep only rendering, haptics,
1173
+ navigation and the small state machine that picks which view is shown; they
1174
+ supply prompts and translate outcome codes.
1175
+
1176
+ New `core` exports (all re-exported from the package root, and, for the
1177
+ share primitives, still reachable through `ui/backupShares.ts`):
1178
+
1179
+ - `secret.ts` — `WalletSecret` (`{kind:'mnemonic', mnemonic, identityKey}` or
1180
+ `{kind:'wif', wif, identityKey}`), `classifyImportInput(text)` (64-hex →
1181
+ wif, valid BIP39 phrase → mnemonic, anything else → `null`), and
1182
+ `secretFromShares(shareStrings)` (recombines shares into a `WalletSecret`,
1183
+ throwing exactly when the underlying Shamir recombination does).
1184
+ - `restoreWallet.ts` — `RestoreWalletDeps`, `RestoreHistory`,
1185
+ `RestoreOutcome` and `restoreWallet(deps, secret, opts)`: one attempt at
1186
+ storing a secret, dropping the other kind, building or rebuilding, and
1187
+ attesting. Never throws — anything a dep throws comes back as
1188
+ `{kind:'failed'}`.
1189
+ - `recoverWallet.ts` — `RestorePrompts`, `RecoveryOutcome` and
1190
+ `recoverWallet(deps, secret, opts)`: the retry/skip policy around
1191
+ `restoreWallet` (a refused biometric retries or cancels; a failed backup
1192
+ replay returns control to the caller's input or, on skip, re-attempts
1193
+ without asking for history replay).
1194
+ - `createWallet.ts` — `CreateWalletDeps`, `CreateOutcome` and
1195
+ `createNewWallet(deps, opts?)`: the "generate a brand new wallet" path,
1196
+ guarding first against an already-built wallet or already-stored identity
1197
+ (`{kind:'exists'}`) before generating anything.
1198
+ - `backupMaterial.ts` — `BackupMaterial` and `readBackupMaterial(deps)`, what
1199
+ the "view/export my recovery material" screen shows (mnemonic wins over a
1200
+ stored WIF; throws if neither is present).
1201
+ - `useRecoveryDeps.ts` — the React hook (`useRecoveryDeps()`) wiring the
1202
+ above to `useWallet()`, `useLocalStorage()` and `backupAttestation`.
1203
+ - `shares.ts` gains `ShareCompatibilityIssue` and
1204
+ `checkShareCompatibility(newShare, existing)`, returning a code
1205
+ (`'threshold-mismatch' | 'integrity-mismatch' | 'duplicate'`) instead of
1206
+ English prose; `shareCollector.ts` is a new pure reducer
1207
+ (`collectShare(collection, raw)`) for the scan screen's
1208
+ accumulate/dedupe/threshold logic, unit-testable without a camera.
1209
+
1210
+ `core/context/WalletContext.tsx`'s `WalletContextValue` gains
1211
+ `getWalletBuilt(): boolean`, a ref-backed twin of `walletBuilt` for callers
1212
+ that await a build across `recoverWallet`'s retry loop, where a captured
1213
+ React state snapshot would go stale.
1214
+
1215
+ `ui/` gains `recoveryPrompts.ts` — `restorePrompts(t): RestorePrompts`, the
1216
+ one copy of the biometric-refused and backup-replay-failed dialogs, exported
1217
+ from the `ui` barrel next to `showAlert`.
1218
+
1219
+ ### Share primitives moved to `core/` (deprecates `validateShareCompatibility`)
1220
+
1221
+ `ui/backupShares.ts`'s framing/padding/classification/split/recombine logic
1222
+ (everything except `generatePrintHTML`, which stays in `ui/` as
1223
+ presentation) moved to `core/recovery/shares.ts`, so the headless recovery
1224
+ module can reach it without crossing the `core` → `ui` boundary (`core`
1225
+ still never imports `ui/`). `ui/backupShares.ts` is now a re-export shim
1226
+ (`export * from '../core/recovery/shares'`) plus `generatePrintHTML`, so
1227
+ existing `@bsv/expo-wallet-toolbox/ui` consumers of the moved names are
1228
+ unaffected. `validateShareCompatibility(newShare, existing)` is kept for
1229
+ compatibility but **deprecated** in favour of `checkShareCompatibility`,
1230
+ which returns a code the caller translates instead of English prose.
1231
+
1232
+ ### Deep links: `resolveNativeIntent` and a wider `legacyRedirectTarget`
1233
+
1234
+ `core/pay/rails/nativeIntent.ts` adds `resolveNativeIntent(path, opts)`,
1235
+ moved out of the host's `+native-intent` route resolution: it recognises the
1236
+ toolbox's own `peerpay:` scheme and the host's own custom URL schemes, now
1237
+ passed in as `opts.walletSchemes` instead of hard-coded, so a second wallet
1238
+ app can reuse it with its own scheme names. `legacyRedirectTarget`'s `params`
1239
+ widen from `Record<string, string | undefined>` to
1240
+ `Record<string, string | string[] | undefined>`, so the three retired pay
1241
+ routes can forward `useLocalSearchParams` straight through instead of
1242
+ flattening array-valued query params themselves.
1243
+
1244
+ ### `NativeHandlers.onDownloadFile` optional
1245
+
1246
+ `UserContext`'s `NativeHandlers.onDownloadFile` is now optional, backed by a
1247
+ new `mergeNativeHandlers(partial?)` helper that fills in the no-op default
1248
+ per field. A host that omits it no longer has to supply an all-or-nothing
1249
+ `nativeHandlers` override just to skip that one handler.
1250
+
1251
+ ### Copy and translations
1252
+
1253
+ - 8 new keys, in all 12 languages: `scan_shares_threshold_mismatch`,
1254
+ `scan_shares_integrity_mismatch`, `scan_shares_duplicate` (the
1255
+ `checkShareCompatibility` issue codes, translated by the scan screen),
1256
+ `import_invalid_input_title`, `import_invalid_input_message`,
1257
+ `import_setup_failed`, `create_wallet_refused`, `create_wallet_failed`
1258
+ (the mnemonic screen's import/generate failure copy). Non-English copy is
1259
+ machine-drafted and awaits native-speaker review, same as every previous
1260
+ translation batch in this changelog.
1261
+
1262
+ ### Behaviour changes (breaking for hosts that relied on the old behaviour)
1263
+
1264
+ - Recovering or importing over an already-built wallet (e.g. onboarding's
1265
+ auto-created wallet) now **rebuilds** the wallet instead of silently
1266
+ no-op'ing. Previously `buildWalletFromMnemonic`/`buildWalletFromRecoveredKey`
1267
+ no-op when a wallet is already built, so recovering over one looked like a
1268
+ success while nothing changed; `restoreWallet` now calls `rebuildWallet`
1269
+ in that case.
1270
+ - Storing one secret kind now **deletes the other**: after a successful
1271
+ restore, exactly one of the mnemonic or the WIF survives in storage.
1272
+ Previously, importing a WIF while a mnemonic was already stored left the
1273
+ mnemonic in place, and an auto-rebuild's "mnemonic wins" fallback would
1274
+ build from the stale mnemonic instead of the key just imported.
1275
+ - A failed backup replay's "skip" now works for **hex (WIF) imports**, not
1276
+ only phrase imports — the old skip path was phrase-only, so a failed
1277
+ restore on a hex import previously left the user with no way forward.
1278
+ - Attestation failure after an already-successful build is now
1279
+ **non-fatal**: a throw from `attest` is caught and reported as
1280
+ `attested: false` rather than turning the whole recovery attempt into a
1281
+ failure. The wallet is already built and usable at that point; the only
1282
+ consequence of an unrecorded attestation is that the backup reminder nags
1283
+ again later.
1284
+ - Retrying after a failed backup replay now **returns to the input screen**
1285
+ on both the mnemonic and scan-shares screens, rather than looping on the
1286
+ same restore attempt — a server-side failure does not get better by
1287
+ retrying it in a tight loop in place.
1288
+
1289
+ ### Nearby/QR payment verification (breaking: `DerivingWallet` gains `getServices`)
1290
+
1291
+ `core/localpay/verify.ts`'s `verifyFramePayment` BSV branch checked only that
1292
+ the named output pays this device's derived key and carries a usable
1293
+ satoshi value — never that the transaction's (or its ancestors') unlocking
1294
+ scripts are valid, or that `sum(inputs) >= sum(outputs)`.
1295
+ `internalizeAction`'s own gate is a pure AtomicBEEF-structure/SPV check with
1296
+ no script interpreter, so a payer could spend a real mined UTXO it does not
1297
+ own, with a garbage `unlockingScript`, into an output that locks to the
1298
+ payee, for any amount, and have it credited offline. `verifyFramePayment`
1299
+ now calls `tx.verify(chainTracker)` — the SDK's own end-to-end verifier —
1300
+ against the same chain tracker `internalizeAction` itself consults
1301
+ (`wallet.getServices().getChainTracker()`). It fails closed: an ancestor
1302
+ present only as a txid throws rather than being silently skipped.
1303
+
1304
+ The `DerivingWallet` interface this module accepts gains a required
1305
+ `getServices(): { getChainTracker(): Promise<ChainTracker> | ChainTracker }`.
1306
+ The real `Wallet`/`WalletStorageManager` object `NearbyFlow` already passes
1307
+ in satisfies this, so the app's own wiring needed no change — but **a host
1308
+ that built its own object against the old, narrower `DerivingWallet` shape
1309
+ (just `getPublicKey`) must add `getServices` or its build will fail to
1310
+ typecheck.**
1311
+
1312
+ ### Offline drain: an invalid foreign ancestor now cascades, not stalls forever
1313
+
1314
+ `core/offline/plan.ts`'s `outcomeOfForeignPost` only ever classified a
1315
+ foreign-ancestor post as `'success'`, `'doubleSpend'` or `'serviceError'` —
1316
+ never `'invalidTx'` — so an ancestor the network explicitly rejects as
1317
+ invalid stalled the outbox drain forever instead of cascading the rejection
1318
+ to the descendant that credited off of it. `PostedTxidResult` gains an
1319
+ optional `serviceError` field (already set by the ARC adapter: exactly
1320
+ `false` for an INVALID/MALFORMED/REJECTED verdict, `true` for a
1321
+ transport/rate-limit/timeout issue), and `outcomeOfForeignPost` now returns
1322
+ `'invalidTx'` exactly when `status==='error' && doubleSpend!==true &&
1323
+ serviceError===false`. Absent or `true` — including a provider that never
1324
+ sets the field — stays retryable, so the fix fails closed. `'invalidTx'` was
1325
+ already a valid `PostOutcome` used by the owned-post path; this is what
1326
+ makes a foreign ancestor reach it too, wiring up the existing
1327
+ cascade-to-descendant handling rather than adding new machinery.
1328
+
1329
+ ### Declined-payment watch and a safer parked cancel
1330
+
1331
+ Two related fixes in the local-pay/offline path, both detect-and-warn, never
1332
+ block:
1333
+
1334
+ - `finalizeDelivery` (`core/localpay/build.ts`) treated a negative ack as
1335
+ trustworthy and unconditionally released the payer's inputs — true even
1336
+ when the decline happened offline, since the existing mandala abort guard
1337
+ only blocks an abort once the payer's own settlement row has already
1338
+ advanced to handed-over, which never happens on a decline. It now accepts
1339
+ an optional `watchDeclinedAbort?: (entry: { txid: string; reference:
1340
+ string }) => Promise<void>` dependency, called after every decline (BSV or
1341
+ token) it has a txid for, whether or not the abort itself succeeded.
1342
+ `core/localpay/pendingAborts.ts` gains a durable watch list
1343
+ (`queueDeclinedAbortWatch` / `verifyDeclinedAborts`, backed by a new
1344
+ `DECLINED_ABORT_WATCH_KEY` entry): it asks the network the same question
1345
+ `processOfflineActions.ts`'s `networkAlreadyHas` already asks, surfaces
1346
+ (and drops) a watched txid that reaches the chain anyway, and gives up
1347
+ unsurfaced after 7 days. `WalletContext` runs `verifyDeclinedAborts` at
1348
+ build time and on every reconnect, alongside the existing
1349
+ `replayPendingAborts`, and raises a background notice
1350
+ (`local_pay_decline_broadcast_title` / `_body`) if anything surfaces —
1351
+ never blocking.
1352
+ - `cancelParkedPayment` (`core/offline/cancelParked.ts`) refused a parked
1353
+ cancel only via a token-only settlement-row check, so a parked BSV
1354
+ payment — or a token txid with no settlement row yet — could be cancelled
1355
+ and its inputs respent while the payee's own scanned copy might already
1356
+ be in flight. It now runs a chain-status check independent of any
1357
+ settlement row: online+known refuses as `'already-sent'`, online+unknown
1358
+ proceeds to `'cancelled'`, and genuinely offline refuses with a new
1359
+ `'unverifiable-offline'` outcome unless the caller passes
1360
+ `acknowledgedUnverifiable: true`. A new `runCancelParkedFlow` helper
1361
+ drives the confirm-and-retry UX, wired into `WalletHomeScreen`'s cancel
1362
+ action with the new `local_pay_cancel_unverifiable_*` keys and a
1363
+ destructive confirm.
1364
+
1365
+ `CancelParkedOutcome` gains a fourth member — **a host matching
1366
+ exhaustively over the previous `'cancelled' | 'already-sent' | 'not-found'`
1367
+ should add `'unverifiable-offline'`.**
1368
+
1369
+ ### Received-payment overlay: a `verification` prop gates the green claim
1370
+
1371
+ `NearbyFlow` set the payee's success overlay to its green "Added to your
1372
+ wallet" state as soon as the payment was durably queued, before
1373
+ `internalizeAction` had necessarily run — if internalization later failed,
1374
+ the overlay never retracted or recoloured, claiming a credit the device
1375
+ could not back yet. `PaymentSuccessOverlay` gains an optional
1376
+ `verification?: 'pending' | 'verified' | 'not-credited'` prop, defaulting to
1377
+ `'verified'` so every existing caller is unaffected. The overlay's *timing*
1378
+ is unchanged — still shown the instant the payment is durably queued; only
1379
+ the claim is gated: `'pending'` shows a neutral "Confirming with your
1380
+ wallet…" (`local_pay_received_confirming`) the moment it appears, resolving
1381
+ to today's unchanged green copy on a genuine credit or a neutral "Not added
1382
+ to your wallet yet" (`local_pay_received_not_credited`) otherwise. Ignored
1383
+ on the payer side, where there is nothing left to confirm.
1384
+
1385
+ ### Recovery: confirm before replacing an existing wallet (breaking)
1386
+
1387
+ Defense in depth against a deep link, or any other entry point, silently
1388
+ overwriting a wallet whose phrase may be unsaved: `recoverWallet` now asks a
1389
+ new `confirmReplace` prompt once, before the first `restoreWallet` attempt,
1390
+ whenever `deps.hasStoredIdentity()` reports an existing secret already on
1391
+ the device. Declining returns `{kind:'cancelled'}` before anything is
1392
+ written; a biometric retry within the same call never re-prompts. This also
1393
+ means the onboarding "replace an auto-created wallet" path sees the same
1394
+ confirm, deliberately — any caller reaching this point already has a stored
1395
+ identity to protect, in-app or not.
1396
+
1397
+ `RestoreWalletDeps` gains a required `hasStoredIdentity(): Promise<boolean>`,
1398
+ and `RestorePrompts` gains a required `confirmReplace(): Promise<'replace' |
1399
+ 'keep'>`. **A host supplying its own `RestoreWalletDeps`, or building its
1400
+ own `RestorePrompts` instead of using `ui/recoveryPrompts.ts`'s
1401
+ `restorePrompts(t)`, must implement both** — the toolbox's own
1402
+ `restorePrompts(t)` already does, wired to the new
1403
+ `recovery_replace_wallet_title` / `_body` / `_confirm` keys, and treats a
1404
+ dismissal as `'keep'` (never `'replace'`), matching the existing
1405
+ dismiss-is-always-safe convention the biometric-refused and
1406
+ backup-replay-failed prompts already follow.
1407
+
1408
+ Also in this pass: `createNewWallet` accepts an optional
1409
+ `opts.cancelled?: () => boolean`, re-checked right after the identity guard
1410
+ so a caller whose screen state changed mid-await (e.g. its route flipped to
1411
+ the backup flow) does not generate or store anything against stale state;
1412
+ `CreateOutcome` gains a `{kind:'cancelled'}` member for when it fires.
1413
+ `classifyImportInput`'s hex branch now catches an SDK parse failure and
1414
+ returns `null` instead of throwing, matching the mnemonic branch's existing
1415
+ behaviour.
1416
+
1417
+ ### Deep links: destructive recovery routes refused, pairing now requires approval
1418
+
1419
+ `resolveNativeIntent` (`core/pay/rails/nativeIntent.ts`) closes two related
1420
+ gaps:
1421
+
1422
+ - An external `bsv-wallet://auth/scan-shares` or
1423
+ `bsv-wallet://auth/mnemonic?flow=import` link redirected straight into the
1424
+ destructive import screens with no confirmation. Both now redirect to `/`
1425
+ instead of passing through; `flow=backup` and every other route are
1426
+ unaffected. This is layer 1 of two — layer 2 is the confirm-replace guard
1427
+ above, which also refuses an in-app entry point.
1428
+ - An external `pair` link used to be rewritten to `/connections`, whose own
1429
+ deep-link effect called straight into `connect()` with no user gesture in
1430
+ between. It is no longer rewritten: it now passes straight through to
1431
+ `/pair` (`PairScreen`), which already renders the same origin/permissions
1432
+ Approve/Reject card a scanned or pasted URI gets. `ConnectionsScreen`'s
1433
+ corresponding auto-connect `useEffect` was deleted — that screen now only
1434
+ ever connects from its own explicit scan/paste buttons.
1435
+
1436
+ No API surface changed, but **a host relying on an external pairing link
1437
+ auto-connecting from Connections needs to account for it now landing on
1438
+ `/pair` and requiring an explicit approval tap instead.**
1439
+
1440
+ ### Secrets: a sentinel read failure no longer re-provisions the KEK
1441
+
1442
+ `putSecret` used a `null` sentinel read as its sole signal that no wallet
1443
+ was ever stored, taking that straight into `provisionKek()`, which
1444
+ unconditionally deletes both KEK keychain items before minting a new one —
1445
+ so a transient sentinel read failure on an otherwise-existing sentinel could
1446
+ orphan an already-sealed backup envelope beyond recovery. `readSentinel`
1447
+ gains an `options?: { strict?: boolean }` parameter that rethrows instead of
1448
+ swallowing to `null`; `putSecret` now reads it strictly and refuses the
1449
+ write (returns `false` — the same externally-visible shape as a declined
1450
+ biometric prompt) rather than re-provisioning on a thrown read. A genuinely
1451
+ missing sentinel still provisions normally.
1452
+
1453
+ ### Headers: the validated window is authoritative over a remote answer
1454
+
1455
+ `HeaderStore.rootForHeight` let a remote chaintracks answer permanently
1456
+ overwrite an already PoW-validated window root on any disagreement —
1457
+ reachable by a MITM absent TLS pinning, not only a compromised chaintracks
1458
+ deployment. `HeaderStore` gains `isWindowBody(height)` and now treats the
1459
+ window's own root as authoritative for its validated body
1460
+ (`[baseHeight, tipHeight-6]`), ignoring any `extra`-cache entry there
1461
+ outright. `OfflineFirstChaintracks.isValidRootForHeight` refuses a
1462
+ body-covered mismatch outright — no remote lookup, no caching. The last-6
1463
+ reorg tail, and any height outside the window entirely, are unchanged: a
1464
+ mismatch there still falls through to the remote self-heal path exactly as
1465
+ before.
1466
+
1467
+ ### Wallet context: bounded auto-approve, private callback token, corroborated checks
1468
+
1469
+ Three fixes sharing `WalletContext.tsx`'s wiring:
1470
+
1471
+ - **Auto-approve** was a single global cooldown with no cumulative cap, so
1472
+ multiple paired origins could accidentally throttle each other while a
1473
+ single origin alone could still auto-approve up to the per-request
1474
+ threshold every cooldown window, forever. `core/services/autoApprovePolicy.ts`
1475
+ (`createAutoApprovePolicy`) replaces it: the cooldown is now keyed **per
1476
+ originator**, plus a global rolling 24h cumulative cap across every
1477
+ originator combined, `AUTO_APPROVE_DAILY_CAP_SATS` — **provisional**, set
1478
+ to 10x the default per-request threshold (1,000,000 sats at the shipped
1479
+ defaults) purely so it cannot bind in ordinary single-payment use, pending
1480
+ product sign-off on the real number. The ledger is persisted best-effort
1481
+ to `AsyncStorage` so an app restart does not reset the cap.
1482
+ - **Broadcast callback token**: the Arcade `X-CallbackToken` was
1483
+ `keyDeriver.identityKey.substring(0, 32)` — the first 32 hex chars of the
1484
+ wallet's own *public* identity key, a value any past counterparty already
1485
+ has. `core/services/callbackToken.ts`'s `deriveCallbackToken` derives it
1486
+ from a BRC-42 *private* key instead (fixed protocol/keyID, counterparty
1487
+ `'self'`, then hashed) — deterministic per wallet, but only this wallet's
1488
+ root key can compute it. The token is recomputed on every wallet build and
1489
+ used for both the Arcade broadcast service and the Monitor's
1490
+ `callbackToken` option, so an existing server-side SSE subscription keyed
1491
+ to the old, public-key-derived value re-registers under the new one
1492
+ automatically the next time the wallet builds — no separate migration
1493
+ step, but it is a genuine value change a host should be aware of if it
1494
+ reads or reproduces this token itself.
1495
+ - **Wallet check**: a coin used to be marked permanently unspendable off a
1496
+ single WhatsOnChain "spent" response — WoC can be wrong, stale, or
1497
+ answering for the wrong network, and this path never writes `spentBy`, so
1498
+ nothing could ever undo a wrong call. `core/walletRepair/shouldMarkUnspendable.ts`
1499
+ now requires the toolbox's own configured `getUtxoStatus` provider to
1500
+ *also* report the output as no longer a UTXO before committing to
1501
+ `spendable: false`; either way, the claimed spender is now recorded in
1502
+ `outputs.spendingDescription` as a paper trail (a free-text column
1503
+ nothing else in this app reads or writes).
1504
+
1505
+ ### Exchange rate: one fetch, one fallback, and a live refresh within the session
1506
+
1507
+ `ExchangeRateContext` used to run its own independent fetch/cache/fallback
1508
+ logic that disagreed with `core/services/exchangeRate.ts`'s (16 vs 16.75)
1509
+ while sharing the same `AsyncStorage` cache key. `FALLBACK_RATE`/`CACHE_KEY`
1510
+ are now exported from `exchangeRate.ts`, and `ExchangeRateContext` calls its
1511
+ single timeout-guarded `getExchangeRate()` instead of re-implementing an
1512
+ untimed fetch and its own cache/fallback.
1513
+
1514
+ Separately, that background refresh used to be fire-and-forget — its result
1515
+ only ever reached the UI on the *next* cold start, so a session that opened
1516
+ with a stale cached/fallback rate stayed stale until closed and reopened.
1517
+ `getExchangeRate()` now returns an additional `refreshed: Promise<number |
1518
+ undefined>` field (never rejects — every failure mode is still caught and
1519
+ reported as `undefined`) alongside the existing `rate`; a caller that
1520
+ ignores it (the wallet-build seed) sees no change at all, but
1521
+ `ExchangeRateContext` awaits it and raises the displayed rate once the live
1522
+ fetch actually lands, within the same session.
1523
+
1524
+ ### Pay: cross-network address warning, an honest foreign-domain trust badge
1525
+
1526
+ `core/pay/rails/index.ts` gains `addressNetwork(address): 'main' | 'test' |
1527
+ undefined`, reading a base58check address's version byte, and
1528
+ `classifyRecipientInput` / `classifyScan` / `PayTarget`'s address variant
1529
+ carry an optional `network` field alongside it. `UniversalSend` now shows a
1530
+ non-blocking `pay_address_network_mismatch` note when the recipient's
1531
+ detected network disagrees with the wallet's currently selected one — a
1532
+ warning, not a refusal, since the same key redeems on either chain.
1533
+
1534
+ Separately, a handle-registry search hit from a foreign domain used to get
1535
+ the same "Registered" badge as a match from the wallet's own pinned
1536
+ registry, overstating its trust level — a foreign domain's is only
1537
+ paymail-equivalent (its own DNS+TLS), not the pinned registry's actual
1538
+ vetting. A foreign-domain match now gets `pay_trust_handle_domain_attested`
1539
+ ("Verified by {{domain}}") instead of `pay_trust_handle_attested`.
1540
+
1541
+ ### Vault: interrupted-deposit recovery, a safer preview, stale-meta supersession
1542
+
1543
+ - **Interrupted deposit.** A crash between `signAction` and the `sendWith`
1544
+ release of a Vault deposit used to freeze every subsequent vault
1545
+ operation behind `reconcileHeldVaultDeposits`'s `action-pending` refusal,
1546
+ with no in-app way to resolve it. `core/services/vault/transfers.ts` gains
1547
+ `resolveHeldVaultDeposit(w, adminOriginator, meta, scopeToken?)`: it asks
1548
+ the network for the held txid's status first (`already-known` if the
1549
+ network already has it, otherwise re-broadcasts the *exact*
1550
+ already-signed bytes via the same `sendWith` call the normal release
1551
+ uses — never a second transaction, never `abortAction`). `VaultScreen`
1552
+ shows a "Finish the interrupted deposit" notice and button
1553
+ (`vault_resolve_held_deposit_action` / `_done` / `_failed`) whenever a
1554
+ relock or key-removal call surfaces `action-pending`.
1555
+ - **Preview mutex.** `previewVaultWithdrawal` could call `abortAction` on a
1556
+ live, in-flight unsigned reservation through `selectVaultInputs`'s
1557
+ automatic stale-reservation repair — a read-only preview must not do
1558
+ that. `selectVaultInputs` gains a `repair` parameter (default `true`);
1559
+ `previewVaultWithdrawal` now passes `repair: false` and runs inside the
1560
+ vault mutation mutex, failing closed with `action-pending` instead.
1561
+ `withdrawFromVault` / `relockVault` keep `repair: true`, so a genuinely
1562
+ stale reservation from a past crash is still cleaned up.
1563
+ - **Stale local meta.** `recoverVaultMetaFromOutputs` used to trust an
1564
+ existing local record unconditionally, so a stale post-reinstall
1565
+ SecureStore snapshot could permanently hide a newer on-chain revision. It
1566
+ now always runs the authenticated on-chain output scan and keeps the
1567
+ existing record only when it is not superseded by the scan (a strictly
1568
+ higher revision, or a same-revision strict key-set superset) — a one-way
1569
+ ratchet, never a merge or an overwrite by a same-revision disagreement.
1570
+ - **Allocation-gate scope.** `reconcileHeldVaultDeposits`'s gate now runs
1571
+ only for the sub-cases that actually allocate a new salt index — a
1572
+ deposit, a partial withdrawal's re-vaulted remainder, and `relockVault` —
1573
+ so a full-balance withdrawal and `beginVaultKeyRemoval` (neither of which
1574
+ creates a new vault output) no longer block on an unrelated held deposit.
1575
+ - **Reachable while funded.** `VaultContext` gains a device-local
1576
+ `hasVaultMeta` flag, backed by the existing `vaultStore.isEnrolled()`
1577
+ read (no new network call). `WalletHomeScreen` and `SettingsScreen` now
1578
+ show their Vault entry point when `isVaultAvailable(selectedNetwork) ||
1579
+ hasVaultMeta`, so an already-funded vault stays reachable even with
1580
+ `EXPO_PUBLIC_VAULT_ENABLED` off or the network switched away from
1581
+ mainnet. `VaultScreen`'s own withdraw/deposit gating is unchanged.
1582
+ - **Vendored patch.** The `@bsv+wallet-toolbox-mobile+2.14.0.patch` funding
1583
+ plan's UTXO-pool-growth/surplus-shaping/migration-input exemptions were
1584
+ keyed off a `'vault-deposit'` label, so a vault withdrawal or re-lock was
1585
+ not exempted and could have extra migration inputs folded in, which
1586
+ `validateSignableVaultPlan`'s strict input-count check then rejected
1587
+ outright — spuriously failing an otherwise-legitimate withdraw or relock.
1588
+ Re-keyed to the already-computed `vargs.__bsvVaultAdminAuthorized ===
1589
+ true` flag, which covers deposit, withdraw and relock alike.
1590
+
1591
+ ### Mandala: a handle-rail token is held before it is internalized
1592
+
1593
+ `@bsv/mandala`'s own `receiveTokens` calls `wallet.internalizeAction()`
1594
+ *before* it calls the settle hook that finally writes a `token_settlements`
1595
+ row — on a handle-rail token's first credit, that row does not exist yet, so
1596
+ `StorageExpoSQLite.attemptToPostReqsToNetwork`'s guard (which looks up
1597
+ exactly that row) finds nothing and lets an unmediated broadcast through
1598
+ before the issuer's overlay ever got to admit or refuse the transfer.
1599
+ `core/mandala/inboxPrehold.ts` adds a pre-hold pass, wired into
1600
+ `createRuntime.ts`'s `receiveFromInbox` ahead of the real `receiveTokens`
1601
+ call: it lists the inbox first, decodes each v2 hand-over message using only
1602
+ the mechanical shape of the library's own unexported decoder, and — for
1603
+ every message the library's own `cover()` verdict accepts — writes its
1604
+ settlement row through the same `settleThroughDrain` hook the real receive
1605
+ already uses. No trust logic is reimplemented; the verdict is entirely
1606
+ `cover()`'s own. A message whose pre-hold write fails is excluded from that
1607
+ one `receiveTokens` call and un-excluded immediately after, so it retries
1608
+ whole on the next drain tick instead of being credited with no guard row. A
1609
+ failure of the whole pre-hold pass skips the entire receive rather than
1610
+ running `receiveTokens` unguarded. One documented, inherent gap: this lists
1611
+ the inbox once and `receiveTokens` lists it again moments later — a message
1612
+ arriving in that narrow window is credited with the library's original,
1613
+ unguarded ordering, exactly as before this pass existed.
1614
+
1615
+ ### Backup: a sealed generation, and a verified snapshot preferred on restore
1616
+
1617
+ Restore target selection had no notion of "complete" — a manifest carries no
1618
+ completeness flag, so a restore landing mid-rotation could pass the
1619
+ existing contiguity check and silently report success on a partial
1620
+ snapshot. The fix is a **seal carried inside ordinary chunks**, never a new
1621
+ kind of log entry: `PushCursor` (`cursor.ts`) gains `initialChunkCount`,
1622
+ recorded the first time a generation's `since` window closes (and
1623
+ back-filled in memory for a pre-existing cursor whose window had already
1624
+ closed under an older build), and every chunk `pushOnce` appends from then
1625
+ on carries `seal: { generation, initialChunkCount }` in the same
1626
+ `{chain, chunk}` envelope (`encodeChunk`'s optional fourth argument;
1627
+ `decodeEntry` returns `{kind:'chunk', chunk, seal?}`; `decodeChunk` is an
1628
+ unchanged wrapper). An unsealed chunk is byte-identical to the old format,
1629
+ and an **older app build** reading a sealed chunk simply ignores the extra
1630
+ field — its `decodeChunk` only ever reads `envelope.chunk` — so mixed
1631
+ builds against one backup account keep working. (An earlier iteration of
1632
+ this fix on the branch wrote the seal as a separate marker entry; that
1633
+ would have crashed older readers and was replaced before release.)
1634
+
1635
+ `RemoteSyncReader.verifiedComplete()` decodes only the newest entry and
1636
+ reports true when its seal names this generation and `initialChunkCount`
1637
+ is no larger than the number of entries present — the initial snapshot is
1638
+ fully there, and later deltas keep it verified. `restore.ts`'s `pickTarget`
1639
+ ranks every candidate by `updatedAt` and picks the first one whose reader
1640
+ reports `verifiedComplete` — an older but sealed generation beats a newer
1641
+ one still mid-rotation — falling back to the previous newest-only heuristic
1642
+ (`verified: false`) only when nothing in the manifest is sealed, so a fully
1643
+ legacy manifest still restores exactly as before. `RestoreResult` /
1644
+ `RestoreOnImportResult` gain `verified: boolean`; `restoreOnImport.ts`'s
1645
+ own `newestTarget()` was dropped in favour of the shared `pickTarget`.
1646
+
1647
+ The signal now reaches the user: `BackupRestoreState` gains
1648
+ `verified?: boolean`, `RestoreOutcome` / `RecoveryOutcome`'s `ok` variant
1649
+ gains `verified: boolean`, and `restorePrompts(t)` gains
1650
+ `restoreUnverified()` — a single-button alert (new keys
1651
+ `restore_backup_unverified_title` / `restore_backup_unverified_body`, all 12
1652
+ locales) that the mnemonic and scan-shares screens show before celebrating
1653
+ when a restore succeeded but could not be confirmed complete. An idle wallet
1654
+ whose generation never received a delta after its initial window stays
1655
+ unsealed until it does; that only ever costs the "may be incomplete" notice,
1656
+ never a refused restore.
1657
+
1658
+ ### Monitor: no overlapping outbox drains, and long-gap skips are recorded
1659
+
1660
+ - `TaskDrainOutbox` had no dedup guard: a `MonitorSupervisor` watchdog
1661
+ restart can leave an old generation's in-flight `runOnce()` executing
1662
+ concurrently with a newly-started generation's own `runOnce()` (the old
1663
+ call is not cancelled, only stopped from looping again once it resolves),
1664
+ which could retry the same outbox entry twice. It gains a static
1665
+ `running` flag, set at the top of `runTask` and cleared in a `finally` so
1666
+ a throw cannot wedge it; a concurrent call now returns `''` immediately
1667
+ without draining.
1668
+ - `reviewProvenTxsStartHeight` jumps ahead to the last 100 eligible heights
1669
+ when last-reviewed falls further behind the tip than that — an
1670
+ intentional tradeoff against an unbounded chain-crawl — but nothing
1671
+ recorded which heights were permanently skipped, so a rare missed reorg
1672
+ in that range could never be surfaced. `core/walletMonitor.ts` exports a
1673
+ new `skippedReviewRanges: { fromHeight: number; toHeight: number }[]`
1674
+ array (and `resetSkippedReviewRanges()`), pushed to and `console.warn`'d
1675
+ with a tagged `[walletMonitor]` line whenever a skip actually happens, so
1676
+ diagnostics or a future slow background sweep can read it.
1677
+
1678
+ ### `AmountInput` accepts the locale's own decimal separator
1679
+
1680
+ Fiat-mode input hardcoded `.` as the decimal separator in both the input
1681
+ mask and `parseDisplayToSatoshis`, so a comma-decimal locale (e.g. de-DE)
1682
+ could not type a fractional fiat amount at all — every comma keystroke
1683
+ failed the mask and was silently dropped, and `parseFloat` only ever
1684
+ recognises `.` besides. `core/amountFormatHelpers.ts` gains
1685
+ `decimalSeparator()` (re-exported from the package root), derived from
1686
+ `Intl.NumberFormat(locale).formatToParts(1.1)` rather than hardcoded;
1687
+ `AmountInput`'s input mask and `parseDisplayToSatoshis` both use it to build
1688
+ the allowed pattern and to normalize typed text to `.` before `parseFloat`.
1689
+ BSV's integer mode (`fractionDigits === 0`) is untouched — it has no decimal
1690
+ point to begin with.
1691
+
1692
+ ### `setMockDriver` refuses outside `__DEV__`
1693
+
1694
+ `setMockDriver` had no gate of its own — only its `devMock.ts` wrapper
1695
+ checked `__DEV__` before calling it — so any code with JS execution in a
1696
+ nominally-production bundle could call it directly and make
1697
+ `getVaultDriver()` prefer a software mock over real hardware, skipping all
1698
+ native attestation. It is now a no-op outside `__DEV__`. `jest-expo` sets
1699
+ `__DEV__=true`, so the existing mock-driver test suites are unaffected.
1700
+
1701
+ ### `LocalStorageAdapter` removed (breaking)
1702
+
1703
+ `core/storage/LocalStorageAdapter.ts` and its `core/index.ts` exports —
1704
+ `initializeLocalStorage`, `isLocalStorage`, `getStorageDisplayName`, and the
1705
+ `LocalStorageConfig` type — are deleted. It never passed `identityKey` into
1706
+ the `StorageExpoSQLite` constructor it wrapped, so every identity would have
1707
+ collided on `wallet-default-<chain>net.db` had it ever been used, and a
1708
+ repo-wide search found no real caller: the live `WalletContext` path already
1709
+ passes both `identityKey` and an explicit `databaseName` directly to
1710
+ `StorageExpoSQLite`. **Breaking only for a host that imported these names
1711
+ directly** — nothing in this app's own code depended on them.
1712
+
1713
+ ### New i18n keys, and a corrected export explainer
1714
+
1715
+ 15 new keys, in all 12 languages: `local_pay_received_confirming`,
1716
+ `local_pay_received_not_credited`, `local_pay_decline_broadcast_title`,
1717
+ `local_pay_decline_broadcast_body`, `local_pay_cancel_unverifiable_title`,
1718
+ `local_pay_cancel_unverifiable_body`, `local_pay_cancel_unverifiable_confirm`,
1719
+ `recovery_replace_wallet_title`, `recovery_replace_wallet_body`,
1720
+ `recovery_replace_wallet_confirm`, `pay_address_network_mismatch`,
1721
+ `pay_trust_handle_domain_attested`, `vault_resolve_held_deposit_action`,
1722
+ `vault_resolve_held_deposit_done`, `vault_resolve_held_deposit_failed`.
1723
+ Non-English copy is machine-drafted and awaits native-speaker review, same
1724
+ as every previous translation batch in this changelog.
1725
+
1726
+ `vault_export_explainer` is also corrected in all 12 locales: it claimed the
1727
+ vault salt lives in the locking script, which is false (the script commits
1728
+ only to `HASH160(salt||table)`; the salt itself is witness-only) and
1729
+ directly contradicted `vault_first_deposit_body` five keys later in the same
1730
+ file.
1731
+
1732
+ ### App-side notes for a host
1733
+
1734
+ - `app.json`'s `expo.android.allowBackup` is now explicitly `false`. Expo's
1735
+ own default (`true`) let Android's Auto-Backup-for-Apps copy the
1736
+ plaintext SQLite database — which holds every vault output's salt in
1737
+ `customInstructions` — off-device on an OS-initiated backup with no user
1738
+ action. The app's own encrypted backup system is unaffected by this; a
1739
+ host forking this `app.json` should carry the same setting.
1740
+ - The vendored `patches/@bsv+wallet-toolbox-mobile+2.14.0.patch` changed
1741
+ (see the Vault section above): three funding-plan exemption conditions in
1742
+ `makeFundingParams` moved from a `'vault-deposit'` label check to
1743
+ `vargs.__bsvVaultAdminAuthorized === true`. `npm install` picks up the
1744
+ regenerated patch automatically via `patch-package` for anyone installing
1745
+ this package fresh; a host that vendors its own copy of this patch
1746
+ outside the normal install path needs to regenerate it the same way.
1747
+
1748
+ ## 0.7.0
1749
+
1750
+ 0.6.0 was tagged in this file but never published to npm. Hosts upgrading from
1751
+ 0.5.0 should read both sections.
1752
+
1753
+ ### @bsv dependency bump (breaking for hosts)
1754
+
1755
+ Peer ranges move to `@bsv/sdk` ^2.8.2, `@bsv/wallet-toolbox-mobile` ^2.14.0,
1756
+ `@bsv/message-box-client` ^2.5.3, `@bsv/templates` ^1.10.3,
1757
+ `@bsv/btms-permission-module` ^1.2.1 and `@bsv/air-gap` ^0.1.3.
1758
+
1759
+ `@bsv/wallet-toolbox-mobile` now ships as one bundle whose exports map exposes
1760
+ only its root, so this package imports everything from the root. Types the
1761
+ toolbox exports only under its `sdk` namespace come through
1762
+ `core/toolboxTypes.ts`. From 2.14.0 the toolbox exports `WalletMonitorTask`,
1763
+ `attemptToPostReqsToNetwork`, `parseJsonRpc`, `stringifyJsonRpc` and
1764
+ `verifyUnlockScripts` itself, and ships the permissions-manager sendMax fix,
1765
+ the relinquish and internalize basket checks and best-effort Monitor
1766
+ subscriptions, so none of that is patched any more.
1767
+
1768
+ Hosts must carry this repo's two remaining `patches/` for those exact
1769
+ versions: `@bsv+sdk+2.8.2.patch` (native secp256k1 and transaction-engine
1770
+ routing) and `@bsv+wallet-toolbox-mobile+2.14.0.patch` (the Vault authorization
1771
+ hooks, the Vault deposit funding plan, batched native key derivation and shadow
1772
+ engine verification). The `@bsv/message-box-client` and `@bsv/templates`
1773
+ patches are gone: 2.5.3 reports a send failure as
1774
+ `Message Box send failed with HTTP 400 (ERR_DUPLICATE_MESSAGE).`, which
1775
+ `isDuplicateMessageError` recognises, and both packages' CommonJS builds load
1776
+ under Node again.
1777
+
1778
+ - `ADMIN_ORIGINATOR` is now `internal-admin.bsv-wallet.invalid`. @bsv/sdk 2.8
1779
+ accepts only canonical hostnames as originators, so the old
1780
+ `urn:bsv-wallet:internal-admin` label rejected every internal wallet call.
1781
+ `parseExternalOrigin` refuses the whole `.invalid` TLD, and pending aborts
1782
+ queued under the old label replay under the new one
1783
+ (`LEGACY_ADMIN_ORIGINATOR`).
1784
+ - `OfflineFirstChaintracks` takes an optional third `chain` argument and
1785
+ answers `getChain` from it, and forwards the remote's `supportsReorgEvents`,
1786
+ so the toolbox Monitor does not subscribe through the HTTP client at all. A
1787
+ subscription that fails anyway resolves to an inert id instead of throwing,
1788
+ so the Monitor's subscriptions settle once instead of failing, and fetching
1789
+ the chain over the network, on every tick while offline.
1790
+ - Header validation uses the toolbox's `validateHeaderProofOfWork`, which
1791
+ checks the compact target encoding and honours its consensus exceptions.
1792
+
1793
+ ### Transaction detail and activity words (breaking for direct callers)
1794
+
1795
+ - Tapping an activity row opens a full-screen transaction detail view, pushed
1796
+ in from the right, instead of expanding the row in place. The utilities that
1797
+ used to unfold under a row live in the view's overflow menu. New `ui`
1798
+ exports: `TransactionDetailScreen` (default) with its `TransactionDetailParams`
1799
+ and `TransactionAction` types, and `SlideOverFromRight` (default, props
1800
+ `{ visible, onClosed?, children }`). `ActivityRow` takes an optional
1801
+ `onOpen?: (action: ActivityAction) => void`; when given, a tap calls it and
1802
+ the old inline expansion is not rendered. Its `token` prop gains an optional
1803
+ `status?: TxStatusView`.
1804
+ - The detail view's headline is the exact satoshi count the transaction moved,
1805
+ never shortened or converted to BSV. When the display currency is fiat, the
1806
+ fiat amount is a separate line beneath it. A `Block` row shows the block
1807
+ height from local storage (one-row query, no network); an unproven
1808
+ transaction reads "Waiting for a block." `StorageExpoSQLite` gains
1809
+ `getProvenTxHeight(txid): Promise<number | null>`.
1810
+ - A BSV row says what it did from the moment it is handed to the network:
1811
+ `completed`, `unproven` and `sending` all read "Sent" or "Received" instead
1812
+ of "Confirmed", "Accepted" and "Broadcasting". An outgoing action that no
1813
+ Pay / Get paid rail made (no `peerpay`, `localpay`, `legacy` or `mandala`
1814
+ label: a connected app or the wallet itself) reads "Spent". Vault deposits,
1815
+ withdrawals and relocks read "Transferred" in either direction.
1816
+ - `txStatusView(status, offlineStatus?, incoming?, labels?)` takes two new
1817
+ optional arguments. **A host calling it directly must pass `incoming` (and
1818
+ `labels`)**: without them, `completed`, `unproven` and `sending` now resolve
1819
+ to "Spent". New exports from `ui/txStatus.ts`: `activityKind(incoming,
1820
+ labels)`, the one place a row's word is decided, returning the new
1821
+ `ActivityKind` (`'sent' | 'received' | 'spent' | 'transferred'`), and
1822
+ `isPaymentAction(labels)`.
1823
+ - Token (Mandala) rows use the same words: "Sent" or "Received" once settled,
1824
+ "Pending" while settling. Only `refused`, `reversed` and `stuck` keep their
1825
+ own word. New `ui` export `tokenRowStatusView(status, incoming)`.
1826
+ - A row shows its status dot only when its tone is not the quiet settled one
1827
+ (in flight, needs attention, failed), so a normal history is no longer a
1828
+ column of dots.
1829
+
1830
+ ### Activity filter and search
1831
+
1832
+ - A filter button beside Export opens a search field with All / Sent /
1833
+ Received / Spent / Transferred chips; the list narrows as the user types or
1834
+ picks a chip. Search matches every typed word, in any order, case- and
1835
+ accent-insensitive, against the row's note (or the name recorded at send)
1836
+ and a saved contact's name and handle for its counterparty. It is local only:
1837
+ no network lookups, so a non-contact's handle is found only if the note says
1838
+ it. A leading `@` is ignored. While a filter is active the list pages into
1839
+ older history, and "No matching activity" shows only once history is
1840
+ exhausted. Closing the panel clears the search and resets to All.
1841
+ - The Export button reads "Export" (`tx_export`); its accessibility label is
1842
+ still `tx_export_csv`. CSV export ignores the filter and writes the full
1843
+ history.
1844
+
1845
+ ### Amounts
1846
+
1847
+ - New `core` exports: `formatSatoshisExact(satoshis, showPlus?)`, the exact
1848
+ satoshi count for the detail view; `splitAmountFraction(value)`, which splits
1849
+ a formatted amount so its minor units can be drawn smaller; and
1850
+ `getNumberLocale()`, the device locale every amount formatter prints through.
1851
+ - `AmountFormatOptions` gains an optional `compact`, and `formatSatoshisAsBsv`
1852
+ and `formatSatoshisAsFiat` gain a trailing `compact = false` parameter. With
1853
+ it, large figures shorten to k / M / B (`$1.2k`, `1.5M BSV`), and a value
1854
+ that rounds to 1000 of a unit promotes to the next one. Only activity rows
1855
+ pass it. `abbreviate` still shortens only the unit word ("sats"), as in
1856
+ 0.6.0, so existing calls are unchanged.
1857
+ - Currency symbols come from the toolbox's own table (`$` for USD, AUD, CAD and
1858
+ NZD; `£`, `¥`, `₹`, `₽`, `zł`, `R$`, `Rp`) with `narrowSymbol`, not from
1859
+ whatever the device language implies: a device that printed "US$" or "NZ$"
1860
+ now prints `$`. Where `Intl.NumberFormat` throws (seen on Hermes), the
1861
+ fallback prints that symbol before locale-formatted digits instead of the ISO
1862
+ code ("USD 3.45"). Hosts with snapshot tests on formatted currency should
1863
+ expect the symbol change.
1864
+
1865
+ ### Home screen
1866
+
1867
+ - The balance stays on one line at any length: its type shrinks to fit the
1868
+ available width, down to a 12pt floor, and grows back when a shorter value
1869
+ follows. This replaces `adjustsFontSizeToFit`, which on iOS Fabric ignores
1870
+ `minimumFontScale` and bottoms out at 4pt.
1871
+ - Its minor units are drawn smaller and raised, price-tag style. Abbreviated
1872
+ figures and whole amounts render as one run.
1873
+ - Tapping the balance to switch currency has a descriptive accessibility label
1874
+ naming the destination unit (`wallet_balance_show_in`, e.g. "Show in USD").
1875
+ - Pay and Get paid show their icon beside the label, in pill-shaped buttons.
1876
+ The import-from-backup card's icon sits in a filled circle, with corners
1877
+ concentric with the screen's.
1878
+
1879
+ ### Profile picture
1880
+
1881
+ - The user can pick an icon as their profile picture; Home's profile button
1882
+ shows it, falling back to the previous person glyph when none is chosen.
1883
+ New `core` exports: `getUserAvatarIcon`, `setUserAvatarIcon`,
1884
+ `loadUserAvatarIcon`, `subscribeUserAvatar`, `useUserAvatarIcon`, and the
1885
+ `AvatarIcon` / `AvatarIconFamily` types. New `ui` exports: `UserAvatar`
1886
+ (default), `AvatarGlyph`, `AVATAR_ICON_GROUPS` with the `AvatarIconOption` /
1887
+ `AvatarIconGroup` types, `IconPickerSheet` (default, props
1888
+ `{ visible, onClose }`) and `EditPictureSheet` (default, props
1889
+ `{ visible, options: EditPictureOption[], onClose }`) with
1890
+ `EditPictureOption`.
1891
+
1892
+ ### Handle registry fixes
1893
+
1894
+ - A typed `handle@domain` whose domain is complete in its own right resolves
1895
+ as that domain: `alice@deggen.co` is no longer answered as a prefix of
1896
+ `deggen.com`, which returned every `*@deggen.com` neighbour for an address
1897
+ on someone else's registry.
1898
+ - A half-typed prefix of the pinned domain that matches nothing returns an
1899
+ empty result instead of the "search unavailable" banner.
1900
+ - Registry search results are capped at 10 rows (`MAX_SEARCH_RESULTS`) before
1901
+ any certificate is verified, so an uncapped response from a foreign registry
1902
+ cannot freeze recipient search.
1903
+ - A handle arriving through a deep-linked `/contact/add?handle=…` is checked
1904
+ against the registry for the key it claims before it is written to
1905
+ `cachedHandle`; an unproven one is left blank for the background refresh.
1906
+ - Registry requests bound the response body by the same ~8s deadline as the
1907
+ headers. Writes are serialized, so a stalled body used to block every later
1908
+ write for the life of the process.
1909
+ - An outstanding registration journal takes priority at every entry point
1910
+ (`registerHandle`, `updateProfile`, `changeHandle`), not only on resume, so a
1911
+ retried claim and release can no longer leave the user holding neither
1912
+ handle.
1913
+ - A rollback that finishes on a later launch still names the handle the user
1914
+ tried to claim (`attemptedPaymail` in the pending journal).
1915
+ - Failed writes carry a `code` (`invalid_handle`, `wrong_domain`,
1916
+ `same_handle`, `clock_ahead`). Profile shows `clock_ahead` and `wrong_domain`
1917
+ in the user's language; the other two still show the diagnostic message.
1918
+ - A contact's screen tracks its avatar refresh and registry refresh
1919
+ separately, so a registry lookup no longer suppresses the avatar refresh.
1920
+ - In Pay, a registry display name that contains `@` is not shown as the
1921
+ recipient's name (it falls back to the handle); the review card shows the
1922
+ recipient's `handle@domain` rather than an abbreviated key; identity-search
1923
+ and registry-search errors share one dismissible banner.
1924
+
1925
+ ### Copy and translations
1926
+
1927
+ - 17 new keys, in all 12 languages, none removed: `tx_status_received`,
1928
+ `tx_status_sent`, `tx_status_spent`, `tx_status_transferred`,
1929
+ `tx_status_pending`, `tx_export`, `activity_filter`, `activity_filter_all`,
1930
+ `activity_search_placeholder`, `activity_search_clear`,
1931
+ `activity_filter_no_match`, `wallet_balance_show_in`, `tx_detail_block`,
1932
+ `tx_detail_block_pending`, `profile_handle_clock_ahead`,
1933
+ `profile_handle_wrong_registry`, `profile_display_name_publish_failed`.
1934
+ `tx_status_confirmed`, `tx_status_accepted` and `tx_status_broadcasting` are
1935
+ kept but no longer used by default.
1936
+ - `biometric_advisory_body` is shorter in every language: "Protect your assets
1937
+ with Face ID or your fingerprint".
1938
+
1939
+ ### Fixes
1940
+
1941
+ - `TransactionDetailScreen` loads Ionicons lazily, like the rest of the
1942
+ package, so importing the `ui` barrel under Jest no longer fails on
1943
+ expo-font's ESM.
1944
+
1945
+ ## 0.6.0
1946
+
1947
+ ### Handle registry (breaking)
1948
+
1949
+ Handle registration talks to go-message-box-server's paymail profile registry
1950
+ instead of a certifier that was never deployed. A handle is now
1951
+ `handle@domain`: a self-signed BRC-52 profile certificate the registry stores
1952
+ and anybody can verify. Spec:
1953
+ `docs/superpowers/specs/2026-09-18-handle-registry-client-design.md`.
1954
+
1955
+ Removed exports and configuration:
1956
+
1957
+ - `core/identity/handleCertificate.ts` in full — `HANDLE_CERT_TYPE`,
1958
+ `HandleCertWallet`, `isValidHandleFormat` (the 3-20 rule),
1959
+ `HandleAvailability`, `checkHandleAvailability`, `registerHandle`,
1960
+ `RegisterHandleResult`.
1961
+ - `ToolboxConfig.handleCertifier`, `HandleCertifierConfig`,
1962
+ `getHandleCertifierConfig`. Neither the type nor the getter was on the
1963
+ public barrel; the config key was.
1964
+
1965
+ New:
1966
+
1967
+ - `ToolboxConfig.handleRegistry?: Partial<Record<AppChain, HandleRegistryConfig>>`
1968
+ and `getHandleRegistryConfig(chain)`, both exported from the `core` barrel.
1969
+ Fail-closed: a malformed or half-stated entry reads as no registry. `https`
1970
+ is required except for localhost and RFC 1918 hosts in development.
1971
+ - `mergeContactCache` / `ContactCache` (`core/contacts/contactCache.ts`).
1972
+ - `core/identity/handleRegistry/` — `rules`, `profileCert`, `resolver`,
1973
+ `client`, `registration`. Not on the barrel: the UI in this package is the
1974
+ only consumer, and the surface is still settling.
1975
+
1976
+ Behaviour:
1977
+
1978
+ - The display name is **public** when set: a plaintext field of the profile
1979
+ certificate, and the default name someone sees when they add you. The
1980
+ in-app hint says so, in all 12 languages.
1981
+ - Profile shows `handle@domain`, and the registry — not
1982
+ `profile_registered_handle` — is the source of truth for which handle this
1983
+ key holds, so a restored wallet gets its handle back.
1984
+ - Every write is journaled in `key_value_store` (`profile_handle_pending`) and
1985
+ replayed on the next Profile mount, so a crash, a double tap or a lost
1986
+ response settles to the same state.
1987
+ - Pay's recipient search gains a registry tier between contacts and the
1988
+ overlay, and `RecipientField` shows its loading spinner as a footer instead
1989
+ of replacing the list — the local contacts tier is no longer hidden for the
1990
+ whole debounce.
1991
+ - A query that is a complete `handle@domain` answers that row and nothing
1992
+ else. The registry's own search is a prefix, skeleton and substring search,
1993
+ so a typed address would otherwise be answered with its neighbours and its
1994
+ look-alikes.
1995
+ - `contacts.cachedHandle` has a production writer for the first time: the
1996
+ `handle` route param on `/contact/add` (validated as a paymail — the route
1997
+ is deep-linkable), and `ContactScreen`'s background refresh, which
1998
+ distinguishes "the registry says there is none" from "the registry did not
1999
+ answer" and only clears the column for the first.
2000
+ - A handle is displayed without a prepended `@` wherever it already carries
2001
+ its own domain: Profile, Contacts, a contact, and the Identifier QR screen.
2002
+
3
2003
  ## 0.5.0
4
2004
 
5
2005
  ### 1-of-N YubiKey vault (breaking)