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. It enables sending satoshis (the smallest unit of Bitcoin) to a lightning address or invoice, creating invoices, looking up invoice details, listing transactions, retrieving wallet info and balance, making keysend payments, and signing messages.

The Send Satoshis operation specifically allows users to send a specified amount of satoshis to either a Lightning address (e.g., user@domain.com) or a BOLT-11 invoice string. If a Lightning address is provided, the node first resolves it to an invoice before sending the payment.

Practical examples:

  • Paying a Lightning invoice received from a merchant.
  • Sending funds directly to a friend's Lightning address.
  • Automating payouts by resolving Lightning addresses dynamically.

Properties

Name Meaning
Amount (sats) The amount to send in satoshis (smallest Bitcoin unit).
Recipient The destination for the payment: either a Lightning address (e.g., user@domain.com) or a BOLT-11 invoice string.
Description Optional text describing the payment; used as a comment or memo attached to the payment.

Output

The node outputs a JSON array where each element corresponds to the result of processing one input item.

For the Send Satoshis operation, the output JSON object contains the response from the payment attempt via the NWC client. This typically includes payment status details such as success confirmation, payment hash, preimage, or error information if the payment failed.

No binary data output is produced by this operation.

Dependencies

  • Requires access to a Nostr Wallet Connect (NWC) compatible wallet endpoint URL, provided as a credential.
  • Uses the @getalby/lightning-tools package to resolve Lightning addresses.
  • Uses the @getalby/sdk package to interact with the NWC protocol.
  • Requires network connectivity to the Lightning wallet service supporting NWC.

Troubleshooting

  • Common issues:

    • Invalid recipient format: Ensure the recipient is a valid Lightning address or a correct BOLT-11 invoice string.
    • Payment failures due to insufficient funds or incorrect invoice details.
    • Network or authentication errors connecting to the NWC wallet endpoint.
  • Error messages:

    • Errors returned from the NWC client are passed through. For example, "Invalid invoice" or "Payment failed".
    • If the recipient is a Lightning address but cannot be resolved, the node will throw an error during invoice fetching.
    • To handle errors gracefully, enable "Continue On Fail" in the node settings to capture error messages in the output instead of stopping execution.

Links and References

Discussion