Repository navigation
fix: speak to older mints again, in forms every generation reads (0.25.1) - #104
Merged
Merged
Conversation
Kit 0.20 speaks only LUD-25's renamed wire forms, which mints from before the renames (lnurl-mint, moneyer before 0.12) do not read, so 0.25.0 could not look up, receive, check, rotate, split, merge, send, melt or mint a bearer note at one. A bearer note now goes on the wire in forms every generation reads: looked up by its own ?k1=, each mutation output's 64-hex h under both p1 and h (p2 and h2), a mint quote named as both comment and h, a melt as k1 and pr. A current mint reads either name and requires them to agree. Key-path and script-path notes stay on the kit's forms. A mint that binds quotes only by h (advertising mintToHash) can be added and minted at, provided it confirms mintToHash on the quote. An older mint's certificate over a bearer note's h (hex, or the fixed-HRP cs1) is verified under the rule it was made under, kept from a rotate's sig/sig2, and sent as sig= beside amount=. Graded against moneyer 0.17, moneyer 0.3.1 and the lnurlcash-conformance 0.13.1 mock mint, all in process.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
0.25.0 moved to
@lnurlcash/kit0.20.2, which speaks only LUD-25's renamed wire forms (?p=<cp1>,p1/p2, acp1quotecomment). Mints from before the renames (the reference lnurl-mint, moneyer before 0.12) read none of those, so 0.25.0 could not look up, receive, check, rotate, split, merge, send, melt or mint a bearer note at one.What changes
A bearer note goes on the wire in forms every mint generation reads. Nothing waits for a refusal and retries in another shape; the rule for when that would be allowed is written down in
src/lnurlcash-network.ts.?k1=, which every mint answers (a current one checks the spend in full).hunder bothp1andh(p2andh2). An old mint readshand ignoresp1; moneyer 0.12+ reads either and requires them to agree. The merge batcher counts both names.commentandh. A mint that binds only byh(advertisingmintToHash, nocommentAllowed) can be added again, and must confirmmintToHashon the quote or the invoice is dropped unshown.k1,pr).allowSecretDisclosure, as designed.h, as hex or fixed-HRPcs1(sig/sig2). 0.25.0 refused every certified note from one once its key was pinned, and could never take one offline. For a 64-hexk1these now verify under the rule they were made under, rotates keep them, and they are sent assig=besideamount=. On ack1/cw1they still verify nowhere. This reverses that part of 0.25.0's changelog.ck1,cw1) exist only at current mints and stay on the kit's forms.Tests
test/old-mints.test.tsgrades every bearer-note operation against moneyer 0.17, moneyer 0.3.1 (moneyer-legacy, an npm alias) and lnurlcash-conformance 0.13.1's mock mint (lnurlcash-conformance-0-13). All three run in process, with no real mints and no sats. On main, all 23 old-mint cases fail (and the 6 updated unit and integration tests too) (lookupsNoteUnknownError, mutationsmissing h, a 0.3.1 mint refused byaddMint). On this branch all of them pass. The mock's invoices don't decode as BOLT-11, so the full mint flow there is graded at the wire only.npm run checkis green.