Mint Quote Lookup by Public Key spec fixes - #419
Closed
vnprc wants to merge 2 commits into
Closed
Conversation
The endpoint answers "which quotes does this key own", and a NUT-20 public key locks quotes of any payment method. Scoping the path by method makes a wallet issue one request per method just to enumerate what a single key holds, and leaves it no way to ask for everything. Nothing downstream uses the segment. The signature covers "Cashu_MintQuoteLookup_v1" || mint_pubkey || pubkey, with no method in it, so a method in the path is unauthenticated routing data bound to nothing the wallet proved. And every MintQuoteResponse already carries a `method` field, so a mixed-method response is unambiguous without the URL announcing one. Also state that the response spans every payment method, which the method-scoped path left implicit.
The endpoint is unauthenticated until the signatures verify, so the length of the request decides how much work an anonymous caller can ask the mint to perform: one Schnorr verification per public key, plus a query over the whole set. The mint cannot skip that work, because doing it is how it learns whether the caller is entitled to anything. Without a limit a small request buys arbitrary CPU. Every implementation therefore needs a cap, and with none in the spec each picks its own silently, leaving wallets to discover it by being rejected. NUT-29 already settled this shape for batch minting: an optional `max_batch_size` advertised in the mint's NUT-06 settings, and error 11017 when it is exceeded. Reuse both rather than invent a parallel mechanism. The advertised limit is optional, matching NUT-29, so a mint may keep its cap private as long as it still returns 11017.
Collaborator
|
Can you do it as review comments |
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.
Two amendments to #341, one commit each — commit messages carry the full reasoning.
Drop
{method}from the path. The endpoint answers "what does this key own," and a NUT-20 key locks quotes of any payment method — so the segment forces one request per method and buys nothing. The signature doesn't cover it, and everyMintQuoteResponsealready carries a method field (NUT-04), so a mixed-method response is unambiguous without it.Bound the pubkey count. The mint must verify every signature before it can tell whether the caller is entitled to anything, so request length decides how much work an anonymous caller can demand. Adds a MUST to limit it, error
11017on overflow, and an optionalmax_pubkeysin the NUT-06 settings — the same shape NUT-29 already uses formax_batch_size.