moar wallet attachments

sending with NWC and LNBits
You can attach wallets for sending now via @ekzyis. To start we support attaching Nostr Wallet Connect and LNBits. @ekzyis did a lot of work to make the UX as close to familiar as possible and I think it's stellar.
Note: The credentials are stored in the browser, so please set a budget on them. @ekzyis took a lot of care making the browser as safe as we can for storing these, but you'll want to be extra careful anyway.
autowithdraw to LND
In addition to autowithdrawing to a lightning address, you can now autowithdraw to LND. We support connecting to your node over Tor so you should be able to push out funds to your home node even if it doesn't have a public IP.
If you attach LND in addition to a lightning address, you can set a default and if it fails we attempt your other method.
expect more methods soon
There are a lot of wallets and ways to connect them, but we plan to support any method that makes sense as time goes on. We'll likely be adding CLN and Zebedee next.

NSFW territory labels

๐Ÿšจ first time contributor alert
Territories can now be labelled NSFW and are visible on an opt-in basis unless visited directly via @mz.

improvements to domain searching

๐Ÿšจ first time contributor alert
When you search with a url:example.com filter you should see less strict results via @btcbagehot.

bug fixes

  • wonky checkboxes on territory form via @mz
  • pinned posts now really do show up in home via @ekzyis

what's next

  • we have a nearly done nostr crossposting PR via @bitcoinplebdev that allows you to crosspost all post types and will likely be merged soon
  • a variety of territory enhancements
    • @mz is working on a top for territories
    • @byoungdale has a draft going for crossposting
    • I'll work on changing the territory billing period here shortly then sub-territories (unless someone beats me to either)
  • more thorough bolt11 deletion via @dillon will be merged soon
  • lots of random stuff I'm sure
Happy Valentine's!
1891 sats \ 5 replies \ @nout 14 Feb
This could use a short video with a demo! It's hard to understand what is NWC and how does it relate to SN.
reply
I agree! We'll probably need docs for all of this. When I shared our plans for the wallet, @moneyball astutely noted how overwhelming it would be to the average person.
So we'll also want a "wizard" like experience at some point, eg "do you know the difference between custodial and non-custodial?" if yes then "do you run a node?" then "does it have a public IP address?" and so on.
Regardless, we can't expect the average person to stand for that kind of torture so we have a lower friction onramp planned where an attached wallet isn't necessary.
reply
217 sats \ 2 replies \ @ek fwd 14 Feb
Oh, great idea! I'll do one with Mutiny and share it here.1
We also thought about having specific cards for wallets which link to the same setup page if they use the same protocol (like NWC here) but include specific setup guides for these wallets. We could add videos together with some screenshots then there, too :)
Footnotes
  1. Great use case for pinned comments? ๐Ÿ‘€ โ†ฉ
reply
I'll do one with Alby and Mutiny when we deployed this fix: Fix NWC support detection
reply
deployed
reply
Created one now in #428781
reply
612 sats \ 1 reply \ @leo 14 Feb
Very cool! How come some options are either send OR receive? Couldn't LNbits or LND Accounts (over LNC) be both?
reply
Yes! We just need to tease apart permissions so weโ€™re not storing spending perms on the server (without them being encrypted) but still have perms to generate invoices on the server.
Weโ€™ll iterate to these โ€œduplexโ€ permissions eventually.
reply
Mine is stuck on this red light
reply
859 sats \ 1 reply \ @k00b OP 13 Feb
NWC? I don't think we validate the string yet (PR pending). Console say anything interesting?
reply
Yeah for nwc, console didn't have any logs
reply
Great updates, auto-withdraw to LND and adding NWC is pretty wild.......
reply
Great work guys, you're shipping awesome features! I intend to attach my LND and my LNBits. Wondering why it is "non-custodialish"...
reply
21 sats \ 1 reply \ @ek fwd 13 Feb
If it's non-custodial depends on what LNbits or NWC provider you use.
You could be using https://legend.lnbits.com for example or Alby with NWC but in a custodial way.
It's just possible to use it non-custodial.
reply
Oh, I get it. I'll be using it from my Umbrel node.
reply
NWC! LFG. Will set that up with Mutiny tonight to see how it goes. Very nice work!
reply
A few of them have gone through but hard to tell if it's being slow on the SN side or on the Mutiny side. Perhaps someone with alby or lnbits could test out too to see how it goes.
The comments are kind of painful to sit there and wait for. I wish it could just act like it went through but have some pending UI for it.
reply
It could b because we poll on the client for the invoice being paid which probably adds 500ms of latency on average.
Great feedback.
reply
Unfortunately doesn't work for both self-custodial NWC app and Alby hosted NWC
reply
It's meant to work. We probably have a bug.
What errors are you getting in your console?
reply
Uncaught (in promise) EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' 'wasm-unsafe-eval' 'inline-speculation-rules'".
at bakeCollection (content.7f229555.js:2064:98610) at Object.u (content.7f229555.js:2064:93234) at Object.g [as call] (content.7f229555.js:2064:93437) at es.o [as emit] (content.7f229555.js:2064:85238) at es.stop (content.7f229555.js:17:30157) at es.eoseReceived (content.7f229555.js:17:31755) at content.7f229555.js:17:8787 at Array.forEach (<anonymous>) at T.eoseReceived (content.7f229555.js:17:8754) at content.7f229555.js:17:11970
reply
@ekzyis looks like the nostr library violates CSP
reply
Mhh, interesting, I tested NWC when we launched and I could generate NWC requests ๐Ÿค”
reply
I think it might be that the library uses wasm, some browsers probably don't support it, and we allow unsafe-eval-wasm but not unsafe-eval
hard to tell if it's being slow on the SN side or on the Mutiny side.
We poll every second if the invoice was paid, so some slowness is definitely on our side.
The comments are kind of painful to sit there and wait for. I wish it could just act like it went through but have some pending UI for it.
What do you mean? You should see toasts that show if payments are pending.
update: Oh, you mean the toasts in the right bottom corner with comments? no, Tony didn't.
Perhaps someone with alby or lnbits could test out too to see how it goes.
Tested with LNbits: lnbits_zap.mp4
reply
Comment box just sits there if a payment was needed for a reply
reply
Ah, I see. You literally meant "comments" with comments, haha. Makes sense!
reply
He means to just post it optimistically, storing it on backend like a "draft" until it succeeds, which is closer to the ideal (we "absorb" the wait for them). For "failed drafts," we'll probably want to send them a notification. For "successful drafts" we'd do nothing and yay.
reply
937 sats \ 0 replies \ @nout 14 Feb
Yay for optimistic UX. Great latency saver...
reply
but have some pending UI for it.
We could style the text with text-muted while the payment is pending
reply
If anyone wants to learn about NWC, add it to your website or contribute, there's a fresh website: https://nwc.dev/
We also started a Discord for builders integrating NWC (apps and wallets). Join us here: https://discord.gg/PS7EhpyF
reply
937 sats \ 0 replies \ @anon 13 Feb
Can yall build NWC into LNbits though. That is the question ๐Ÿ˜…
reply
457 sats \ 8 replies \ @ek fwd 17 Feb
This video demonstrates how to connect your Mutiny or Alby wallet via NWC with SN:
It should work with any wallet that supports NWC though. Paste the connection string that starts with nostr+walletconnect:// into the NWC input here and you should be good to go!
reply
Super cool! Yeah, I'd say it would be better to switch to optimistic UX - just make it look like it's been zapped immediately and only pop up any dialog when the payment actually fails (it could also just be a SN notification).
reply
We're going to house an abort button on the toast eventually, but should probably make it lower contrast than it currently is.
reply
I guess my question is why is the toast even needed in the success case? Why should user care? In the nostr apps that use NWC the status of the lightning icon just updates...
reply
I think the main issue is the blocking nature on anything that does not use the default zap, no? So if you comment, post or even just select a custom amount, the UI currently blocks until the payment failed or was successful.
If that's true, the toast isn't the problem afaict. As @k00b mentioned, it only exists so one can cancel pending payments.
In the nostr apps that use NWC the status of the lightning icon just updates...
You mean like showing a spinner instead of the lightning icon? Mhh, I see. Maybe we can do that instead of toasts and clicking the spinner would cancel the action. But that's a bigger lift, not sure if it's worth it if the toast is not the real problem.
reply
The toast is easy to remove in cases where we don't want it so I wouldn't overthink that part yet. The hard part will be optimistic actions.
reply
They accidentally zapped and want to abort the payment. You've expressed wanting to abort custodial zaps in the past (which we are also working on). Have your feelings around that changed or did you have something else in mind?
reply
3524 sats \ 1 reply \ @nout 17 Feb
Yeah, you are right and I'm sorry for pulling you back and forth on this. Cancellation is a fair counter point. Please take my inputs just as hopefully constructive feedback / brainstorming. I'm likely to be wrong on stuff...
I think the cancellation is a bit separate problem from the zapping solution itself.
  • zapping:
    • internal wallet zap (no latency, low chance of error)
    • connected wallet zap (medium to high latency, has a chance of error)
  • cancellation:
    • removing / cancelling the "WoT" vote
    • getting sats back on accidental click/zap (see below, I think this one is not that important)
Zapping
Just brainstorming, but what about behavior like this that's the same for both internal and connected wallet:
  1. when user clicks on lightning, then the lightning icon keeps "pulsing" (some animation) until confirmed. And maybe when confirmed you do the fullpage lightning animation?
  2. when confirmed it turns yellow (or whatever the final color).
  3. when there's error/timeout, then show toast with actionable button(s) that allow the user to "try again" or "debug" (or something like that).
When zapping with internal wallet, user only sees (2) or (3)
Cancelation
The main issue I hit was that I clicked/tapped by accident on lightning when I didn't mean to. I don't mind losing the sats since that was my mistake (i.e. fair game), but I'm mainly worried about providing a wrong signal to the system and sorting that post higher (even when I don't like it). So the one solution idea that would resolve my issue would be if the post tripledot menu had "Cancel upvote (leave sats)" or perhaps for plus points, but really low priority: when the icon is still "pulsing" (= unconfirmed), I can tap&hold and in the dialog there could be option to cancel?
reply
Interesting and helpful as usual.
Sounds like there's a principle in there: don't do a toast/popover for frequent actions if you can avoid it. Toasts are a sledgehammer and we can probably find a better, more specific tool for the job.
reply
gj ek
reply
248 sats \ 1 reply \ @ek fwd 13 Feb
We also allow 50 MB free images per stacker per day now. Before, it was 10 MB per day.
/cc @Natalia ๐Ÿ‘€
reply
oh let me test it ๐Ÿ‘€
reply
503 sats \ 0 replies \ @sn 13 Feb
You can attach wallets for sending now
๐Ÿ‘€
reply
Oops, I guess I did a soft reveal of the new contributors the other day. Welcome to the club!
reply
Howdy @k00b @ek I am having some issue attaching my CLN node via Tor and getting the following error:
------ start of logs ------ 1s [cln] ERROR could not connect to CLN: request to https:/xxx.onion:2100/v1/invoice failed, reason: getaddrinfo ENOTFOUND xxx.onion 1s [cln] ERROR failed to attach wallet
Look's by default is looking to https connection. I tried to use http:// when inserting the rest host and port without success. There's any configuration I need to set in my node to enable HTTPS connection via tor? or can I somehow enable the connection via http?
reply
It's a known bug. We're enforcing HTTPS even for Tor in the backend but this breaks how our Tor name resolution works. I'll fix it today.
reply
@ek, have noticed the issues 1107, 1136 and 1133 have been merged but still getting the same error. Anything I need to do differently?
reply
They haven't been deployed yet. I'll deploy them tomorrow.
If you're ever curious what version we're on you can click the running XXXXXX in the footer.
reply
Not sure why it still give me error:
could not connect to CLN: invalid json response body at http://xxx.onion:2100/v1/invoice reason: Unexpected token < in JSON at position 0 failed to attach wallet
I also tried to use the one in position 0 and the input validation obviously give back rune must be restricted to method=invoice only
anything else I could try?
reply
That error is pretty vague sadly so I canโ€™t tell whatโ€™s wrong. Iโ€™ll put up an issue on GitHub
reply
Look's is looking only at the rune in position 0 in the JSON. There's maybe a way to define the rune position in the form? Or maybe having the script to look at all runes in the file for a match? Just ideas...
reply
This isnโ€™t about the rune. We reach your node but itโ€™s not returning json.
amazing, thanks for the update. I'll try again tomorrow.
reply
Thanks much appreciated
reply
a cool feature,btw would be to set withdrawals to your node happen randomly for random intervals of sats and maybe randomly in time...make it hard to papertrail sats you are zapped on here and where they go.. just a cool idea obviously not needed.
for example set so a third of my stacker news wallet gets withdrawn at a random time every 7 days to my lnd node.
reply
Why does attaching LND need address and onchain permission macaroons? https://github.com/stackernews/stacker.news/blob/master/lib/macaroon.js#L61
Shouldn't invoice:write be sufficient for auto withdrawls?
reply
It doesn't need them, but I didn't anticipate people baking their own macaroons with granular perms. I assumed people would use the default macaroons.
If you wouldn't mind opening an issue I can narrow the perm check.
Erm whatโ€™s a Nostr Wallet Connect?
reply
Nostr Wallet Connect (NWC) is a way for applications like Nostr clients to access a remote Lightning wallet through a standardized protocol. For instance, you can link your Alby account with any other application using this feature.
reply
Can someone explain what NWC is and how it works?
reply
See my answer to the comment above from cryotosensei
reply
Cant get nwc to work with my start9 nwc connection FYI.. shows red light
reply
What browser?
reply
I tried with vanadium and Mozilla on graphene OS
reply
Why am i seeing a red status indicator. I'm using NWC on Start9
reply
Mind checking your console for errors and sharing which browser you're using?
Some browsers don't like some of the security settings we are asking it to enforce.
reply
iOS 17.3.1 - Safari (PWA). Not sure if my string is good: nostr+walletconnect://<long-alphanumeric-string>?relay=wss://relay.getalby.com/v1&secret=<secretstring>
reply
The string might be bad. We don't validate it to check. I'll run some more tests in all the problem browsers tomorrow and see if I can fix it.
reply
987 sats \ 4 replies \ @ek fwd 14 Feb
Going to add the validation tomorrow.
However, there should be a toast with some error message if the credentials are no good1:
The form also shouldn't close if the info event wasn't found. And if it was found, the wallet indicator should turn green.
But maybe the error is CSP + browser combination again which throws an error at a location which isn't toasted.
Footnotes
  1. That check only verifies everything up to but not including the secret since a correct secret is not required to receive the info event unfortunately. โ†ฉ
reply
reply
Oh, sorry, I mean Content Security Policy. This is supposed to tell your browser what code is good to run and which should get blocked. It might be blocking too much depending on the browser.
reply
Gotcha. Also, shouldn't it say "detach" instead of "unattach"? It's your app, but feels more natural
Is there a way to see console data on ios without connecting to a mac/xcode?
reply
No it has to be connected to a Mac afaik.
reply
any update on improvements on connecting things like ln address or lnd node over tor to receive auto withdrawals? happy to help test when you need it ๐Ÿค™
i am trying to link up my lnd node running on start9.. i keep getting "invalid input" for my cert.. im copying it from node properties page and have successfully used it for linking up with alby, so i am pretty sure i have the cert right. seems to just not be accepting the cert.. anyone else ran into this issue?