Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add feature bits for experimental wallet features #237

Merged
merged 1 commit into from
Jul 16, 2021

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Mar 24, 2021

Wallets should explicitly advertise support for experimental features (e.g. pay-to-open, swaps, wake-up notifications, etc) in their init message, to allow the LSPs they connect to to know whether they should use these experimental features (e.g. open a channel on-the-fly when liquidity is missing to receive a payment).

Otherwise the LSP must use heuristics that may be incorrect and initiate experimental protocols with nodes/wallets that don't support them (this is happening with electrum).

I used two feature bits for asymmetric features, as explored here: lightning/bolts#885

A later PR should introduce support for actually disabling these features (and turning off the corresponding code branches).

NB: this can be merged after the initial release, no rush.

@dpad85
Copy link
Member

dpad85 commented Mar 29, 2021

Seems like a good idea 👍 we could add the swap-in bit now as well

Also why not use a even higher feature bit? 60 does not seem very high to me.

@t-bast
Copy link
Member Author

t-bast commented Mar 29, 2021

Also why not use a even higher feature bit? 60 does not seem very high to me.

True, we could. At the rate at which features get adopted in the spec, I think 60 and above still let us enjoy these for at least 10 years, but we can be more prudent 😆

dpad85
dpad85 previously approved these changes Mar 31, 2021
@t-bast t-bast force-pushed the pay-to-open-feature-bit branch 2 times, most recently from e71e93b to d8e90c4 Compare April 1, 2021 06:41
@t-bast t-bast changed the title Add feature bit for pay-to-open Add feature bits for non-spec wallet features Apr 21, 2021
SomberNight added a commit to spesmilo/electrum that referenced this pull request Jul 2, 2021
It is the last Trampoline Forwarder that should be checked, not the
first one.

Consider route (of Trampolines only):
Alice-electrum -> T_ACINQ -> T_Hodlister -> Bob-electrum
Even if Bob has a transport open with ACINQ or even if Bob has a channel open with ACINQ,
Alice can safely use end-to-end trampoline for this route: ACINQ will not know who
the recipient is, so they will not try to do pay-to-open (and hold up the payment for minutes...).

related: ACINQ/lightning-kmp#237
@t-bast t-bast force-pushed the pay-to-open-feature-bit branch 2 times, most recently from 179346b to 886e6f1 Compare July 9, 2021 07:48
Wallets should explicitly advertise support for pay-to-open, trusted swaps
and wake-up notifications  in their `init` message, to allow the LSPs they
connect to to know what they're allowed to do.

This lets LSPs know for example whether they can open a channel on-the-fly
when liquidity is missing to receive a payment.
@t-bast t-bast changed the title Add feature bits for non-spec wallet features Add feature bits for experimental wallet features Jul 9, 2021
t-bast added a commit that referenced this pull request Jul 13, 2021
This feature was introduced by lightning/bolts#880

We also clean up the channel state machine to leverage the feature bits
added in #237
@t-bast t-bast merged commit 85faa93 into master Jul 16, 2021
@t-bast t-bast deleted the pay-to-open-feature-bit branch July 16, 2021 07:44
t-bast added a commit that referenced this pull request Jul 16, 2021
This feature was introduced by lightning/bolts#880

We also clean up the channel state machine to leverage the feature bits
added in #237
t-bast added a commit that referenced this pull request Aug 17, 2021
This feature was introduced by lightning/bolts#880

We also clean up the channel state machine to leverage the feature bits
added in #237
t-bast added a commit that referenced this pull request Aug 24, 2021
This feature was introduced by lightning/bolts#880

We also clean up the channel state machine to leverage the feature bits
added in #237
t-bast added a commit that referenced this pull request Sep 23, 2021
This feature was introduced by lightning/bolts#880

We also clean up the channel state machine to leverage the feature bits
added in #237
t-bast added a commit that referenced this pull request Sep 24, 2021
This feature was introduced by lightning/bolts#880

We also clean up the channel state machine to leverage the feature bits
added in #237
t-bast added a commit that referenced this pull request Sep 27, 2021
This feature was introduced by lightning/bolts#880

We also clean up the channel state machine to leverage the feature bits
added in #237
t-bast added a commit that referenced this pull request Sep 27, 2021
This feature was introduced by lightning/bolts#880

We also clean up the channel state machine to leverage the feature bits
added in #237
t-bast added a commit that referenced this pull request Dec 9, 2021
This feature was introduced by lightning/bolts#880
and the feature bit was added in lightning/bolts#906

We also clean up the channel state machine to leverage the feature bits
added in #237
t-bast added a commit that referenced this pull request Feb 4, 2022
This feature was introduced by lightning/bolts#880
and the feature bit was added in lightning/bolts#906

We also clean up the channel state machine to leverage the feature bits
added in #237
t-bast added a commit that referenced this pull request Feb 4, 2022
* Rename ChannelTypes -> ChannelData

And move commands to a new ChannelCommands file.
This commit doesn't contain any logic changes.

* Require explicit channel type negotiation

This feature was introduced by lightning/bolts#880
and the feature bit was added in lightning/bolts#906

We also clean up the channel state machine to leverage the feature bits
added in #237
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants