diff options
| -rw-r--r-- | 57.md | 14 |
1 files changed, 13 insertions, 1 deletions
| @@ -12,7 +12,7 @@ Having lightning receipts on nostr allows clients to display lightning payments | |||
| 12 | 12 | ||
| 13 | ## Protocol flow | 13 | ## Protocol flow |
| 14 | 14 | ||
| 15 | 1. Client calculates a recipient's lnurl pay request url by decoding their lud06 or lud16 field on their profile according to the [lnurl specifications](https://github.com/lnurl/luds). The client MUST send a GET request to this url and parse the response. If `allowsNostr` exists and it is `true`, and if `nostrPubkey` exists and is a valid BIP 340 public key in hex, the client should associate this information with the user, along with the response's `callback`, `minSendable`, and `maxSendable` values. | 15 | 1. Client calculates a recipient's lnurl pay request url from the `zap` tag on the event being zapped (see Appendix G), or by decoding their lud06 or lud16 field on their profile according to the [lnurl specifications](https://github.com/lnurl/luds). The client MUST send a GET request to this url and parse the response. If `allowsNostr` exists and it is `true`, and if `nostrPubkey` exists and is a valid BIP 340 public key in hex, the client should associate this information with the user, along with the response's `callback`, `minSendable`, and `maxSendable` values. |
| 16 | 2. Clients may choose to display a lightning zap button on each post or on a user's profile. If the user's lnurl pay request endpoint supports nostr, the client SHOULD use this NIP to request a zap receipt rather than a normal lnurl invoice. | 16 | 2. Clients may choose to display a lightning zap button on each post or on a user's profile. If the user's lnurl pay request endpoint supports nostr, the client SHOULD use this NIP to request a zap receipt rather than a normal lnurl invoice. |
| 17 | 3. When a user (the "sender") indicates they want to send a zap to another user (the "recipient"), the client should create a `zap request` event as described in Appendix A of this NIP and sign it. | 17 | 3. When a user (the "sender") indicates they want to send a zap to another user (the "recipient"), the client should create a `zap request` event as described in Appendix A of this NIP and sign it. |
| 18 | 4. Instead of publishing the `zap request`, the `9734` event should instead be sent to the `callback` url received from the lnurl pay endpoint for the recipient using a GET request. See Appendix B for details and an example. | 18 | 4. Instead of publishing the `zap request`, the `9734` event should instead be sent to the `callback` url received from the lnurl pay endpoint for the recipient using a GET request. See Appendix B for details and an example. |
| @@ -166,6 +166,18 @@ A client can retrieve `zap receipts` on events and pubkeys using a NIP-01 filter | |||
| 166 | - The `invoiceAmount` contained in the `bolt11` tag of the `zap receipt` MUST equal the `amount` tag of the `zap request` (if present). | 166 | - The `invoiceAmount` contained in the `bolt11` tag of the `zap receipt` MUST equal the `amount` tag of the `zap request` (if present). |
| 167 | - The `lnurl` tag of the `zap request` (if present) SHOULD equal the recipient's `lnurl`. | 167 | - The `lnurl` tag of the `zap request` (if present) SHOULD equal the recipient's `lnurl`. |
| 168 | 168 | ||
| 169 | ### Appendix G: `zap` tag on zapped event | ||
| 170 | |||
| 171 | When an event includes a `zap` tag, clients SHOULD calculate the lnurl pay request based on it's value instead of the profile's field. An optional third argument on the tag specifies the type of value, either `lud06` or `lud16`. | ||
| 172 | |||
| 173 | ```json | ||
| 174 | { | ||
| 175 | "tags": [ | ||
| 176 | [ "zap", "pablo@f7z.io", "lud16" ] | ||
| 177 | ] | ||
| 178 | } | ||
| 179 | ``` | ||
| 180 | |||
| 169 | ## Future Work | 181 | ## Future Work |
| 170 | 182 | ||
| 171 | Zaps can be extended to be more private by encrypting zap request notes to the target user, but for simplicity it has been left out of this initial draft. | 183 | Zaps can be extended to be more private by encrypting zap request notes to the target user, but for simplicity it has been left out of this initial draft. |