NWC icon

NWC

Interact with Nostr Wallet Connect (NWC) protocol

Overview

This node integrates with the Nostr Wallet Connect (NWC) protocol to interact with Lightning Network wallets. Specifically, the Make Keysend Payment operation allows users to send Lightning payments directly to a destination node's public key without requiring an invoice. This is useful for instant payments where the recipient does not generate an invoice, such as spontaneous or push payments.

Common scenarios include:

  • Sending small or immediate payments to known Lightning node public keys.
  • Tipping or paying services that accept keysend payments.
  • Automating Lightning payments in workflows without needing invoice generation.

Example: Sending 1000 satoshis to a friend's Lightning node by specifying their public key and optionally attaching a memo describing the payment purpose.

Properties

Name Meaning
Amount (sats) The amount to send in satoshis.
Destination The public key of the destination Lightning node to which the keysend payment is sent.
Memo Optional text memo attached to the keysend payment as a TLV record.

Output

The output is a JSON array where each element corresponds to the result of a keysend payment attempt. Each element typically contains details about the payment status returned from the NWC client SDK, such as success confirmation or error information.

If the payment includes binary data, it would be encapsulated within the SDK response, but this node primarily outputs JSON-formatted payment results.

Dependencies

  • Requires an API endpoint URL credential for the Nostr Wallet Connect protocol.
  • Uses the @getalby/lightning-tools package for handling Lightning addresses (not used in keysend but part of the overall node).
  • Uses the @getalby/sdk package to interact with the NWC client.
  • Requires network access to the specified NWC URL endpoint.

Troubleshooting

  • Invalid Destination Public Key: If the destination public key is malformed or incorrect, the payment will fail. Verify the public key format and correctness.
  • Insufficient Balance: Payments may fail if the wallet connected via NWC does not have enough balance.
  • Network Issues: Connectivity problems to the NWC URL can cause errors. Ensure the URL is reachable and credentials are correct.
  • Error Messages: Errors thrown by the SDK are passed through. Common messages might indicate invalid parameters or connection failures.
  • To handle errors gracefully, enable "Continue On Fail" in the node settings to process subsequent items even if one fails.

Links and References

Discussion