-
Notifications
You must be signed in to change notification settings - Fork 86
NUT-XX: Get quotes by pubkeys #341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 12 commits
c75351c
a6976af
23e3731
595957a
2d958c8
07e23e9
c729245
fe6e2d0
f274e0f
149eea9
4007c59
dfbf965
e799ab4
6b92ba0
5420db9
10036d9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,60 @@ | ||||||
| # NUT-29: Mint Quote Lookup by Public Key | ||||||
|
|
||||||
| `optional` | ||||||
|
|
||||||
| `depends on: NUT-04, NUT-20` | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| This NUT adds an endpoint for wallets to get all NUT-20 locked mint quotes associated with a set of public keys. Queries require a valid signature from the owner of the corresponding private keys. | ||||||
|
|
||||||
| ## Request | ||||||
|
|
||||||
| To query quotes assigned to a public key, the wallet makes a `POST /v1/mint/quote/{method}/pubkey` request. | ||||||
|
robwoodgate marked this conversation as resolved.
robwoodgate marked this conversation as resolved.
|
||||||
|
|
||||||
| ```http | ||||||
| POST https://mint.host:3338/v1/mint/quote/bolt11/pubkey | ||||||
| ``` | ||||||
|
|
||||||
| The wallet includes the following `PostMintQuotesByPubkeyRequest` data: | ||||||
|
|
||||||
| ```json | ||||||
| { | ||||||
| "pubkeys": <Array[str]>, | ||||||
| "pubkey_signatures": <Array[str]> | ||||||
|
callebtc marked this conversation as resolved.
|
||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| - `pubkeys` is an array of hex-encoded compressed secp256k1 NUT-20 public keys (33 bytes each) | ||||||
| - `pubkey_signatures` is an array of hex-encoded Schnorr signatures on `pubkeys` in the same order (64 bytes each) | ||||||
|
|
||||||
| The wallet **MUST** provide a valid signature in `pubkey_signatures` for each public key in `pubkeys` with the corresponding private key in the same order as the `pubkeys` array. The message to sign is the byte representation of the public key. | ||||||
|
robwoodgate marked this conversation as resolved.
Outdated
robwoodgate marked this conversation as resolved.
Outdated
robwoodgate marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
|
robwoodgate marked this conversation as resolved.
|
||||||
| ## Response | ||||||
|
|
||||||
| The mint responds with a `PostMintQuotesByPubkeyResponse`: | ||||||
|
robwoodgate marked this conversation as resolved.
|
||||||
|
|
||||||
| ```json | ||||||
| { | ||||||
| "quotes": <Array[MintQuoteResponse]> | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
|
robwoodgate marked this conversation as resolved.
|
||||||
| Where `MintQuoteResponse` is the quote response type defined in [NUT-04][04]. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Presumably, each quote will be the shape specified for the method it represents? So maybe a better wording is something like:
Suggested change
|
||||||
|
|
||||||
| ## Settings | ||||||
|
|
||||||
| The settings for this NUT are part of the mint info response ([NUT-06][06]): | ||||||
|
|
||||||
| ```json | ||||||
| { | ||||||
| "29": { | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Same thing here |
||||||
| "supported": <bool> | ||||||
| } | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| [04]: 04.md | ||||||
| [06]: 06.md | ||||||
| [20]: 20.md | ||||||
| [errors]: error_codes.md | ||||||
Uh oh!
There was an error while loading. Please reload this page.