Another hardening release. Decoders, mint responses and saved previews now check field types and sizes, malformed input throws a CTSError instead of a raw TypeError, and a null optional field reads as absent. No API changes, but a few behaviours are worth knowing:
- A NUT-11 tag with a key and no value (eg
["refund"]) now throws, matching Nutshell. - Melt quotes for every method must name the payment target you asked for, as bolt11 already did.
- A bolt11 melt preimage is checked against your own invoice, and reads as
nullif it does not match. OIDCAuthrequests time out after 5 minutes by default (newrequestTimeoutoption).- New:
findLegacyDerivationCollisions()reports legacy keyset ids that share a derivation path.
What's Changed
- fix(crypto): reject key-only NUT-11 tags [backport v4-dev] by @robwoodgate in #1424
- fix(payment-request): omit absent tags from the creqA encoding [backport v4-dev] by @robwoodgate in #1429
- ci: run browser tests in the Playwright image [backport v4-dev] by @robwoodgate in #1443
- fix(payment-request): read a null id and memo as absent in payment payloads [backport v4-dev] by @robwoodgate in #1442
- fix(crypto): require a string message in computeMessageDigest [backport v4-dev] by @robwoodgate in #1441
- fix(amount): require a bigint in the Amount constructor [backport v4-dev] by @robwoodgate in #1440
- fix(utils): check proof field types in verifyReceivedProofs [backport v4-dev] by @robwoodgate in #1439
- fix(wallet): keep proofs skipped by requireDleq in sendOffline [backport v4-dev] by @robwoodgate in #1438
- ci: gate PR checks on lint [backport v4-dev] by @robwoodgate in #1447
- fix(utils): reject malformed token and request input with CTSError [backport v4-dev] by @robwoodgate in #1450
- fix(payment-request): read null optional fields as absent in creqA requests and received proofs [backport v4-dev] by @robwoodgate in #1452
- fix(utils): wrap bech32m encode and decode errors in CTSError [backport v4-dev] by @robwoodgate in #1454
- fix(payment-request): check field types when decoding creqA requests [backport v4-dev] by @robwoodgate in #1457
- fix(utils): check field types when decoding cashuA tokens [backport v4-dev] by @robwoodgate in #1458
- fix(payment-request): read an empty supported-method list as absent [backport v4-dev] by @robwoodgate in #1461
- fix(payment-request): copy arrays in and out of payment requests and their builder [backport v4-dev] by @robwoodgate in #1464
- fix(crypto): keep a private copy of the seed in derivers and wallets [backport v4-dev] by @robwoodgate in #1466
- fix(mint): check that quote responses answer the request [backport v4-dev] by @robwoodgate in #1468
- fix(mint): reject malformed fields in mint responses with CTSError [backport v4-dev] by @robwoodgate in #1470
- fix(wallet): report caller-chosen counters through countersReserved [backport v4-dev] by @robwoodgate in #1474
- fix(wallet): refuse oversized arrays when restoring a saved preview by @robwoodgate in #1477
- fix(mint): reject a non-object melt quote response with a CTSError by @robwoodgate in #1485
- feat(crypto): detect legacy keyset derivation collisions [backport v4-dev] by @robwoodgate in #1488
- chore(deps): bump peter-evans/create-pull-request from 8.1.2 to 8.1.3 in the github-actions group by @dependabot[bot] in #1493
- fix(wallet): keep merged and NIP-07 witnesses within the signature limit [backport v4-dev] by @robwoodgate in #1511
- fix(crypto): apply the secret length limit to every NUT-10 secret [backport v4-dev] by @robwoodgate in #1512
- fix(wallet): check the proof count before other receive work [backport v4-dev] by @robwoodgate in #1513
- fix(mint): read malformed mint info entries as absent [backport v4-dev] by @robwoodgate in #1514
- fix(transport): clamp Retry-After to the timer range [backport v4-dev] by @robwoodgate in #1515
- fix(wallet): bound the keyset count in a KeyChain cache [backport v4-dev] by @robwoodgate in #1516
- fix(wallet): bound blindingFactor digits in saved outputs [backport v4-dev] by @robwoodgate in #1517
- fix(utils): reject malformed proof JSON with CTSError [backport v4-dev] by @robwoodgate in #1518
- fix(wallet): check the melt change count before loading keysets [backport v4-dev] by @robwoodgate in #1519
- fix(wallet): clamp event timer delays to the timer range [backport v4-dev] by @robwoodgate in #1520
- fix(utils): let timers run when yielding between chunks [backport v4-dev] by @robwoodgate in #1521
- fix(wallet): keep the witness on a NUT-10 secret over the length limit [backport v4-dev] by @robwoodgate in #1524
- fix(mint): keep NUT-19 cached endpoints only with a string method and path [backport v4-dev] by @robwoodgate in #1525
- fix(utils): throw CTSError when an nprofile cannot be encoded or decoded [backport v4-dev] by @robwoodgate in #1527
- fix(wallet): split restore requests at max_array_length [backport v4-dev] by @robwoodgate in #1531
- fix(auth): time out OIDC requests, configurable with requestTimeout [backport v4-dev] by @robwoodgate in #1532
- perf(crypto): derive each key once per signP2PKProofs call [backport v4-dev] by @robwoodgate in #1540
- fix(wallet): check for duplicate proofs before the requireDleq filter in sendOffline [backport v4-dev] by @robwoodgate in #1547
- fix(crypto): stop signing a proof once a path has its threshold [backport v4-dev] by @robwoodgate in #1548
- fix(crypto): drop witness entries that are not signatures [backport v4-dev] by @robwoodgate in #1551
- fix(wallet): check the melt preimage against the held quote's invoice [backport v4-dev] by @robwoodgate in #1553
- fix(wallet): keep the held invoice through prepareMelt and the amount check [backport v4-dev] by @robwoodgate in #1555
- chore(v4-dev): release 4.14.0 by @robwoodgate in #1425
Full Changelog: v4.13.1...v4.14.0