feat: get locked mint quotes by pubkey - #782
Open
robwoodgate wants to merge 7 commits into
Open
Conversation
3 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #782 +/- ##
==========================================
+ Coverage 95.26% 95.29% +0.03%
==========================================
Files 54 54
Lines 5175 5209 +34
Branches 1284 1291 +7
==========================================
+ Hits 4930 4964 +34
Misses 105 105
Partials 140 140
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
42 tasks
75 tasks
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.
NUT
TODO
isSupported()gating (once nut number assigned)Summary
Implements the draft Mint Quote Lookup by Public Key NUT (wallet side): fetch all NUT-20 locked mint quotes for a set of pubkeys, proving key ownership with BIP340 Schnorr signatures over
SHA256(UTF8("Cashu_MintQuoteLookup_v1" || mint_pubkey || pubkey)).signMintQuoteLookup/verifyMintQuoteLookupSignatureinsrc/crypto/NUT20.ts; verify returns false on malformed input, never throws, matching its siblings.Mint.getMintQuotesByPubkey(method, { pubkeys, pubkey_signatures }): POSTs/v1/mint/quote/{method}/pubkey, requires the{ "quotes": [...] }envelope, validates inputs client-side before any request.Wallet.getMintQuotesByPubkey(privkey | privkey[], method = 'bolt11'): derives compressed pubkeys, signs each against the mint's NUT-06 info pubkey, delegates to the Mint method.All new API is
@experimental.Design notes
pubkeys_signaturesand returns a bare array; this PR follows the spec text (pubkey_signatures,{"quotes": [...]}) and will disagree with cdk until the two converge.{method}path segment, so each returned quote is normalized by its ownmethodfield, falling back to the path method when absent.isSupported()gating yet. The NUT number is unassigned, so there is no settings key to check; gating and any numbered naming follow once a number lands.