-
Notifications
You must be signed in to change notification settings - Fork 87
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
Open
callebtc
wants to merge
16
commits into
main
Choose a base branch
from
get-quotes-by-pubkeys
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 10 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c75351c
feat(NUT-28): Add third-party mint quotes specification
average-gary a6976af
fix: simplify
average-gary 23e3731
shorter, and array of pubkeys
callebtc 595957a
makes no sense
callebtc 2d958c8
remove error codes
callebtc 07e23e9
readme
callebtc c729245
add signatures
callebtc fe6e2d0
rename to xx.md
callebtc f274e0f
Merge branch 'main' into get-quotes-by-pubkeys
callebtc 149eea9
prettier
callebtc 4007c59
Update xx.md
callebtc dfbf965
Update xx.md
callebtc e799ab4
NUT-29: replay-protect pubkey quote lookup signatures
robwoodgate 6b92ba0
refactor: remove timestamp and nonce
robwoodgate 5420db9
Merge pull request #391 from robwoodgate/nut29-replay-protection
thesimplekid 10036d9
Merge branch 'main' into get-quotes-by-pubkeys
robwoodgate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,60 @@ | ||||||
| # NUT-28: 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 | ||||||
| { | ||||||
| "28": { | ||||||
|
callebtc marked this conversation as resolved.
Outdated
|
||||||
| "supported": <bool> | ||||||
| } | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| [04]: 04.md | ||||||
| [06]: 06.md | ||||||
| [20]: 20.md | ||||||
| [errors]: error_codes.md | ||||||
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.
Uh oh!
There was an error while loading. Please reload this page.