diff --git a/23.md b/23.md index 64fea463..ab211a35 100644 --- a/23.md +++ b/23.md @@ -16,10 +16,17 @@ For the `bolt11` method, the wallet includes the following specific `PostMintQuo { "amount": , "unit": , - "description": // Optional + "description": , // Optional + "description_hash": // Optional, default false } ``` +If `description_hash` is `true`, `description` **MUST** be present. The mint **MUST** return a BOLT11 invoice containing an `h` tag equal to the SHA-256 hash of the UTF-8 encoded `description` and **MUST NOT** include a `d` tag. This allows the invoice to commit to exact data that is provided to the payer out of band. + +If `description_hash` is `false` or omitted, the existing `description` behavior is unchanged: a mint that supports descriptions includes the value in the invoice's `d` tag. + +Wallets **SHOULD** request a description hash only when the mint advertises support. A mint that cannot produce the requested description hash **MUST** reject the quote request. + The mint responds with a `PostMintQuoteBolt11Response`: ```json @@ -122,7 +129,7 @@ Response: ## Mint Settings -A `description` option **MUST** be set to indicate whether the `bolt11` payment method backend supports providing an invoice description. +A `description` option **MUST** be set to indicate whether the `bolt11` payment method backend supports providing a plaintext invoice description. A `description_hash` option **MUST** be set to indicate whether it supports committing to the supplied description with an invoice description hash. ### Example `MintMethodSetting` @@ -133,7 +140,8 @@ A `description` option **MUST** be set to indicate whether the `bolt11` payment "min_amount": 0, "max_amount": 10000, "options": { - "description": true + "description": true, + "description_hash": true } } ```