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

latest release: v4.13.1
pre-releaseone hour ago

This release makes swap previews safe to persist and replay, adds a per-call requestTimeout, and tightens input checks across P2PK, HTLC and payment requests. No API was removed since rc.12, but a few behaviour changes are worth checking before you upgrade.

Upgrading from rc.12: read these even if you never touch a v3 keyset

  • If you persist swap previews for NUT-19 replay, sign them first with wallet.signSwapPreview(preview) and store the signed copy. An unsigned preview still completes, but a P2PK or v3 input signs again on replay, so the request misses the mint’s cache and gets 11001. When that happens, wallet.restoreSwapPreview(preview) gets the proofs back from the preview with NUT-09.

  • Normal sends now swap locked P2PK and HTLC inputs even when the amounts match exactly, so a send can now pay a swap fee where it didn’t before.

  • Offline sends keep each proof’s DLEQ so the receiver can verify offline, which makes tokens bigger. Pass { removeDleq: true } to getEncodedToken if size matters, eg for a QR code.

  • Some input that rc.12 accepted now throws: a P2PK secret with no pubkey in data, an integer tag (eg locktime, n_sigs) with no value, a proof secret that isn’t well-formed UTF-16, and malformed locks passed to isPaymentRequestSatisfied.

  • Mint methods and completeMelt take a per-call requestTimeout, so a Lightning melt can run past a short global timeout. The melt builders’ run() doesn’t forward it, so use prepare() then completeMelt.

v3 keysets

Nutroot is still a draft and v3 keysets are served only by demo mints, so nothing here affects funds on a public mint. A v3 witness signs one transaction, so prepareSwapToSend and prepareMelt now drop any witness already on their inputs. Payment request checks now match nutroot payments to the requested receiver key and pick the proof family by keyset, and a preimage is only attached to the hashlock it opens.


What's Changed

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

Don't miss a new cashu-ts release

NewReleases is sending notifications on new releases.