Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Wallets and mints `MUST` implement all mandatory specs and `CAN` implement optio
| [26][26] | Payment Request Bech32m Encoding | [cdk] | - |
| [27][27] | Nostr Mint Backup | [Cashu.me][cashume], [cdk] | - |
| [28][28] | Pay to Blinded Key (P2BK) | - | - |
| [XX][XX] | Get Locked Mint Quotes By Pubkey | - | - |

#### Wallets:

Expand Down Expand Up @@ -104,3 +105,4 @@ Wallets and mints `MUST` implement all mandatory specs and `CAN` implement optio
[26]: 26.md
[27]: 27.md
[28]: 28.md
[XX]: xx.md
60 changes: 60 additions & 0 deletions xx.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# NUT-29: Mint Quote Lookup by Public Key
Comment thread
robwoodgate marked this conversation as resolved.
Outdated

`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.
Comment thread
robwoodgate marked this conversation as resolved.
Comment thread
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]>
Comment thread
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.
Comment thread
robwoodgate marked this conversation as resolved.
Outdated
Comment thread
robwoodgate marked this conversation as resolved.
Outdated
Comment thread
robwoodgate marked this conversation as resolved.
Outdated

Comment thread
robwoodgate marked this conversation as resolved.
## Response

The mint responds with a `PostMintQuotesByPubkeyResponse`:
Comment thread
robwoodgate marked this conversation as resolved.

```json
{
"quotes": <Array[MintQuoteResponse]>
}
```

Comment thread
robwoodgate marked this conversation as resolved.
Where `MintQuoteResponse` is the quote response type defined in [NUT-04][04].

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The 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
Where `MintQuoteResponse` is the quote response type defined in [NUT-04][04].
Where `MintQuoteResponse` is the quote response type defined in [NUT-04][04], or an extension of it based on the method the quote relates to.


## Settings

The settings for this NUT are part of the mint info response ([NUT-06][06]):

```json
{
"29": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a new NUT number, NUT-29 is already defined in NUT-29: Batched Minting

Same thing here

"supported": <bool>
}
}
```

[04]: 04.md
[06]: 06.md
[20]: 20.md
[errors]: error_codes.md