github cashubtc/cashu-ts v5.0.0-rc.14

pre-releaseone hour ago

Mostly hardening, in step with v4.14.0: stricter type and size checks on tokens, payment requests, mint responses and saved previews, with CTSError thrown for malformed input. Two small breaking changes since rc.13:

  • wallet.spendOptions takes an array of proofs and returns one result per proof. Wrap a single proof: const [options] = wallet.spendOptions([proof]).
  • recoverV3SecretKeys is now async and accepts a signal.

Also worth knowing:

  • Previews record the mint's pubkey, and completing one on a wallet for a different mint throws before any request. Previews saved earlier are not checked.
  • A NUT-11 tag with a key and no value now throws. Refund keys with no locktime read as inert instead of throwing.
  • Melt quotes must name the payment target you asked for, and a bolt11 melt preimage is checked against your own invoice.
  • OIDCAuth requests time out after 5 minutes by default (requestTimeout).
  • P2PK signing and spend checks are much faster with many keys.

v3 keysets

Still draft and demo mints only. This rc follows the latest nutroot review: an onchain melt commits the selected fee_index (needs a mint with the same change), only leaf types the mint lists count (blockedBy: 'unlisted'), and v3 input parsing is stricter.


What's Changed

  • fix(crypto): reject key-only NUT-11 tags by @robwoodgate in #1421
  • ci(codecov): report once both coverage uploads are in by @robwoodgate in #1422
  • ci: run browser tests in the Playwright image by @robwoodgate in #1426
  • docs(crypto): mark the BIP32 quote lock path as recovery only by @robwoodgate in #1417
  • fix(payment-request): omit absent tags from the creqA encoding by @robwoodgate in #1428
  • fix(crypto): read refund keys without a locktime as inert by @robwoodgate in #1427
  • test(payment-request): update the NUT-26 HTLC vector by @robwoodgate in #1430
  • chore(deps): bump the vitest group with 2 updates by @dependabot[bot] in #1431
  • fix(wallet): keep proofs skipped by requireDleq in sendOffline by @robwoodgate in #1433
  • fix(utils): check proof field types in verifyReceivedProofs by @robwoodgate in #1434
  • fix(amount): require a bigint in the Amount constructor by @robwoodgate in #1435
  • fix(crypto): require a string message in computeMessageDigest by @robwoodgate in #1436
  • fix(payment-request): read a null id and memo as absent in payment payloads by @robwoodgate in #1437
  • ci: gate PR checks on lint by @robwoodgate in #1444
  • ci: drop the backport tracking issue job by @robwoodgate in #1445
  • ci: push backport branches with the PAT by @robwoodgate in #1448
  • fix(utils): reject malformed token and request input with CTSError by @robwoodgate in #1449
  • fix(payment-request): read null optional fields as absent in creqA requests and received proofs by @robwoodgate in #1451
  • fix(utils): wrap bech32m encode and decode errors in CTSError by @robwoodgate in #1453
  • fix(payment-request): check field types when decoding creqA requests by @robwoodgate in #1456
  • fix(utils): check field types when decoding cashuA tokens by @robwoodgate in #1455
  • fix(utils): read null spend_info members as absent in cashuA tokens by @robwoodgate in #1459
  • fix(payment-request): read an empty supported-method list as absent by @robwoodgate in #1460
  • fix(wallet): return copies of nested arrays from LockBuilder.toOptions by @robwoodgate in #1462
  • fix(payment-request): copy arrays in and out of payment requests and their builder by @robwoodgate in #1463
  • fix(crypto): keep a private copy of the seed in derivers and wallets by @robwoodgate in #1465
  • fix(mint): check that quote responses answer the request by @robwoodgate in #1467
  • fix(mint): reject malformed fields in mint responses with CTSError by @robwoodgate in #1469
  • fix(wallet): stop polling and loading once the caller aborts by @robwoodgate in #1471
  • fix(wallet): report caller-chosen counters and recovered quote keys through countersReserved by @robwoodgate in #1473
  • docs(restore): note that a scan covers the next unused counters by @robwoodgate in #1475
  • fix(wallet): refuse oversized arrays when restoring a saved preview by @robwoodgate in #1476
  • fix(wallet): check secret length in bytes for every output built by @robwoodgate in #1478
  • feat(wallet): record the mint pubkey on previews and check it at completion by @robwoodgate in #1479
  • fix(mint): reject a non-object melt quote response with a CTSError by @robwoodgate in #1480
  • fix(mint): reject a mint quote whose pubkey is not a string by @robwoodgate in #1481
  • test: add property tests and a nightly high-count run by @robwoodgate in #1482
  • test: pin each input bound at its limit and one past it by @robwoodgate in #1483
  • chore: drop r from the generated NUT-00 batch vector by @robwoodgate in #1484
  • chore: drop the nutshell BLS mint targets by @robwoodgate in #1487
  • chore(deps): bump msw from 3.0.3 to 3.0.5 in the dev-tooling group by @dependabot[bot] in #1492
  • chore(deps): bump vite from 8.3.6 to 8.3.8 in the vitest group by @dependabot[bot] in #1491
  • chore(deps): bump prettier from 3.9.10 to 3.10.1 in the prettier group by @dependabot[bot] in #1490
  • chore(deps): bump the github-actions group with 2 updates by @dependabot[bot] in #1489
  • fix(crypto): check a nutroot tree's leaf count before reading its leaves by @robwoodgate in #1494
  • fix(wallet): keep merged and NIP-07 witnesses within the signature limit by @robwoodgate in #1495
  • fix(crypto): apply the secret length limit to every NUT-10 secret by @robwoodgate in #1496
  • fix(wallet): check the proof count before other receive work by @robwoodgate in #1497
  • fix(mint): read malformed mint info entries as absent by @robwoodgate in #1499
  • fix(transport): clamp Retry-After to the timer range by @robwoodgate in #1500
  • fix(auth): release a pending token body when device polling is cancelled by @robwoodgate in #1501
  • fix(wallet): bound the keyset count in a KeyChain cache by @robwoodgate in #1502
  • fix(wallet): bound blindingFactor digits in saved outputs by @robwoodgate in #1503
  • fix(utils): reject malformed proof JSON with CTSError by @robwoodgate in #1504
  • fix(wallet): check the melt change count before loading keysets by @robwoodgate in #1505
  • fix(wallet): clamp event timer delays to the timer range by @robwoodgate in #1506
  • chore: drop an unused limit and correct NUT-13 doc bounds by @robwoodgate in #1507
  • test: three nutroot vectors from the 443 review round by @robwoodgate in #1508
  • fix(utils): let timers run when yielding between chunks by @robwoodgate in #1510
  • fix(wallet)!: yield during recovery counter scans and accept a signal by @robwoodgate in #1509
  • fix(wallet): keep the witness on a NUT-10 secret over the length limit by @robwoodgate in #1522
  • fix(mint): keep NUT-19 cached endpoints only with a string method and path by @robwoodgate in #1523
  • fix(utils): throw CTSError when an nprofile cannot be encoded or decoded by @robwoodgate in #1526
  • fix(wallet): keep NUT-29 quote checks within max_batch_size by @robwoodgate in #1529
  • fix(wallet): split restore requests at max_array_length by @robwoodgate in #1530
  • fix(auth): time out OIDC requests, configurable with requestTimeout by @robwoodgate in #1528
  • fix(wallet): read the NUT-29 batch size on each quote watch poll by @robwoodgate in #1533
  • chore(docker): update the BLS mint config for current CDK by @robwoodgate in #1535
  • feat(utils): keep unknown spend info fields when re-encoding a token by @robwoodgate in #1536
  • fix(crypto): commit the selected fee index in the melt quote output by @robwoodgate in #1534
  • fix(wallet): keep the fee reserve when persisting melt previews by @robwoodgate in #1537
  • perf(crypto): derive each key once per signP2PKProofs call by @robwoodgate in #1538
  • fix(crypto): read the lock state for each key in signP2PKProofs by @robwoodgate in #1541
  • feat(wallet)!: take an array of proofs in spendOptions by @robwoodgate in #1539
  • fix(crypto): tighten v3 input checks to match the spec by @robwoodgate in #1543
  • perf(nutroot): do one ECDH per key and ephemeral in key trials by @robwoodgate in #1542
  • fix(wallet): check for duplicate proofs before the requireDleq filter in sendOffline by @robwoodgate in #1546
  • fix(crypto): stop signing a proof once a path has its threshold by @robwoodgate in #1545
  • fix(wallet): count only the leaf types a mint lists by @robwoodgate in #1544
  • fix(crypto): drop witness entries that are not signatures by @robwoodgate in #1550
  • fix(wallet): check the melt preimage against the held quote's invoice by @robwoodgate in #1552
  • fix(wallet): keep the held invoice through prepareMelt and the amount check by @robwoodgate in #1554
  • fix(utils): keep unknown spend info fields only from an si map by @robwoodgate in #1558
  • fix(wallet): keep the quote request when persisting melt previews by @robwoodgate in #1559
  • chore(main): release 5.0.0-rc.14 by @robwoodgate in #1423

Full Changelog: v5.0.0-rc.13...v5.0.0-rc.14

Don't miss a new cashu-ts release

NewReleases is sending notifications on new releases.