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:
authorfiatjaf_ <fiatjaf@gmail.com>2023-08-09 07:26:51 -0300
committerGitHub <noreply@github.com>2023-08-09 07:26:51 -0300
commit5026747008c0a84c14079c39807296eebd409c36 (patch)
treeadbc9bf9038d776d74ad7fdd62f7b49132f5a1db /57.md
parent9fa9045d19b93f4cbac231bff39558108a6e82ae (diff)
parentce7e6b2100918648ec4341c5fe517d076e8d225c (diff)
Merge branch 'master' into vending-machine
Diffstat (limited to '57.md')
-rw-r--r--57.md14
1 files changed, 9 insertions, 5 deletions
diff --git a/57.md b/57.md
index 438a0f8..ace4a03 100644
--- a/57.md
+++ b/57.md
@@ -126,7 +126,7 @@ When receiving a payment, the following steps are executed:
126 126
127The following should be true of the `zap receipt` event: 127The following should be true of the `zap receipt` event:
128 128
129- The content SHOULD be empty. 129- The `content` SHOULD be empty.
130- The `created_at` date SHOULD be set to the invoice `paid_at` date for idempotency. 130- The `created_at` date SHOULD be set to the invoice `paid_at` date for idempotency.
131- `tags` MUST include the `p` tag AND optional `e` tag from the `zap request`. 131- `tags` MUST include the `p` tag AND optional `e` tag from the `zap request`.
132- The `zap receipt` MUST have a `bolt11` tag containing the description hash bolt11 invoice. 132- The `zap receipt` MUST have a `bolt11` tag containing the description hash bolt11 invoice.
@@ -166,18 +166,22 @@ A client can retrieve `zap receipt`s 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 169### Appendix G: `zap` tag on other events
170 170
171When an event includes a `zap` tag, clients SHOULD calculate the lnurl pay request based on its value instead of the profile's field. An optional third argument on the tag specifies the type of value, either `lud06` or `lud16`. 171When 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`).
172 172
173```json 173```js
174{ 174{
175 "tags": [ 175 "tags": [
176 [ "zap", "pablo@f7z.io", "lud16" ] 176 [ "zap", "82341f882b6eabcd2ba7f1ef90aad961cf074af15b9ef44a09f9d2a8fbfbe6a2", "wss://nostr.oxtr.dev", "1" ], // 25%
177 [ "zap", "fa984bd7dbb282f07e16e7ae87b26a2a7b9b90b7246a44771f0cf5ae58018f52", "wss://nostr.wine/", "1" ], // 25%
178 [ "zap", "460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c", "wss://nos.lol/", "2" ] // 50%
177 ] 179 ]
178} 180}
179``` 181```
180 182
183Clients MAY display the zap split configuration in the note.
184
181## Future Work 185## Future Work
182 186
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. 187Zaps 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.