diff options
Diffstat (limited to '47.md')
| -rw-r--r-- | 47.md | 18 |
1 files changed, 8 insertions, 10 deletions
| @@ -48,7 +48,7 @@ If the **wallet service** supports notifications, the info event SHOULD contain | |||
| 48 | Both 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. | 48 | Both 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. |
| 49 | Optionally, 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. | 49 | Optionally, 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 | ||
| 51 | The 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: | 51 | The content of requests and responses is encrypted with [NIP04](04.md), and is a JSON-RPCish object with a semi-fixed structure: |
| 52 | 52 | ||
| 53 | Request: | 53 | Request: |
| 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 | ||
| 110 | The **wallet service** generates this connection URI with protocol `nostr+walletconnect:` and base path it's hex-encoded `pubkey` with the following query string parameters: | 110 | The **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 |
| 124 | nostr+walletconnect:b889ff5b1513b641e2a139f661a661364979c5beee91842f8f0ef42ab558e9d4?relay=wss%3A%2F%2Frelay.damus.io&secret=71a8c14c1407c113601079c4302dab36460f0ccd0ad506f1f2dc73b5100e4f3c | 124 | nostr+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 | ||
| 488 | 0. 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. | 486 | 0. 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. |
| 489 | 1. **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. | 487 | 1. **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. |
| 490 | 2. **wallet service** verifies that the author's key is authorized to perform the payment, decrypts the payload and sends the payment. | 488 | 2. **wallet service** verifies that the author's key is authorized to perform the payment, decrypts the payload and sends the payment. |
| 491 | 3. **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. | 489 | 3. **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. |