blixt-wallet icon indicating copy to clipboard operation
blixt-wallet copied to clipboard

[Feature request] Persist lightning peers and connect to them on startup

Open gradientskier opened this issue 1 year ago • 0 comments

Requested feature

The user navigates in "Settings", "Show Lightning peers", then taps on the "+" sign. The user inserts the "Node URI". At this stage, the app should give the user the possibility to mark the peer as a "connect on startup" peer, e.g. using a switch that says "Connect on startup". Then the user confirms adding the peer using the "Connect" button. If the peer has been marked as "Connect on startup", then blixt should persist the node uri and automatically connect to the selected peer at startup. If a peer is marked as "Connect on startup", then it should appear in the "Lightning peers" list, and a button "Forget peer" should allow the user to remove the peer from the list of "connect at startup" peers. Essentially, peers should be treated in blixt similarly to known Wi-Fi networks in a mobile device. They should be saved in a list, and if possible the node should connect to the peer on startup when available.

Rationale

This is particularly useful in the following scenario, in which there is a blixt mobile node and a trusted, always online, lightning node (e.g. running on a home server). The blixt node has a channel to the lightning node.

  • The lightning node listens on the lightning port, e.g. 9375, both on tor and clearnet. But...
  • The lightning node is announced tor-only to the lightning network, for privacy reasons. E.g. it's a home server.
  • The communication between blixt node and the lightning node is in clearnet, for performance reasons. There is no privacy issue arising from the blixt node knowing the IP of the lightning node.

Currently, in this particular scenario, blixt does not manage to connect automatically to the lightning node on startup, because the lightning node announces only the tor address and not the clearnet address. The lightning node must be added manually each time, and this is quite annoying.

I hope this feature can be useful also to others that have a similar setup.

gradientskier avatar Apr 16 '23 21:04 gradientskier