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:
Diffstat (limited to '57.md')
-rw-r--r--57.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/57.md b/57.md
index 6d89620..3f55e57 100644
--- a/57.md
+++ b/57.md
@@ -36,7 +36,7 @@ A `zap request` is an event of kind `9734` that is _not_ published to relays, bu
36In addition, the event MAY include the following tags: 36In addition, the event MAY include the following tags:
37 37
38- `e` is an optional hex-encoded event id. Clients MUST include this if zapping an event rather than a person. 38- `e` is an optional hex-encoded event id. Clients MUST include this if zapping an event rather than a person.
39- `a` is an optional event coordinate that allows tipping parameterized replaceable events such as NIP-23 long-form notes. 39- `a` is an optional event coordinate that allows tipping addressable events such as NIP-23 long-form notes.
40 40
41Example: 41Example:
42 42
@@ -66,7 +66,7 @@ A signed `zap request` event is not published, but is instead sent using a HTTP
66- `nostr` is the `9734` `zap request` event, JSON encoded then URI encoded 66- `nostr` is the `9734` `zap request` event, JSON encoded then URI encoded
67- `lnurl` is the lnurl pay url of the recipient, encoded using bech32 with the prefix `lnurl` 67- `lnurl` is the lnurl pay url of the recipient, encoded using bech32 with the prefix `lnurl`
68 68
69This request should return a JSON response with a `pr` key, which is the invoice the sender must pay to finalize his zap. Here is an example flow in javascript: 69This request should return a JSON response with a `pr` key, which is the invoice the sender must pay to finalize their zap. Here is an example flow in javascript:
70 70
71```javascript 71```javascript
72const senderPubkey // The sender's pubkey 72const senderPubkey // The sender's pubkey
@@ -131,7 +131,7 @@ The following should be true of the `zap receipt` event:
131- The `created_at` date SHOULD be set to the invoice `paid_at` date for idempotency. 131- The `created_at` date SHOULD be set to the invoice `paid_at` date for idempotency.
132- `tags` MUST include the `p` tag (zap recipient) AND optional `e` tag from the `zap request` AND optional `a` tag from the `zap request` AND optional `P` tag from the pubkey of the zap request (zap sender). 132- `tags` MUST include the `p` tag (zap recipient) AND optional `e` tag from the `zap request` AND optional `a` tag from the `zap request` AND optional `P` tag from the pubkey of the zap request (zap sender).
133- The `zap receipt` MUST have a `bolt11` tag containing the description hash bolt11 invoice. 133- The `zap receipt` MUST have a `bolt11` tag containing the description hash bolt11 invoice.
134- The `zap receipt` MUST contain a `description` tag which is the JSON-encoded invoice description. 134- The `zap receipt` MUST contain a `description` tag which is the JSON-encoded zap request.
135- `SHA256(description)` MUST match the description hash in the bolt11 invoice. 135- `SHA256(description)` MUST match the description hash in the bolt11 invoice.
136- The `zap receipt` MAY contain a `preimage` tag to match against the payment hash of the bolt11 invoice. This isn't really a payment proof, there is no real way to prove that the invoice is real or has been paid. You are trusting the author of the `zap receipt` for the legitimacy of the payment. 136- The `zap receipt` MAY contain a `preimage` tag to match against the payment hash of the bolt11 invoice. This isn't really a payment proof, there is no real way to prove that the invoice is real or has been paid. You are trusting the author of the `zap receipt` for the legitimacy of the payment.
137 137
@@ -171,7 +171,7 @@ A client can retrieve `zap receipt`s on events and pubkeys using a NIP-01 filter
171 171
172When an event includes one or more `zap` tags, clients wishing to zap it SHOULD calculate the lnurl pay request based on the tags value instead of the event author's profile field. The tag's second argument is the `hex` string of the receiver's pub key and the third argument is the relay to download the receiver's metadata (Kind-0). An optional fourth parameter specifies the weight (a generalization of a percentage) assigned to the respective receiver. Clients should parse all weights, calculate a sum, and then a percentage to each receiver. If weights are not present, CLIENTS should equally divide the zap amount to all receivers. If weights are only partially present, receivers without a weight should not be zapped (`weight = 0`). 172When an event includes one or more `zap` tags, clients wishing to zap it SHOULD calculate the lnurl pay request based on the tags value instead of the event author's profile field. The tag's second argument is the `hex` string of the receiver's pub key and the third argument is the relay to download the receiver's metadata (Kind-0). An optional fourth parameter specifies the weight (a generalization of a percentage) assigned to the respective receiver. Clients should parse all weights, calculate a sum, and then a percentage to each receiver. If weights are not present, CLIENTS should equally divide the zap amount to all receivers. If weights are only partially present, receivers without a weight should not be zapped (`weight = 0`).
173 173
174```js 174```jsonc
175{ 175{
176 "tags": [ 176 "tags": [
177 [ "zap", "82341f882b6eabcd2ba7f1ef90aad961cf074af15b9ef44a09f9d2a8fbfbe6a2", "wss://nostr.oxtr.dev", "1" ], // 25% 177 [ "zap", "82341f882b6eabcd2ba7f1ef90aad961cf074af15b9ef44a09f9d2a8fbfbe6a2", "wss://nostr.oxtr.dev", "1" ], // 25%