upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/57.md
diff options
context:
space:
mode:
authorPablo Fernandez <pfer@me.com>2023-04-03 16:53:27 +0300
committerGitHub <noreply@github.com>2023-04-03 10:53:27 -0300
commit8b39976e78f90fe766ad7149e250777cddacbb5e (patch)
treef51d876471e863afa3647addc0afb6cf7773bf24 /57.md
parentd74ac8654efeb85bd04555b5c334722394c7326c (diff)
Event-specific zap markers (#402)
Diffstat (limited to '57.md')
-rw-r--r--57.md14
1 files changed, 13 insertions, 1 deletions
diff --git a/57.md b/57.md
index 7887652..17042ea 100644
--- a/57.md
+++ b/57.md
@@ -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
151. 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. 151. 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.
162. 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. 162. 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.
173. 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. 173. 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.
184. 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. 184. 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
171When 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
171Zaps 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. 183Zaps 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.