-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can the NNoster client code use an ongoing wss connection to a nostr relay in an event loop? #63
Comments
Here is the answer:
NIP67 is the name @Kukks has given to code to construct the Network Wallet Connect URI. He has assigned NIP67 one nostr event kind so far: 33194. The static function below in the same file is used for unit tests: What does this mean in practice? I guess Kukks want an extension to NIP47 to include the wallet service can also be discovered by nostr, not just QR code, deeplink or pasting a URI. https://github.com/Kukks/NNostr/blob/master/README.md#relay shows how to add in a nostr relay to BTCPay with the NIP67 extension. So nostr clients that want to use NWC with BTCPay will need to generate a custom event and probably include the BTCPay server as a relay to ensure the event does not get ignored. |
I have changed the title again to reflect comments made at #57 (comment) Using NNoster client code, can btcpay plugins function as nostr clients through a low resource event loop waiting for events from nostr server? |
NIP47 is implmented by the nostr plugin.
NIP47 specifes an implementation must provide a connection URI for nostr clients to use at https://github.com/nostr-protocol/nips/blob/master/47.md#theory-of-operation
I assume the conection URI is then used to build a call to the function below through a nostr relay event:
BTCPayServerPlugins/Plugins/BTCPayServer.Plugins.NIP05/NostrWalletConnectLightningConnectionStringHandler.cs
Line 20 in 5cfe2e5
I cannot find a way to determine the connection URI.
From https://github.com/nostr-protocol/nips/blob/master/47.md#nostr-wallet-connect-uri
Nostr Wallet Connect URI
client discovers wallet service by scanning a QR code, handling a deeplink or pasting in a URI.
The wallet service generates this connection URI with protocol
nostr+walletconnect://
and base path it's hex-encodedpubkey
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.lud16
Recommended. A lightning address that clients can use to automatically setup thelud16
field on the user's profile if they have none configured.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
The text was updated successfully, but these errors were encountered: