diff --git a/README.md b/README.md index 1a5d266f9..d4d0ade00 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ Wallets and mints `MUST` implement all mandatory specs and `CAN` implement optio | [28][28] | Pay to Blinded Key (P2BK) | [cdk], [cashu-ts][ts] | - | | [29][29] | Batched Mint | [cdk], [cashu-ts][ts] | [Nutshell][py], [cdk-mintd] | | [30][30] | Payment Method: Onchain | [cdk], [cashu-ts][ts], [Cashu.me][cashume] | [cdk-mintd] | +| [XX][XX] | Get Locked Mint Quotes By Pubkey | - | - | #### Wallets @@ -103,3 +104,4 @@ Wallets and mints `MUST` implement all mandatory specs and `CAN` implement optio [28]: 28.md [29]: 29.md [30]: 30.md +[XX]: xx.md diff --git a/xx.md b/xx.md new file mode 100644 index 000000000..a211b2a73 --- /dev/null +++ b/xx.md @@ -0,0 +1,68 @@ +# NUT-XX: 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. + +```http +POST https://mint.host:3338/v1/mint/quote/bolt11/pubkey +``` + +The wallet includes the following `PostMintQuotesByPubkeyRequest` data: + +```json +{ + "pubkeys": , + "pubkey_signatures": +} +``` + +- `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 in the same order as `pubkeys` (64 bytes each) + +For each `pubkey`, the corresponding `pubkey_signatures` entry signs the SHA-256 hash of: + +``` +"Cashu_MintQuoteLookup_v1" || mint_pubkey || pubkey +``` + +`mint_pubkey` is the mint's `pubkey` from its [NUT-06][06] info response, which a mint supporting this NUT **MUST** provide. Fields are concatenated as their UTF-8 string representations. + +The mint **MUST** reject the request unless every signature is valid. + +## Response + +The mint responds with a `PostMintQuotesByPubkeyResponse`: + +```json +{ + "quotes": +} +``` + +Where `MintQuoteResponse` is the quote response type defined in [NUT-04][04]. + +## Settings + +The settings for this NUT are part of the mint info response ([NUT-06][06]): + +```json +{ + "XX": { + "supported": + } +} +``` + +[04]: 04.md +[06]: 06.md +[20]: 20.md +[errors]: error_codes.md