From 517125da7e9df412c61effa8749bacc6e24c8c45 Mon Sep 17 00:00:00 2001 From: Tony Giorgio <101225832+TonyGiorgio@users.noreply.github.com> Date: Fri, 22 Sep 2023 15:02:11 -0500 Subject: [PATCH] NIP-47 Optional Secret --- 47.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/47.md b/47.md index b6a4f2bc..b1fe4dff 100644 --- a/47.md +++ b/47.md @@ -83,13 +83,15 @@ If the command was successful, the `error` field must be null. 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: - `relay` Required. URL of the relay where the **wallet service** is connected and will be listening for events. May be more than one. -- `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**. +- `secret` Recommended. 32-byte randomly generated hex encoded string. The **client** MUST use this if present to sign events and encrypt payloads when communicating with the **wallet service**. - Authorization does not require passing keys back and forth. - The user can have different keys for different applications. Keys can be revoked and created at will and have arbitrary constraints (eg. budgets). - The key is harder to leak since it is not shown to the user and backed up. - It improves privacy because the user's main key would not be linked to their payments. - `lud16` Recommended. A lightning address that clients can use to automatically setup the `lud16` field on the user's profile if they have none configured. +The **client** MAY generate a 32-byte random secret and store it and uses this secret when it wants to perform an action. The corresponding public key must be passed to the **wallet service** to allow it to authorize the **client**. The **client** MUST only use this secret if the wallet service does not return a different secret to the client. + The **client** should then store this connection and use it when the user wants to perform actions like paying an invoice. Due to this NIP using ephemeral events, it is recommended to pick relays that do not close connections on inactivity to not drop events. ### Example connection string