lnurlcash-conformance 0.2.1 → 0.2.2

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
@@ -4,6 +4,18 @@ Semantic versioning. While the LUD-25 draft is unmerged, `0.x` minor bumps
4
4
  may add or tighten checks that a previously-passing mint now fails; pin an
5
5
  exact version if you gate CI on the grade.
6
6
 
7
+ ## 0.2.2 - 2026-08-22
8
+
9
+ - The mock mint publishes `payLink` on a note's informational GET, as the
10
+ reference mint does. That is the way home for a holder who has nothing
11
+ but a note: without it a wallet that only ever received notes cannot
12
+ reach the document carrying the mint's retired signing keys, so a
13
+ correctly announced key rotation is indistinguishable from a substituted
14
+ key. `noteInfoPayLink: false` models a mint that does not publish it, and
15
+ `payLinkOffOrigin: true` is the misbehaviour where a mint points its
16
+ `payLink` at a different origin, nominating a third party to vouch for
17
+ its own key history - a client must ignore that.
18
+
7
19
  ## 0.2.1 - 2026-08-22
8
20
 
9
21
  - The grader ships its own TypeScript declarations. The mock mint had them
@@ -38,7 +38,19 @@ export interface MockMintOptions {
38
38
  verify?: boolean
39
39
  privateKey?: string
40
40
 
41
+ /**
42
+ * Publish `payLink` on a note's informational GET - the way home for a
43
+ * holder who has nothing but the note. On by default, as the reference
44
+ * mint does it.
45
+ */
46
+ noteInfoPayLink?: boolean
47
+
41
48
  // ---- misbehaviour ----
49
+ /**
50
+ * Point `payLink` at a different origin, nominating a third party to
51
+ * vouch for this mint's key history. A client must ignore it.
52
+ */
53
+ payLinkOffOrigin?: boolean
42
54
  /** answer the informational GET with a k1 other than the one queried */
43
55
  echoWrongK1?: boolean
44
56
  /** report a maxWithdrawable that is not what the note is worth */
@@ -70,7 +70,14 @@ const DEFAULTS = {
70
70
  // preimage it serves IS a bearer secret, so an operator needs a real
71
71
  // off switch.
72
72
  verify: true,
73
+ // Publish `payLink` on a note's informational GET, the way home for a
74
+ // holder who has nothing but the note. On by default because the
75
+ // reference mint does it; turn it off for a mint that does not.
76
+ noteInfoPayLink: true,
73
77
  // ---- misbehaviour ----
78
+ // point `payLink` at a DIFFERENT origin, nominating a third party to
79
+ // vouch for this mint's key history. A client must ignore it.
80
+ payLinkOffOrigin: false,
74
81
  // answer the informational GET with a k1 other than the one queried
75
82
  echoWrongK1: false,
76
83
  // report a maxWithdrawable that is not what the note is worth
@@ -673,6 +680,19 @@ export const createMockMint = async (options = {}) => {
673
680
  minWithdrawable: 0,
674
681
  maxWithdrawable: note.amountMsat + opts.lieAboutValue,
675
682
  defaultDescription: 'an LNURLcash note',
683
+ // The way home, as the reference mint publishes it. A holder with
684
+ // nothing but a note can reach the document carrying this mint's
685
+ // terms and its retired signing keys; without it a wallet that only
686
+ // ever received notes cannot tell an announced key rotation from a
687
+ // substituted key, because the document lives under a username the
688
+ // note never mentions.
689
+ ...(opts.noteInfoPayLink
690
+ ? {
691
+ payLink: opts.payLinkOffOrigin
692
+ ? 'https://elsewhere.example/.well-known/lnurlp/mint'
693
+ : `${origin}/.well-known/lnurlp/${opts.username}`
694
+ }
695
+ : {}),
676
696
  mintPubkey: pubkey
677
697
  })
678
698
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lnurlcash-conformance",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Language-neutral conformance vectors, an adversarial mock mint, and a grader for LNURLcash (LUD-25) implementations",
5
5
  "author": "TheCryptoDonkey",
6
6
  "license": "MIT",