lnurlcash-kit 0.12.0 → 0.12.1

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
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.12.1 - 2026-09-11
4
+
5
+ - `fetchNoteInfo` compares the mint's echoed `k1` with the one it asked
6
+ about as the note each names (`noteIdOf`), not as strings. One Part 2 note
7
+ has many valid `ck1`s: anyone can turn one into its high-S twin, and its
8
+ holder can re-sign, so a mint echoing another spelling of the same note
9
+ was reported as having handed back a different note. An echo that names no
10
+ note at all is still refused, and a Part 1 secret compares as it always did.
11
+
3
12
  ## 0.12.0 - 2026-09-11
4
13
 
5
14
  **A Part 2 branch rooted in a Nostr key.**
package/README.md CHANGED
@@ -422,8 +422,9 @@ Three things worth knowing:
422
422
  - **`i` is any uint32**, serialised as 4 bytes big-endian, never hardened.
423
423
  lnurl-wallet and lnurl-mint agree on that; the spec does not say.
424
424
 
425
- `test/vectors/part2.json` was generated from lnurl-wallet and checked against
426
- lnurl-mint. It moves into lnurlcash-conformance next.
425
+ The tests grade against lnurlcash-conformance's `vectors/part2.json`, built
426
+ from the primitives there and identical to vectors generated from lnurl-wallet
427
+ and checked against lnurl-mint.
427
428
 
428
429
  **A branch rooted in a Nostr key.** A holder with no BIP-39 words, such as a
429
430
  hardware signer that keeps only its identity key, or a wallet that never made
@@ -431,7 +432,7 @@ any, can still be paid to keys of its own. `deriveNostrAddressNode(secretKey,
431
432
  host)` takes the branch from the key that owns the lightning address:
432
433
  `HMAC-SHA256(key = secret key, msg = "LNURLcash/nostr-seed")`, then the path
433
434
  above unchanged. heartwood-esp32 derives exactly this on the device, graded
434
- against the same `test/vectors/nostr-seed.json`, so its notes come back from
435
+ against the same values as conformance's `vectors/nostr-seed.json`, so its notes come back from
435
436
  its nsec (or the phrase the nsec came from) without the device. This is ours,
436
437
  not LUD-25's; a mint sees an ordinary `cx1` either way.
437
438
 
package/dist/index.js CHANGED
@@ -967,7 +967,8 @@ var fetchNoteInfo = async (url, options = {}) => {
967
967
  requireMintPubkey: opts.requireSignatures
968
968
  });
969
969
  const queried = noteK1(url);
970
- if (queried && body.k1.toLowerCase() !== queried) {
970
+ const echoed = noteIdOf(body.k1);
971
+ if (queried && (echoed === null || echoed !== noteIdOf(queried))) {
971
972
  throw new ProtocolError(
972
973
  "The service echoed back a different k1 than was queried - the note may have been redeemed elsewhere, or the service isn't spec-compliant."
973
974
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lnurlcash-kit",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "LNURLcash (LUD-25) bearer note client for TypeScript - mint, rotate, split, merge, melt, and verify offline",
5
5
  "author": "TheCryptoDonkey",
6
6
  "license": "MIT",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/node": "^26.2.0",
63
- "lnurlcash-conformance": "^0.8.0",
63
+ "lnurlcash-conformance": "^0.9.0",
64
64
  "tsup": "^8.5.0",
65
65
  "typescript": "^5.7.0",
66
66
  "vitest": "^3.0.0"