pull down to refresh

I highly recommend everyone who wants to use Stacker News with an attached wallet to use a self-custodial lightning wallet with a direct channel. You will not pay any routing fees and you will have a consistent, reliable experience.
I may have spoken too soon, lol.
Last night my computer restarted and when I reopened Alby, I reopened the wallet, but the NWC connection to SN couldn't get re-established. I ultimately had to delete the old NWC connection and start a new one.
I'm curious as to why that might be. The wallet logs didn't show any routing errors or anything, just timeouts on sending/receiving payments.
100 sats \ 5 replies \ @k00b 15 Jan
I've noticed after prior updates to Alby Hub my NWC strings are all invalidated. I think it might be a symptom of Alby Hub being kind of new and them correcting mistakes they made with our older NWC strings when we update. I hope this won't always be the case.
I'm curious as to why that might be. The wallet logs didn't show any routing errors or anything, just timeouts on sending/receiving payments.
NWC strings are doing two things:
  1. giving us permission to do stuff on your node
  2. telling us how to communicate with your node to do that permitted stuff
So, when an NWC string goes bad, it either has to do with those permissions going bad, ie being revoked or expiring, or the way we've been instructed to communicate with your node changing or not working.
Routing and fees are in another layer, let's call it The Lightning Layer, and The NWC Layer sits on top of it doing the things I mentioned above. If The NWC Layer goes bad, it means we can't communicate with The Lightning Layer, and the only indication we have that that's happening is The NWC Layer ignores us and we timeout.
reply
Ok, then I'm reasonably sure the error was related to NWC strings and not Lightning.
What I don't quite understand is that the wallet was working right up til last night. My computer restarted after I went to bed, and it wasn't working after restarting the wallet in the morning. It started working again after I downloaded the new Alby update, deleting my old NWC ones, and making new ones.
reply
30 sats \ 3 replies \ @k00b 15 Jan
Restarting must have invalidate the NWC strings on Alby Hub's end.
The NWC connection isn't persistent or anything, so it wouldn't affect our end. On our end, if you give us an NWC string, whether good or bad, all we can do is sign messages with it and publish them to the relay specified then wait for responses.
Timeouts usually happen when responses don't come back, and responses don't come back when Alby considers the NWC string invalid afaik.
reply
So I guess I'm wondering if/where/when an Alby server sits between my computer and Stacker News?
Because I was running the same version of the Alby software on my computer as the night before, with the same NWC strings that failed in the morning. That shouldn't happen unless restarting somehow changed something on an Alby server somewhere, right?
Edit: Sorry, I know this is probably more a question for Alby. But I'm not really sure how NWC works, so this is all educational to me.
reply
500 sats \ 1 reply \ @k00b 15 Jan
Hmm I'm sure Alby has an explainer somewhere on how NWC works, but here's mine:
  1. Basically, Alby runs a nostr relay - a server with a public ip and a generic API for sending and receiving messages.
  2. When your Hub creates an NWC string, they generate a private key and associate it with the permissions to your lightning node that you specify.
  3. Your NWC string gives SN, or anyone you give the NWC string to, this private key.
  4. Hub listens for encrypted notes sent to Alby's relay where this public/private key is the recipient.
  5. If SN wants an invoice from you, it sends a message signed/encrypted with this private key to alby's relay, then listens for the result.
  6. Your hub, listening, sees the message, and checks if the bearer of that private key has permission to do the requested action.
  7. If it does, Hub performs the requested action, encrypts the result, then sends it to Alby's relay.
  8. SN, listening, now has the invoice it requested.

That shouldn't happen unless restarting somehow changed something on an Alby server somewhere, right?
Restarting more likely changed something on your computer, but it shouldn't have absent a bug or some reason only alby would know. I can't make sense of it.
reply
Interesting. Thanks for the explainer. Yes, I wonder if restarting affected my computer's communication with Alby's nostr relay somehow. That seems to be the most likely culprit.
reply