Skip to content

Mint Quote Lookup by Public Key spec fixes - #419

Closed
vnprc wants to merge 2 commits into
cashubtc:get-quotes-by-pubkeysfrom
vnprc:agent/nutxx-spec-fixes
Closed

Mint Quote Lookup by Public Key spec fixes#419
vnprc wants to merge 2 commits into
cashubtc:get-quotes-by-pubkeysfrom
vnprc:agent/nutxx-spec-fixes

Conversation

@vnprc

@vnprc vnprc commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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 every MintQuoteResponse already 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 11017 on overflow, and an optional max_pubkeys in the NUT-06 settings — the same shape NUT-29 already uses for max_batch_size.

vnprc added 2 commits August 7, 2026 10:16
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.
@github-project-automation github-project-automation Bot moved this to Backlog in nuts Aug 7, 2026
@vnprc vnprc changed the title Agent/nutxx spec fixes Mint Quote Lookup by Public Key spec fixes Aug 7, 2026
@thesimplekid

Copy link
Copy Markdown
Collaborator

#341 (comment)

Can you do it as review comments

@github-project-automation github-project-automation Bot moved this from Backlog to Done in nuts Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants