upleb.uk

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

summaryrefslogtreecommitdiff
path: root/47.md
diff options
context:
space:
mode:
Diffstat (limited to '47.md')
-rw-r--r--47.md18
1 files changed, 8 insertions, 10 deletions
diff --git a/47.md b/47.md
index 97b06ab..71cd076 100644
--- a/47.md
+++ b/47.md
@@ -48,7 +48,7 @@ If the **wallet service** supports notifications, the info event SHOULD contain
48Both the request and response events SHOULD contain one `p` tag, containing the public key of the **wallet service** if this is a request, and the public key of the **user** if this is a response. The response event SHOULD contain an `e` tag with the id of the request event it is responding to. 48Both the request and response events SHOULD contain one `p` tag, containing the public key of the **wallet service** if this is a request, and the public key of the **user** if this is a response. The response event SHOULD contain an `e` tag with the id of the request event it is responding to.
49Optionally, a request can have an `expiration` tag that has a unix timestamp in seconds. If the request is received after this timestamp, it should be ignored. 49Optionally, a request can have an `expiration` tag that has a unix timestamp in seconds. If the request is received after this timestamp, it should be ignored.
50 50
51The content of requests and responses is encrypted with [NIP04](https://github.com/nostr-protocol/nips/blob/master/04.md), and is a JSON-RPCish object with a semi-fixed structure: 51The content of requests and responses is encrypted with [NIP04](04.md), and is a JSON-RPCish object with a semi-fixed structure:
52 52
53Request: 53Request:
54```jsonc 54```jsonc
@@ -107,7 +107,7 @@ The content of notifications is encrypted with [NIP04](https://github.com/nostr-
107## Nostr Wallet Connect URI 107## Nostr Wallet Connect URI
108**client** discovers **wallet service** by scanning a QR code, handling a deeplink or pasting in a URI. 108**client** discovers **wallet service** by scanning a QR code, handling a deeplink or pasting in a URI.
109 109
110The **wallet service** generates this connection URI with protocol `nostr+walletconnect:` and base path it's hex-encoded `pubkey` with the following query string parameters: 110The **wallet service** generates this connection URI with protocol `nostr+walletconnect://` and base path it's hex-encoded `pubkey` with the following query string parameters:
111 111
112- `relay` Required. URL of the relay where the **wallet service** is connected and will be listening for events. May be more than one. 112- `relay` Required. URL of the relay where the **wallet service** is connected and will be listening for events. May be more than one.
113- `secret` Required. 32-byte randomly generated hex encoded string. The **client** MUST use this to sign events and encrypt payloads when communicating with the **wallet service**. 113- `secret` Required. 32-byte randomly generated hex encoded string. The **client** MUST use this to sign events and encrypt payloads when communicating with the **wallet service**.
@@ -121,7 +121,7 @@ The **client** should then store this connection and use it when the user wants
121 121
122### Example connection string 122### Example connection string
123```sh 123```sh
124nostr+walletconnect:b889ff5b1513b641e2a139f661a661364979c5beee91842f8f0ef42ab558e9d4?relay=wss%3A%2F%2Frelay.damus.io&secret=71a8c14c1407c113601079c4302dab36460f0ccd0ad506f1f2dc73b5100e4f3c 124nostr+walletconnect://b889ff5b1513b641e2a139f661a661364979c5beee91842f8f0ef42ab558e9d4?relay=wss%3A%2F%2Frelay.damus.io&secret=71a8c14c1407c113601079c4302dab36460f0ccd0ad506f1f2dc73b5100e4f3c
125``` 125```
126 126
127## Commands 127## Commands
@@ -201,7 +201,7 @@ Request:
201 "amount": 123, // invoice amount in msats, required 201 "amount": 123, // invoice amount in msats, required
202 "pubkey": "03...", // payee pubkey, required 202 "pubkey": "03...", // payee pubkey, required
203 "preimage": "0123456789abcdef...", // preimage of the payment, optional 203 "preimage": "0123456789abcdef...", // preimage of the payment, optional
204 "tlv_records: [ // tlv records, optional 204 "tlv_records": [ // tlv records, optional
205 { 205 {
206 "type": 5482373484, // tlv type 206 "type": 5482373484, // tlv type
207 "value": "0123456789abcdef" // hex encoded tlv value 207 "value": "0123456789abcdef" // hex encoded tlv value
@@ -237,7 +237,7 @@ Request:
237 "method": "multi_pay_keysend", 237 "method": "multi_pay_keysend",
238 "params": { 238 "params": {
239 "keysends": [ 239 "keysends": [
240 {"id": "4c5b24a351", pubkey": "03...", "amount": 123}, 240 {"id": "4c5b24a351", "pubkey": "03...", "amount": 123},
241 {"id": "3da52c32a1", "pubkey": "02...", "amount": 567, "preimage": "abc123..", "tlv_records": [{"type": 696969, "value": "77616c5f6872444873305242454d353736"}]}, 241 {"id": "3da52c32a1", "pubkey": "02...", "amount": 567, "preimage": "abc123..", "tlv_records": [{"type": 696969, "value": "77616c5f6872444873305242454d353736"}]},
242 ], 242 ],
243 } 243 }
@@ -388,8 +388,7 @@ Request:
388```jsonc 388```jsonc
389{ 389{
390 "method": "get_balance", 390 "method": "get_balance",
391 "params": { 391 "params": {}
392 }
393} 392}
394``` 393```
395 394
@@ -409,8 +408,7 @@ Request:
409```jsonc 408```jsonc
410{ 409{
411 "method": "get_info", 410 "method": "get_info",
412 "params": { 411 "params": {}
413 }
414} 412}
415``` 413```
416 414
@@ -485,7 +483,7 @@ Notification:
485 483
486## Example pay invoice flow 484## Example pay invoice flow
487 485
4880. The user scans the QR code generated by the **wallet service** with their **client** application, they follow a `nostr+walletconnect:` deeplink or configure the connection details manually. 4860. The user scans the QR code generated by the **wallet service** with their **client** application, they follow a `nostr+walletconnect://` deeplink or configure the connection details manually.
4891. **client** sends an event to the **wallet service** with kind `23194`. The content is a `pay_invoice` request. The private key is the secret from the connection string above. 4871. **client** sends an event to the **wallet service** with kind `23194`. The content is a `pay_invoice` request. The private key is the secret from the connection string above.
4902. **wallet service** verifies that the author's key is authorized to perform the payment, decrypts the payload and sends the payment. 4882. **wallet service** verifies that the author's key is authorized to perform the payment, decrypts the payload and sends the payment.
4913. **wallet service** responds to the event by sending an event with kind `23195` and content being a response either containing an error message or a preimage. 4893. **wallet service** responds to the event by sending an event with kind `23195` and content being a response either containing an error message or a preimage.