NWC icon

NWC

Interact with Nostr Wallet Connect (NWC) protocol

Overview

This node integrates with the Nostr Wallet Connect (NWC) protocol to interact with a Lightning Network wallet. It supports multiple operations such as sending satoshis, creating invoices, listing transactions, retrieving wallet info and balance, making keysend payments, signing messages, and looking up invoices.

The Sign Message operation specifically allows users to cryptographically sign an arbitrary message using their Lightning wallet. This is useful for proving ownership of a wallet or authenticating actions in decentralized applications that support NWC.

Practical examples:

  • A user wants to prove control over their Lightning wallet by signing a challenge message.
  • An application requires a signed message from the user’s wallet to authenticate or authorize certain actions without exposing private keys.
  • Developers testing integrations with Lightning wallets can verify message signing functionality.

Properties

Name Meaning
Message The text message to be signed by the wallet. This is required and should be a string.

Output

The output JSON contains the result of the message signing operation. Typically, this will include the signed message data such as the signature and possibly metadata about the signing process.

Example output structure (conceptual):

{
  "signature": "<signed_message_string>",
  "message": "<original_message>"
}

No binary data output is indicated for this operation.

Dependencies

  • Requires connection to a Nostr Wallet Connect (NWC) compatible wallet via a URL credential.
  • Uses the @getalby/sdk package to create an NWC client instance.
  • Uses @getalby/lightning-tools for handling Lightning addresses when relevant (not directly for signing).
  • Requires the user to provide a valid NWC URL credential configured in n8n.

Troubleshooting

  • Common issues:

    • Invalid or unreachable NWC URL credential may cause connection failures.
    • Providing an empty or invalid message string will likely cause errors.
    • Network or wallet connectivity problems can interrupt signing requests.
  • Error messages:

    • Errors thrown by the underlying SDK or network calls will be surfaced. For example, "Invalid operation" if the operation parameter is incorrect.
    • If the node is set to continue on fail, error messages are returned in the output JSON under an error field.
  • Resolutions:

    • Verify the NWC URL credential is correct and accessible.
    • Ensure the message property is non-empty and properly formatted.
    • Check network connectivity and wallet availability.
    • Enable "Continue On Fail" in the node settings to handle errors gracefully during batch processing.

Links and References

Discussion