@forgesworn/moneyer 0.8.0 → 0.9.0
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 +20 -0
- package/README.md +39 -52
- package/dist/backends/types.js +4 -5
- package/dist/config.d.ts +0 -1
- package/dist/config.js +0 -2
- package/dist/landing.js +2 -2
- package/dist/server.js +26 -42
- package/dist/zap.js +9 -11
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.9.0 - 2026-08-31
|
|
6
|
+
|
|
7
|
+
**LUD-25 comment-bound minting is now unconditional.** Every mint quote must
|
|
8
|
+
carry `comment=hex(sha256(secret))`; missing or malformed comments are
|
|
9
|
+
rejected before invoice creation. The additive `h` field is accepted only
|
|
10
|
+
alongside an identical comment. `MONEYER_REQUIRE_COMMENT` and the
|
|
11
|
+
preimage-backed creation fallback have been removed. Existing notes and
|
|
12
|
+
pre-upgrade database rows remain redeemable.
|
|
13
|
+
|
|
14
|
+
## 0.8.1 - 2026-08-30
|
|
15
|
+
|
|
16
|
+
**Fix: `requireComment` is optional on `MoneyerConfig`.** 0.8.0 added it as a
|
|
17
|
+
required field, which is a breaking change for any consumer constructing a
|
|
18
|
+
config by hand - their `tsc` fails on a flag they never asked for. Absent now
|
|
19
|
+
means off, which is also what LUD-25 still asks for. Caught by notecase's
|
|
20
|
+
typecheck; moneyer's own tests could not see it, since nothing here omits the
|
|
21
|
+
field.
|
|
22
|
+
|
|
3
23
|
## 0.8.0 - 2026-08-30
|
|
4
24
|
|
|
5
25
|
**`MONEYER_REQUIRE_COMMENT` (default off).** Refuses a mint quote that names
|
package/README.md
CHANGED
|
@@ -105,7 +105,6 @@ default, and a variable set to an empty string counts as unset.
|
|
|
105
105
|
| `MONEYER_MIN_SENDABLE_MSAT` | `1000` | smallest payment the mint advertises |
|
|
106
106
|
| `MONEYER_MAX_SENDABLE_MSAT` | `100000000` | largest payment the mint advertises |
|
|
107
107
|
| `MONEYER_MIN_MINT_MSAT` | `1000` | dust floor: the smallest note the mint will strike |
|
|
108
|
-
| `MONEYER_REQUIRE_COMMENT` | `false` | refuse a mint quote that names no output, instead of falling back to a note keyed by the payment preimage. See [comment protection](#comment-protection) |
|
|
109
108
|
| `MONEYER_MAX_K1S` | `21` | most notes one callback may name |
|
|
110
109
|
| `MONEYER_VERIFY` | `true` | the LUD-21 `verify` endpoint. Off means 404 |
|
|
111
110
|
| `MONEYER_WALLET_URL` | | a companion web wallet the mint's site links notes into |
|
|
@@ -318,38 +317,37 @@ non-payment, and the routing budget is still sized against the note.
|
|
|
318
317
|
|
|
319
318
|
## Name the note you are buying
|
|
320
319
|
|
|
321
|
-
Paying a mint invoice mints a
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
payment has it, and LUD-21 `verify` hands it to whoever asks with the
|
|
325
|
-
payment hash, which is written inside the invoice on the payer's screen.
|
|
326
|
-
The draft's answer is for the wallet to claim and rotate the instant the
|
|
327
|
-
invoice settles, which is a foot race the wallet has to keep winning.
|
|
328
|
-
|
|
329
|
-
So a wallet may name the note instead. It chooses the secret first, writes
|
|
330
|
-
it down, and sends `h`, the sha256 of that secret, on the pay callback:
|
|
320
|
+
Paying a mint invoice always mints to a wallet-generated secret. The wallet
|
|
321
|
+
chooses and persists that secret first, then sends its SHA-256 commitment in
|
|
322
|
+
the mandatory LUD-12 comment:
|
|
331
323
|
|
|
332
324
|
```
|
|
333
|
-
GET /p/cb?amount=21000&
|
|
325
|
+
GET /p/cb?amount=21000&comment=<64 hex>
|
|
334
326
|
```
|
|
335
327
|
|
|
336
|
-
The mint credits the note at
|
|
328
|
+
The mint credits the note at that commitment when the invoice settles. The payment
|
|
337
329
|
preimage then buys nothing: it is an ordinary payment proof, which is why
|
|
338
330
|
`verify` goes on serving it. Nobody but the buyer ever knew the secret, so
|
|
339
331
|
there is no race left to run, and no window in which holding the invoice
|
|
340
332
|
is nearly holding the money.
|
|
341
333
|
|
|
342
|
-
`
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
334
|
+
Moneyer's earlier `mintToHash` extension remains additive. A compatible
|
|
335
|
+
wallet repeats the same commitment as `h`; it does not replace `comment`:
|
|
336
|
+
|
|
337
|
+
```
|
|
338
|
+
GET /p/cb?amount=21000&comment=<64 hex>&h=<same 64 hex>
|
|
339
|
+
```
|
|
347
340
|
|
|
348
341
|
The rules:
|
|
349
342
|
|
|
350
|
-
- `
|
|
343
|
+
- `comment` is mandatory and is exactly 64 hex characters, the SHA-256 of
|
|
344
|
+
a 32-byte secret. Missing or malformed comments are refused before an
|
|
345
|
+
invoice exists.
|
|
346
|
+
- When supplied, `h` has the same
|
|
351
347
|
meaning `h` carries on the withdraw callback. Upper case is accepted and
|
|
352
348
|
read as lower case, there too.
|
|
349
|
+
- `comment` and `h` must match. A disagreement is refused rather than
|
|
350
|
+
guessing which output the wallet is watching.
|
|
353
351
|
- A malformed `h` is refused before the mint asks its funding source for
|
|
354
352
|
anything, so a wallet is never left holding a quote the mint was always
|
|
355
353
|
going to reject.
|
|
@@ -373,13 +371,12 @@ The rules:
|
|
|
373
371
|
pinned `mintPubkey`, then confirm its staged note without exporting `k1`.
|
|
374
372
|
- Claiming needs nothing else. `GET /w?k1=<the secret>` brings the note
|
|
375
373
|
into existence as soon as the invoice has settled, with no `verify` poll
|
|
376
|
-
and no preimage involved.
|
|
377
|
-
that does not advertise `mintToHash`.
|
|
374
|
+
and no preimage involved. LUD-21 remains useful settlement evidence.
|
|
378
375
|
- **Persist the secret before asking for the invoice.** Paying and then
|
|
379
376
|
losing the secret is the one way this is worse than the old arrangement,
|
|
380
377
|
and writing it down first removes it entirely.
|
|
381
378
|
|
|
382
|
-
A
|
|
379
|
+
A comment-bound note is also derived-secret friendly: a wallet whose secrets come
|
|
383
380
|
from its seed can restore a note it bought but never claimed, which a note
|
|
384
381
|
whose secret was a preimage could never offer.
|
|
385
382
|
|
|
@@ -443,16 +440,15 @@ that is worth saying plainly.
|
|
|
443
440
|
|
|
444
441
|
## Zap-to-note: a lightning address that pays out as a note
|
|
445
442
|
|
|
446
|
-
A Nostr zap is an ordinary LNURL-pay
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
catches up on its inbox when it powers on will find the note waiting.
|
|
443
|
+
A Nostr zap is an ordinary LNURL-pay and carries no current-LUD-25 output
|
|
444
|
+
commitment. Moneyer therefore serves zap names in the recipient direction.
|
|
445
|
+
A zap to `alice@<host>` gets an invoice with a throwaway preimage; when it
|
|
446
|
+
settles, the mint creates a note with a fresh secret, seals it in a NIP-59
|
|
447
|
+
gift wrap (a kind 2525 rumor, the shape heartwood-esp32 and notecase read)
|
|
448
|
+
to alice's pubkey, leaves it on her NIP-17 inbox relays, and publishes the
|
|
449
|
+
kind 9735 receipt so the zap shows up in her client like any other. A
|
|
450
|
+
hardware wallet that catches up on its inbox when it powers on will find
|
|
451
|
+
the note waiting.
|
|
456
452
|
|
|
457
453
|
Until alice rotates the note, the mint knows its secret. That is the
|
|
458
454
|
position every freshly minted note is in, and it is why wallets rotate on
|
|
@@ -672,30 +668,21 @@ MIT.
|
|
|
672
668
|
|
|
673
669
|
## Comment protection
|
|
674
670
|
|
|
675
|
-
A LUD-25 mint quote
|
|
671
|
+
A current LUD-25 mint quote must carry a LUD-12 `comment` holding
|
|
676
672
|
`hex(sha256(secret))`, naming the note the payment will mint. The note is
|
|
677
673
|
then keyed by the wallet's own `secret`, and the payment preimage redeems
|
|
678
674
|
nothing.
|
|
679
675
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
`MONEYER_REQUIRE_COMMENT=true` refuses an unnamed quote instead, before any
|
|
685
|
-
invoice is issued. Two reasons to want it:
|
|
676
|
+
Moneyer unconditionally refuses a missing or malformed comment before any
|
|
677
|
+
invoice is issued. The former `MONEYER_REQUIRE_COMMENT` switch has been
|
|
678
|
+
removed: allowing the preimage-backed fallback would now violate the draft
|
|
679
|
+
and expose a bearer secret to every routing hop.
|
|
686
680
|
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
- A funding source that settles without producing a preimage - a Spark
|
|
691
|
-
backend, say - has nothing to key a fallback note by at all.
|
|
681
|
+
The rule also supports funding sources that settle without returning a
|
|
682
|
+
preimage. There is no bearer credential to recover from the payment path;
|
|
683
|
+
the wallet already persisted it before asking for the invoice.
|
|
692
684
|
|
|
693
|
-
The
|
|
685
|
+
The compatibility boundary is explicit: a wallet that has never heard of
|
|
694
686
|
LNURLcash sends a bare LUD-06 request and gets an error rather than an
|
|
695
|
-
invoice.
|
|
696
|
-
|
|
697
|
-
`lnurlcash-conformance/docs/COMMENT-IS-MANDATORY.md`.
|
|
698
|
-
|
|
699
|
-
Note that `lnurlcash-conformance` now grades the mandate as required, so
|
|
700
|
-
this mint **fails that suite in its default configuration** and passes with
|
|
701
|
-
`MONEYER_REQUIRE_COMMENT=true`.
|
|
687
|
+
invoice. Existing notes remain ordinary LUD-03 withdraw links and continue
|
|
688
|
+
to redeem normally.
|
package/dist/backends/types.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// The funding source. Every amount is integer milli-satoshis.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
// NIP-47 make_invoice do not, which is why neither can back a mint.
|
|
3
|
+
// createInvoice currently takes a caller-supplied preimage so Moneyer can
|
|
4
|
+
// verify that the returned BOLT-11 commits to the invoice it records and can
|
|
5
|
+
// later provide ordinary LUD-21 settlement proof. The bearer note itself is
|
|
6
|
+
// always keyed by the wallet's mandatory comment commitment.
|
|
8
7
|
// The funding source's immediate answer to the payment attempt was a clean,
|
|
9
8
|
// terminal failure - no route, rejected, expired. Distinct from a dropped
|
|
10
9
|
// connection or timeout, where the payment may still have gone out. Even
|
package/dist/config.d.ts
CHANGED
package/dist/config.js
CHANGED
|
@@ -84,7 +84,6 @@ const contactFromEnv = (env) => {
|
|
|
84
84
|
// that starts with a half-understood configuration is holding other
|
|
85
85
|
// people's money on a misunderstanding.
|
|
86
86
|
export const configFromEnv = (env = process.env) => {
|
|
87
|
-
const requireComment = flag(env.MONEYER_REQUIRE_COMMENT, false);
|
|
88
87
|
const baseFeeMsat = int(env.MONEYER_BASE_FEE_MSAT, 0);
|
|
89
88
|
const feePpm = int(env.MONEYER_FEE_PPM, 0);
|
|
90
89
|
if (feePpm >= 1_000_000) {
|
|
@@ -212,7 +211,6 @@ export const configFromEnv = (env = process.env) => {
|
|
|
212
211
|
maxSendableMsat,
|
|
213
212
|
minMintMsat: int(env.MONEYER_MIN_MINT_MSAT, DEFAULTS.minMintMsat),
|
|
214
213
|
mintFee: baseFeeMsat === 0 && feePpm === 0 ? null : { baseFeeMsat, feePpm },
|
|
215
|
-
requireComment,
|
|
216
214
|
roundFeeToSat: flag(env.MONEYER_ROUND_FEE_TO_SAT, DEFAULTS.roundFeeToSat),
|
|
217
215
|
...(signingKey ? { signingKey: signingKey.toLowerCase() } : {}),
|
|
218
216
|
...(previousSigningPubkeys.length ? { previousSigningPubkeys } : {}),
|
package/dist/landing.js
CHANGED
|
@@ -46,7 +46,7 @@ export const landingPage = (args) => {
|
|
|
46
46
|
<meta charset="utf-8"/>
|
|
47
47
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
48
48
|
<title>${escapeHtml(title)} - an LNURLcash mint</title>
|
|
49
|
-
<meta name="description" content="A moneyer strikes Lightning bearer notes
|
|
49
|
+
<meta name="description" content="A moneyer strikes Lightning bearer notes bound to a secret generated by your wallet."/>
|
|
50
50
|
<style>
|
|
51
51
|
:root{--bg:#0e0f12;--raise:#16181d;--line:rgba(226,233,242,.09);--ink:#eef1f6;--dim:#98a0ac;--accent:#c9ced8;--accent-deep:#8f97a4}
|
|
52
52
|
@media(prefers-color-scheme:light){:root{--bg:#f3f4f6;--raise:#fff;--line:rgba(30,38,50,.12);--ink:#1c2027;--dim:#6b7380;--accent:#6f7784;--accent-deep:#4d545f}}
|
|
@@ -82,7 +82,7 @@ a{color:var(--accent)}
|
|
|
82
82
|
<main>
|
|
83
83
|
<svg class="mark" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 7.6v8.8"/><path d="M15.4 9.4c-.7-1.1-1.9-1.8-3.4-1.8-2 0-3.6 1.1-3.6 2.7 0 3.4 7.2 1.8 7.2 5 0 1.6-1.6 2.7-3.6 2.7-1.5 0-2.7-.7-3.4-1.8"/></svg>
|
|
84
84
|
<div class="disclaimer" role="note"><b>Proof of concept · for developers</b><span>An evaluation mint for the <a href="https://github.com/lnurl/luds/pull/301" rel="noopener noreferrer">draft LNURLcash spec</a>. A note is real bearer value with no protection, no recovery and no guaranteed redemption - <strong>assume you can lose anything you put in.</strong>${config.tosUrl ? ` <a href="${escapeHtml(config.tosUrl)}" rel="noopener noreferrer">Terms</a>` : ''}</span></div>
|
|
85
|
-
<h1>${escapeHtml(title)}<small>An LNURLcash mint.
|
|
85
|
+
<h1>${escapeHtml(title)}<small>An LNURLcash mint. Your wallet commits to its own bearer secret before payment; the Lightning preimage remains payment proof.</small></h1>
|
|
86
86
|
${config.motd ? `<div class="motd"><b>notice</b>${escapeHtml(config.motd)}</div>` : ''}
|
|
87
87
|
<div class="addr"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2 4.5 13.5H11L9.5 22 18 10.5h-6.5L13 2z"/></svg>${escapeHtml(address)}</div>
|
|
88
88
|
<div class="card">
|
package/dist/server.js
CHANGED
|
@@ -231,10 +231,9 @@ export const createMoneyer = async (config, deps = {}) => {
|
|
|
231
231
|
// present, empty included: "never rotated" and "does not
|
|
232
232
|
// implement the field" are different answers.
|
|
233
233
|
previousPubkeys: config.previousSigningPubkeys ?? [],
|
|
234
|
-
//
|
|
235
|
-
//
|
|
236
|
-
//
|
|
237
|
-
// invoice rather than after it has paid one.
|
|
234
|
+
// Additive compatibility signal: this mint accepts `h` alongside the
|
|
235
|
+
// identical mandatory LUD-12 comment, including the receipt vocabulary
|
|
236
|
+
// used by sealed signers. The comment remains the baseline commitment.
|
|
238
237
|
mintToHash: true,
|
|
239
238
|
...(nodeInfo.alias ? { nodeAlias: nodeInfo.alias } : {}),
|
|
240
239
|
...(nodeInfo.uri ? { nodeUri: nodeInfo.uri } : {}),
|
|
@@ -606,43 +605,31 @@ export const createMoneyer = async (config, deps = {}) => {
|
|
|
606
605
|
// `comment`; `h` is this mint's own earlier name for it, kept so the
|
|
607
606
|
// wallets that adopted it keep working.
|
|
608
607
|
//
|
|
609
|
-
//
|
|
610
|
-
//
|
|
611
|
-
//
|
|
612
|
-
//
|
|
613
|
-
// as a failed mint. A malformed `h` is a wallet that meant to name an
|
|
614
|
-
// output and got it wrong, so it still fails loudly rather than
|
|
615
|
-
// quietly minting a note the wallet is not expecting.
|
|
608
|
+
// Current LUD-25 makes the LUD-12 comment the mandatory mint output
|
|
609
|
+
// commitment. Missing or malformed input is refused before asking the
|
|
610
|
+
// funding source for an invoice. `h` remains an additive compatibility
|
|
611
|
+
// field, but it never substitutes for comment.
|
|
616
612
|
const askedComment = q.get('comment')?.trim().toLowerCase() ?? null;
|
|
617
|
-
|
|
613
|
+
if (askedComment === null || !HEX32.test(askedComment)) {
|
|
614
|
+
return fail('a mint quote must name its output with a LUD-12 comment carrying hex(sha256(secret))');
|
|
615
|
+
}
|
|
616
|
+
const commentOutputId = askedComment;
|
|
618
617
|
const askedOutputId = q.get('h')?.trim().toLowerCase() ?? null;
|
|
619
618
|
if (askedOutputId !== null && !HEX32.test(askedOutputId))
|
|
620
619
|
return fail('missing h');
|
|
621
620
|
// A wallet sending both should send the same hash in both; ours does.
|
|
622
621
|
// Disagreement is a bug in the caller, and picking a winner would
|
|
623
622
|
// mint a note under a hash one half of it is not watching for.
|
|
624
|
-
if (
|
|
625
|
-
askedOutputId !== null &&
|
|
623
|
+
if (askedOutputId !== null &&
|
|
626
624
|
commentOutputId !== askedOutputId) {
|
|
627
625
|
return fail('comment and h name different outputs');
|
|
628
626
|
}
|
|
629
|
-
const outputId = commentOutputId
|
|
630
|
-
|
|
631
|
-
// rather than minting a note keyed by the payment preimage. Off by
|
|
632
|
-
// default - LUD-25 line 80 still asks for that fallback - but the
|
|
633
|
-
// fallback note is only as safe as every routing hop's discretion, and
|
|
634
|
-
// a funding source that settles without a preimage has nothing to key
|
|
635
|
-
// one by. Refused here, before any invoice exists, so a wallet never
|
|
636
|
-
// pays for a quote this mint was always going to reject.
|
|
637
|
-
if (config.requireComment && outputId === null) {
|
|
638
|
-
return fail('a mint quote must name its output with a LUD-12 comment carrying hex(sha256(secret))');
|
|
639
|
-
}
|
|
640
|
-
if (outputId !== null && store.outputIdInUse(outputId)) {
|
|
627
|
+
const outputId = commentOutputId;
|
|
628
|
+
if (store.outputIdInUse(outputId)) {
|
|
641
629
|
return fail('Invalid or already spent k1.');
|
|
642
630
|
}
|
|
643
|
-
// The preimage is
|
|
644
|
-
//
|
|
645
|
-
// here, handed to the funding source, never persisted - the store
|
|
631
|
+
// The preimage is payment proof only; comment names the future note.
|
|
632
|
+
// Generated here, handed to the funding source, never persisted - the store
|
|
646
633
|
// keeps hashes only.
|
|
647
634
|
let preimage = bytesToHex(randomBytes(32));
|
|
648
635
|
let paymentHash = hashK1(preimage);
|
|
@@ -689,22 +676,17 @@ export const createMoneyer = async (config, deps = {}) => {
|
|
|
689
676
|
// wallet named. A mint that ignored an unknown parameter would
|
|
690
677
|
// answer without it, and a wallet can tell the two apart before
|
|
691
678
|
// paying rather than by looking for a note afterwards.
|
|
692
|
-
|
|
679
|
+
mintToHash: true,
|
|
693
680
|
// Optional bound-receipt commitment: the exact output and net note
|
|
694
681
|
// value this invoice will mint. It is only offered when /verify can
|
|
695
682
|
// later authenticate settlement with this mint's signing key.
|
|
696
|
-
...(
|
|
683
|
+
...(config.verify && signer
|
|
697
684
|
? { mint: { h: outputId, amount: net } }
|
|
698
685
|
: {}),
|
|
699
|
-
//
|
|
700
|
-
//
|
|
701
|
-
//
|
|
702
|
-
|
|
703
|
-
// learns the preimage from paying the invoice, the way any Lightning
|
|
704
|
-
// wallet already keeps it.
|
|
705
|
-
...(config.verify && outputId !== null
|
|
706
|
-
? { verify: `${origin}/verify/${paymentHash}` }
|
|
707
|
-
: {})
|
|
686
|
+
// Every current-draft mint quote is comment-bound, so the LUD-21
|
|
687
|
+
// preimage is ordinary settlement proof and safe to disclose after
|
|
688
|
+
// settlement.
|
|
689
|
+
...(config.verify ? { verify: `${origin}/verify/${paymentHash}` } : {})
|
|
708
690
|
});
|
|
709
691
|
}
|
|
710
692
|
// ---- LUD-21 verify: mint invoices and melt payments ----
|
|
@@ -728,8 +710,10 @@ export const createMoneyer = async (config, deps = {}) => {
|
|
|
728
710
|
}
|
|
729
711
|
const currentInvoice = store.mintInvoiceByHash(paymentHash);
|
|
730
712
|
const settled = currentInvoice.settled;
|
|
731
|
-
//
|
|
732
|
-
//
|
|
713
|
+
// For current comment-bound quotes this is settlement proof only.
|
|
714
|
+
// Historical pre-cutover unnamed rows used it as the note secret;
|
|
715
|
+
// those already-issued invoices remain redeemable after upgrade.
|
|
716
|
+
// It is fetched live from the funding source and never stored here.
|
|
733
717
|
const preimageHex = settled ? await backend.invoicePreimage(paymentHash) : null;
|
|
734
718
|
return send({
|
|
735
719
|
status: 'OK',
|
package/dist/zap.js
CHANGED
|
@@ -8,19 +8,17 @@ import { wrapEvent } from 'nostr-tools/nip59';
|
|
|
8
8
|
// Zap-to-note: a lightning address on this host that pays out as an
|
|
9
9
|
// LNURLcash note delivered over Nostr.
|
|
10
10
|
//
|
|
11
|
-
// A NIP-57 zap is an ordinary LNURL-pay.
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
// receipt that makes the zap show up in clients.
|
|
11
|
+
// A NIP-57 zap is an ordinary LNURL-pay. Unlike current LUD-25 minting it
|
|
12
|
+
// carries no wallet-chosen output commitment, so a zap name works in the
|
|
13
|
+
// recipient direction instead: its invoice gets a throwaway preimage; on
|
|
14
|
+
// settlement the mint creates a note with a fresh secret of its own,
|
|
15
|
+
// gift-wraps it (NIP-59, kind 2525 rumor) to the name's pubkey, leaves it on
|
|
16
|
+
// their NIP-17 inbox relays, and publishes the kind 9735 receipt that makes
|
|
17
|
+
// the zap show up in clients.
|
|
19
18
|
//
|
|
20
19
|
// Until the recipient rotates the note, the mint knows its secret. That is
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
// paid, which a lightning address always did.
|
|
20
|
+
// why wallets rotate on receipt. The mint also learns who was paid, which a
|
|
21
|
+
// lightning address always did.
|
|
24
22
|
export const NOTE_KIND = 2525;
|
|
25
23
|
export const INBOX_RELAYS_KIND = 10050;
|
|
26
24
|
export const ZAP_REQUEST_KIND = 9734;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forgesworn/moneyer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "An LNURLcash (LUD-25) mint - strikes Lightning bearer notes. Independent implementation, cln/lnd funding sources, SQLite, zero HTTP framework.",
|
|
5
5
|
"author": "TheCryptoDonkey",
|
|
6
6
|
"license": "MIT",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@noble/hashes": "^2.3.0",
|
|
61
61
|
"@scure/base": "^1.2.4",
|
|
62
62
|
"farrier-kit": "^1.1.3",
|
|
63
|
-
"lnurlcash-kit": "^0.
|
|
63
|
+
"lnurlcash-kit": "^0.6.0",
|
|
64
64
|
"nostr-tools": "2.24.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
"@types/node": "^24.0.0",
|
|
71
71
|
"animejs": "^4.0.0",
|
|
72
72
|
"happy-dom": "^20.0.0",
|
|
73
|
-
"lnurlcash-conformance": "^0.
|
|
73
|
+
"lnurlcash-conformance": "^0.5.0",
|
|
74
74
|
"playwright": "^1.62.1",
|
|
75
75
|
"typescript": "^5.7.0",
|
|
76
76
|
"uqr": "^0.1.2",
|