NUT-XX: add quote offers - #409
Closed
zeugmaster wants to merge 1 commit into
Closed
Conversation
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-XX: Quote Offers
This adds a standardised format for quote offers: a shareable string
(
cquoteA..., CBOR +base64_urlsafelike NUT-18) with which an operator handsa wallet a prepared mint or melt operation — e.g. a cash deposit or withdrawal
at a counter, prepared by an operator connected to the mint through a payment
processor. This complements custom payment methods (#382), where an operation is
often initiated by a counterparty rather than by the wallet.
Motivation
Displaying an existing quote (e.g. as a QR code) would be unsafe: NUT-04
requires quote ids to remain secret between user and mint, and anyone who scans
the code could front-run the mint operation.
How it works
A quote offer contains no quote at all. It encodes the mint URL, operation,
method, unit, amount, and a single-use ticket. The wallet claims the offer
by creating the quote itself via the regular NUT-04/NUT-05 endpoints,
referencing the ticket; first claim wins. No new endpoints are required.
locked to its owner's key. An attacker who scans the offer first can only
create a quote locked to their own key; the payer's claim then fails visibly
and the operator voids the ticket — theft degrades to denial of service.
wallet's own request and never displayed, so it doubles as proof of who
initiated the payment before a payout is handed over.
Also adds error codes
20010and20011for unknown/expired andalready-claimed tickets.
Implementations