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 <p@f7z.io>2023-10-15 21:30:42 +0300
committerGitHub <noreply@github.com>2023-10-15 21:30:42 +0300
commita482f47ae4c36d38062cd0fd3ee6235e57691673 (patch)
treea16f57208cd3c3ef74237dafcef277f16d70e688 /57.md
parentd9400e1e7b08225aedb6c78b522c5ad07b5198b4 (diff)
parent202e18f2b256646148805880ed58731c1c8b2b9b (diff)
Merge branch 'master' into vending-machine
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 ace4a03..849c869 100644
--- a/57.md
+++ b/57.md
@@ -45,7 +45,7 @@ Example:
45 "kind": 9734, 45 "kind": 9734,
46 "content": "Zap!", 46 "content": "Zap!",
47 "tags": [ 47 "tags": [
48 ["relays", "wss://nostr-pub.wellorder.com"], 48 ["relays", "wss://nostr-pub.wellorder.com", "wss://anotherrelay.example.com"],
49 ["amount", "21000"], 49 ["amount", "21000"],
50 ["lnurl", "lnurl1dp68gurn8ghj7um5v93kketj9ehx2amn9uh8wetvdskkkmn0wahz7mrww4excup0dajx2mrv92x9xp"], 50 ["lnurl", "lnurl1dp68gurn8ghj7um5v93kketj9ehx2amn9uh8wetvdskkkmn0wahz7mrww4excup0dajx2mrv92x9xp"],
51 ["p", "04c915daefee38317fa734444acee390a8269fe5810b2241e5e6dd343dfbecc9"], 51 ["p", "04c915daefee38317fa734444acee390a8269fe5810b2241e5e6dd343dfbecc9"],
@@ -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: 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:
70 70
71```javascript 71```javascript
72const senderPubkey // The sender's pubkey 72const senderPubkey // The sender's pubkey
@@ -78,7 +78,7 @@ const sats = 21
78const amount = sats * 1000 78const amount = sats * 1000
79const relays = ['wss://nostr-pub.wellorder.net'] 79const relays = ['wss://nostr-pub.wellorder.net']
80const event = encodeURI(JSON.stringify(await signEvent({ 80const event = encodeURI(JSON.stringify(await signEvent({
81 kind: [9734], 81 kind: 9734,
82 content: "", 82 content: "",
83 pubkey: senderPubkey, 83 pubkey: senderPubkey,
84 created_at: Math.round(Date.now() / 1000), 84 created_at: Math.round(Date.now() / 1000),
@@ -128,7 +128,7 @@ The 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` AND optional `a` 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.
133- The `zap receipt` MUST contain a `description` tag which is the JSON-encoded invoice description. 133- The `zap receipt` MUST contain a `description` tag which is the JSON-encoded invoice description.
134- `SHA256(description)` MUST match the description hash in the bolt11 invoice. 134- `SHA256(description)` MUST match the description hash in the bolt11 invoice.