@cloak.dev/sdk 0.2.6-staging.4f665f8 → 0.2.6-staging.81e481e

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.
package/CHANGELOG.md CHANGED
@@ -146,6 +146,21 @@ of every confirmed Cloak transaction that the relay indexes once, server side. A
146
146
  * Note Index reads never set the relay clock. Complete pages are immutable and cacheable for a
147
147
  year, so a cached response replays a stale `x-cloak-server-time`; learning from it would date
148
148
  later signed requests in the past.
149
+ * One malformed, crafted or undecryptable entry never aborts a restore or a sync (QA2 F9). A legacy
150
+ viewing key may be public, so anyone could deposit to the owner key derived from it and spend
151
+ that deposit with a chain note under the same key carrying a salt of 0 (or over 96 bits); the
152
+ output-1 conservation path threw on it and every restore passing that key failed, for good.
153
+ Such an entry is now skipped and counted in `stats.skipped` (with a generic warning), and so is
154
+ anything else a matcher throws for one item, and a known-kind item whose body fails its format
155
+ checks while its framing in the page is intact (`parseNoteIndexPage(bytes, expect,
156
+ { skipMalformedItems: true })`, which also reports `skippedMalformed` and each item's
157
+ `itemPositions`). Page-level faults (header, framing, hash chain, head) still fail the run.
158
+ * What a restored note is checked against, precisely: it opens under AES-GCM keyed by HKDF(nk,
159
+ the item's own `comm0`), its commitment recomputes from the opened values, and it sits at its
160
+ leaf in a chain-authenticated tree. The proof-bound `chainNoteHash` is NOT re-checked: an index
161
+ item does not carry it (nor the `extDataHash` its preimage needs), and fetching it would cost RPC
162
+ per transaction. It would add nothing: a chain note written for one transaction never opens
163
+ when the relay pairs it with another, so a mispairing can hide notes but never yield a wrong one.
149
164
 
150
165
  ### Fixed
151
166
 
package/README.md CHANGED
@@ -660,6 +660,9 @@ a tree the chain authenticates. A dishonest relay can hide items; it cannot inje
660
660
  re-point a note. A hidden nullifier can make a spent note look unspent, so spend restored notes
661
661
  through `transact`, `transfer`, `partialWithdraw`, `fullWithdraw` or `swapUtxo`, which run
662
662
  `preflightNullifiers` before proving.
663
+ One malformed or crafted entry (anyone can write a note under a public legacy viewing key) is
664
+ skipped and counted in `stats.skipped`, never fatal; only a broken page, hash chain or head fails
665
+ the run.
663
666
 
664
667
  **The cursor.** JSON, no key material, but it records which index items are the wallet's: store it
665
668
  as privately as the notes, one per wallet and relay origin, and never hand one wallet's cursor to