ZeusLN / zeus

A mobile Bitcoin wallet fit for the gods. ⚡️ Est. 563345
https://ZeusLN.com
Other
1.01k stars 146 forks source link

Wallet, when opening channels, uses public mode by default - many problems #2214

Closed Perlover closed 1 month ago

Perlover commented 4 months ago

Describe your enhancement idea

Wallet, when opening channels, uses public mode by default. There's a problem with that.

If, for example, I have one private channel opened by LSP (private) or some other way, and I have opened the second channel public (forgot to enable the private channel switch, which is disabled by default, so the channel is public), the following situation occurs:

If I accept payment, I generate an invoice.

Option one - I have the option to make hints in the invoice globally enabled in my settings. In that case, the invoice will prompt for the latest hops. And there will be only hints for private channels. Since the sender's wallet sees the hints - it will send the payment only through the route for these hints. Result - payments will go only to the private channel, and the public channel will remain empty. This will lead to the fact that it will not be used.

Option two. The option to include hints in the invoice is disabled. This is the default behavior. In this case the invoice will have no hints. In this case the sender will search for a node in the network graph. If sender's wallet is lucky and finds a node of my wallet (which is not private to the user), he will send a payment that will come only to the public channel. In this case payments will go only to the public channel. They can also go to the private channel, but only if it happens that the private channel is open with the same node as the private channel.

If you generalize everything, it turns out that you cannot mix private and public channels, otherwise there will be problems with incoming payments. The default strategy now is to open public channels by default. But in this case it is not clear why LSP of Zeus wallet opens private inbound channels. If we go by the strategy of private channels, then the option public or private channel should be absent when opening a channel and always open only a private channel. Also, in this case, you should remove the "Enable hints" option and make hints enabled by default.

kaloudis commented 4 months ago

Which backend are you using, by default channels should be set to be unannounced. You can change your defaults under Settings > Channels

Perlover commented 4 months ago

I used an inbound lnurl-channel mode (scanning qr code of LSP provider).

If my memory serves me right, there's an inverse option there that is disabled by default that says don't report the channel when options are enabled. Since it is disabled, you have to force it to be enabled to have a private channel.

Perlover commented 4 months ago

And second question : if opening outgoing channels is private by default (in my case I used incoming via lnurl-channel service), why is the "enable route hints" option disabled? In such configuration user will have problems with receiving payments.

kaloudis commented 4 months ago

I used an inbound lnurl-channel mode (scanning qr code of LSP provider).

If my memory serves me right, there's an inverse option there that is disabled by default that says don't report the channel when options are enabled. Since it is disabled, you have to force it to be enabled to have a private channel.

No, I was asking which node implementation you were using.

Routing hints are off by default because users are typically using our LSP with invoice wrapping. You can enable routing hints by default under Settings > Invoices

Perlover commented 4 months ago

No, I was asking which node implementation you were using.

I was using the paid service lnbig.com. When I opened a channel by scanning there qr-code lnurl-channel, before opening I saw a dialog box of opening a channel, where there is an option Private and it is disabled by default. You can test this yourself. If the option is not changed manually, the public channel is opened.

Routing hints are off by default because users are typically using our LSP with invoice wrapping. You can enable routing hints by default under Settings > Invoices

But if I don't want to use your wrap service, but use some other liquidity providers, the channels always have to be private, and that requires the option to be enabled.

kaloudis commented 4 months ago

PR https://github.com/ZeusLN/zeus/pull/2221 updates behavior to match that of the Open Channel view and default to unannounced channels.

As far as the hop hints setting under Settings > Invoices, you don't have to use the wrapping service. You can disable LSP service on the Receive view or under Settings > Lightning Service Provider.

kaloudis commented 1 month ago

Changes noted above have been rolled out in v0.9.0