Why Nostr? What is Njump?
2024-02-18 09:08:07

justBrian on Nostr: Introducing the "poor man's" wrapped lightning invoice receiver for your zapper node. ...

Introducing the "poor man's" wrapped lightning invoice receiver for your zapper node. This will be a more private way to receive zaps to your own lightning node with nostr:

Going to be most appealing for users of and or other node in a box products.

Step 1:
fire up an lnd or cln lightning node.. open a private channel with Stacker News.. use boltz to swap out 50% of the channel or so for easy sending or receiving balance.

Step 2:
Link your node with an ln address. a few examples for the less technical of how to do so:

- link your lnd node up with the amboss ghst. to ln address via thunderhub.

- follow my guide to link lnd with alby ln address here:
How to Use Alby to Receive Zaps to your own LND Node

-------------------------------------------------------------------------------------------------------------------

The vast majority of users that utilize LN address for receiving bitcoin as tips or zaps appear to be using custodial wallets (most commonly I see Wallet of Satoshi and Alby, but there are others too such as ln.tips or stacker.news). I'm not here to make a judgment on that usage, but there may be users out there that would prefer to cut out the middle man and reduce their counter-party risk. Problem is, hosting a domain and setting up an ln address to receive sats to one's own node is outside of the capabilities or time allowance of most (including this writer). And with that said, I'll present a decent compromise to this issue.

For my very first write-up, I'm going to walk you through the latest thing I've been toying around with. Alby has this cool feature where you can update your Alby ln address to forward sats directly to your LND node. This means any zaps or tips one receives to their Alby ln address are not sitting in your custodial Alby account and are paid directly to your LND node. Disclaimer: Receiving zaps in this fashion can come with some privacy concerns, so if that is a concern of yours then you should probably not use this tool.

As will be the case with most write-ups I do, I am going to walk you through this setup with an LND node running in start9 OS. So, it will likely benefit users of Start 9 OS but I think people will be able to infer where to get the appropriate info from their respective node interfaces as well.

Without further delay, here are the steps to get all set up to receive zaps directly to your node using your @getalby ln address:

1. I'm going to assume you have Alby as a web browser extension all set-up and also have an Alby ln address ([email protected]). If you don't, I'm sure their website (getalby.com) has easy instructions on how to do so. First, you will want to click the 'Manage your web account' link from the web browser extension.



2. Then, you are going to click 'Wallet', and scroll down to 'Update your LND node settings', section looks like this:



3. We need to add the correct macaroon (hex). Don't close out your Alby wallet page as we will be returning to it to input info. As the instructions outline in the image above, we are going to want a macaroon that gives just the permissions necessary for the purposes of this ln address. In order to create the macaroon, I am going to use the Thunderhub service via Start9 OS. Once logged into Thunderhub, go to the 'Tools' page and click 'Bake' in the Macaroon Bakery section.



4. Once you click 'Bake', you will be presented with many options to choose from for the macaroon that you create. Again, we want to only grant the minimum access necessary, so just switch 'Create Invoices' to Yes.



Scroll down and click 'Bake New Macaroon'. A pop-up will appear that displays the macaroon coding. We are going to copy the Hex encoded option for our purposes. Once copied, paste that Hex encoded macaroon into the Macaroon (Hex) field on the getalby wallet page.

5. Next, we are going to grab our Certificate (Hex). Using start9 OS, I am going to go to my LND service, and select 'Properties'



In the properties section, click the eye next to LND Connect REST URL to display the relevant text string. You will see an extremely long string on characters. For our purposes, we need to pull out the cert from this string. Right after the '.onion:8080' portion of the string it says 'cert='. We want to copy the entire string starting right after this = symbol, and copy all the way to right before the Macaroon string starts (include the & symbol right before 'macaroon=...' begins).



Take this copied text and paste into the Certificate (Hex) field found on the Alby wallet page.

6. Finally, we need to obtain the 'REST API host and port or TOR onion URL' info from the Alby wallet page. Using start9 OS, you will return to the LND properties page. Click the eye for the LND Connect REST URL. Copy starting from the beginning of the string of text to '.onion:8080'

Paste the string of text into 'REST API host and port or TOR onion URL' field on the Alby wallet page. Before saving the page, erase the 'lndconnect' portion of the string and replace with 'https'. So the string should be 'https://xxxxxx.onion:8080.



7. Click 'Update Connection' at the bottom of the Alby wallet page. After a few seconds, the page should update with a green bar that displays the following text: 'Successfully updated your connection details.' You should be good to go now!

8. Test out your new feature. Send sats to your getalby address (cannot be from your LND node). Once successfully sent, check your LND node and confirm that the payment was received. You should be set now to receive zaps or sat tips form an LN address directly to your LND node :)

- follow my guide here to use lnbits to link up cln or lnd with ln address here:

Im my previous post, I explained how to use your getalby ln address to receive zaps directly to your LND node. Similarly, there is an additional option that one can utilize to receive zaps directly to your lightning node: lnaddress.com.

Lnaddress.com is a federated lightning address server that you can use to create a custom ln address. Unlike using getalby, lnaddress.com can be used with any lightning implementation (not just LND). For the purposes of this write-up, I am going to use LNBits to connect an lnaddress.com lightning address with my node. And as will be the case with most of my write-ups, I am going to be using @npub126ntw5mnermmj0znhjhgdk8lh2af72sm8qfzq48umdlnhaj9kuns3le9ll OS, so users of that OS will likely find this write-up most useful, but I’m sure people using other node interfaces can infer how to complete this set up as well.

With that said, let’s dive into the step-by-step on how to create your own custom ln address with lnaddress.com and set it up to receive zaps directly to your lightning node:

*Users should have lnbits set up with their lightning node before proceeding.

  1. Go to lnaddress.com. Input your desired username, select ‘Node Backend Type’ = LNBits, and if necessary check the box ‘This is a new lightning address’. Keep this page open in one tab as we will be returning to it to input info.

  2. From your Start9 OS services page, go to your LNBits service. Open the ‘Properties’ page, and in a new tab, open the (Tor) Superuser Account. Page will look like this:

http://usri6wfilambri77iwnapyyme43la4v2hgecoismowluriekrhuvxnid.onion/content/images/2023/10/pic1-1.png

From this LNbits page, you can choose to ‘add a new wallet’ and use that wallet instead of your superuser account. That is up to you but the steps will be the same.

  1. Now, we need to grab the info needed for the ‘Host Protocol + IP or Domain + Port’ field on the lnaddress.com page. On the lnbits page, expand the ‘Api Docs’ field, and the ‘Get Wallet Details’ field found on the right hand side menu. In this ‘Get Wallet Details’ section, you will want to copy some of the URL found in the ‘curl example’ section. Copy ‘http://xxxxxx.onion’ (don’t copy any more!), and paste this into the ‘Host Protocol + IP or Domain + Port’ field found on the lnaddress.com page.

http://usri6wfilambri77iwnapyyme43la4v2hgecoismowluriekrhuvxnid.onion/content/images/2023/10/pic2-1.png

  1. Next, we need to grab the key for your lnbits wallet. From the lnbits page, expand the API docs section found on the right hand side menu. Copy the ‘Invoice/read key’ (make sure to use the invoice/read key and not your Admin key), and paste it into the key field found on the lnaddress.com page. Upon pasting in that last piece of info, click ‘submit’ at the bottom of the page.

  2. If all info was input correctly, your connection will be successful. If successful, you will be brought to a page that looks like this:

http://usri6wfilambri77iwnapyyme43la4v2hgecoismowluriekrhuvxnid.onion/content/images/2023/10/pic3-1.png

You will want to save this secret PIN in case you need to update info in your ln address. You’ll also find a test lightning invoice of 1 sat. Using a wallet not connected to the node we connected to our new ln address, you can test the ln address out by paying the 1 sat test invoice.

Users of Start9 OS might find the following info particularly useful: This ln address via lnaddress.com comes with a couple advantages aside from self-custodial zap receiving:

  • One, you can have a custom ln address username to go with your nym or nostr username. Users of Start9 may be familiar with the ln address one can generate in the btcpay server service. This ln address is not customizable.
  • Two, if you are running a tor only lightning node, you will be able to receive zaps from both tor and clear net lightning nodes. Users of Start9 may be familiar with the ln address one can generate in the btcpay server service. This ln address can only receive zaps from other tor nodes and can’t receive zaps from clear net nodes.

That is it, you should now be all set up with your new ln address hosted on lnaddress.com, and you should be all ready to receive zaps or lightning payments of any kind :)


Step 3: create a stacker news account. in the wallet, attach your ln address and set it up to send sats from the stacker news wallet to your ln address from step 2 automatically.

Step 4: use the stacker news ln address to receive zaps in your nostr profile. Congratulation, you are now receiving zaps to your custodial stacker news acct, and those zaps are fwded to your node automatically, and much more privately than exposing your at home node on nostr.. thus, the poor man's wrapped invoice.

#bitcoin
#lightning
Author Public Key
npub1zf9j8uhkw42q92nczjcctnx3qehm7ru79dl9vd5rc7pakqj9t9rsszq56h