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

BOLT 2: option_shutdown_anysegwit (Feature 26/27) #672

Merged

Conversation

rustyrussell
Copy link
Collaborator

In bitcoin 0.19.0, standardness rules are going to be relaxed to allow
future witness versions. Once this is widely deployed, it will be safe
to accept them, smoothing use of future segwit versions.

See: bitcoin/bitcoin#15846

Signed-off-by: Rusty Russell rusty@rustcorp.com.au

@rustyrussell rustyrussell added the Meeting Discussion Raise at next meeting label Sep 18, 2019
Copy link
Collaborator

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎷

Copy link
Collaborator

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK, we may need to revisit depending on whether no input uses external tagging or not

@cdecker
Copy link
Collaborator

cdecker commented Oct 18, 2019

ACK e8f8a79

Copy link
Collaborator

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@Roasbeef
Copy link
Collaborator

Can land once rebased!

@rustyrussell
Copy link
Collaborator Author

Assigned features 22/23.

@rustyrussell
Copy link
Collaborator Author

Rebased on top of master, assigned feature bits as per http://www.erisian.com.au/meetbot/lightning-dev/2020/lightning-dev.2020-08-17-20.08.html

@rustyrussell rustyrussell added the Awaiting Interop Approved, pending 2 or more impl interoperating label Aug 20, 2020
@halseth
Copy link
Contributor

halseth commented Dec 22, 2020

As discussed on IRC, needs feature bit bump to not conflict with #824

@cdecker
Copy link
Collaborator

cdecker commented Dec 22, 2020

Clean rebase on top of master

@cdecker
Copy link
Collaborator

cdecker commented Dec 22, 2020

Featurebits bumped from 22/23 to 24/25 as per specification meeting 2020/12/20

Copy link
Collaborator

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 4acbb39

If two implementations can successfully test interop, we can merge this.

4. `OP_0` `32` 32-bytes (version 0 pay to witness script hash)
4. `OP_0` `32` 32-bytes (version 0 pay to witness script hash), OR
5. if (and only if) `opt_shutdown_anysegwit` is negotiated:
* `OP_1` through `OP_16` inclusive, followed by a single push of 2 to 40 bytes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beware that your is_witness_program() is bip 141 compliant, otherwise if the witness program size is unbounded the non-funder counterparty might inflate its scriptpubkey to burn in fees the funder balance.

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if it makes sense to clarify, but to check with others, the way I read this, if I disconnect from a peer, then reconnect with new features bits set, you can opt into onlysegwit on an old channel as long as you didn't set an upfront shutdown script. I think thats correct and a good idea.

@t-bast
Copy link
Collaborator

t-bast commented Feb 11, 2021

you can opt into onlysegwit on an old channel as long as you didn't set an upfront shutdown script. I think thats correct and a good idea.

I agree, this looks desirable and compatible with the PR.

@rustyrussell rustyrussell changed the title BOLT 2: opt_shutdown_anysegwit BOLT 2: option_shutdown_anysegwit Feb 19, 2021
@niftynei niftynei changed the title BOLT 2: option_shutdown_anysegwit BOLT 2: option_shutdown_anysegwit (Feature 26/27) Mar 12, 2021
t-bast added a commit to ACINQ/eclair that referenced this pull request May 14, 2021
Opt-in to allow any future segwit script in shutdown as long as it complies
with BIP 141 (see  lightning/bolts#672).
t-bast added a commit to ACINQ/eclair that referenced this pull request May 14, 2021
Opt-in to allow any future segwit script in shutdown as long as it complies
with BIP 141 (see  lightning/bolts#672).
Copy link
Collaborator

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented this in eclair and tested against c-lightning v0.10.0 (compiled with --enable-experimental-features) and didn't find any issue.

t-bast added a commit to ACINQ/eclair that referenced this pull request May 17, 2021
Opt-in to allow any future segwit script in shutdown as long as it complies
with BIP 141 (see lightning/bolts#672).
@rustyrussell
Copy link
Collaborator Author

Applying as per action at meeting 2021-05-24.

@rustyrussell rustyrussell merged commit 3508e4e into lightning:master May 24, 2021
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request May 25, 2021
lightning/bolts#672 was merged.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: `option_shutdown_anysegwit` allows future segwit versions on shutdown transactions.
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request May 25, 2021
lightning/bolts#672 was merged.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: `option_shutdown_anysegwit` allows future segwit versions on shutdown transactions.
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request May 25, 2021
lightning/bolts#672 was merged.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: `option_shutdown_anysegwit` allows future segwit versions on shutdown transactions.
cdecker pushed a commit to rustyrussell/lightning that referenced this pull request May 25, 2021
lightning/bolts#672 was merged.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: `option_shutdown_anysegwit` allows future segwit versions on shutdown transactions.
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request May 25, 2021
lightning/bolts#672 was merged.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: `option_shutdown_anysegwit` allows future segwit versions on shutdown transactions.
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request May 26, 2021
lightning/bolts#672 was merged.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: `option_shutdown_anysegwit` allows future segwit versions on shutdown transactions.
rustyrussell added a commit to rustyrussell/lightning that referenced this pull request May 26, 2021
lightning/bolts#672 was merged.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: `option_shutdown_anysegwit` allows future segwit versions on shutdown transactions.
rustyrussell added a commit to ElementsProject/lightning that referenced this pull request May 26, 2021
lightning/bolts#672 was merged.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: `option_shutdown_anysegwit` allows future segwit versions on shutdown transactions.
bitromortac added a commit to bitromortac/electrum that referenced this pull request Oct 22, 2021
lightning/bolts#672

We check the received shutdown script against higher segwit versions and
accept closing to that script if option_shutdown_anysegwit has been
negotiated.
bitromortac added a commit to bitromortac/electrum that referenced this pull request Oct 22, 2021
lightning/bolts#672

We check the received shutdown script against higher segwit versions and
accept closing to that script if option_shutdown_anysegwit has been
negotiated.
bitromortac added a commit to bitromortac/electrum that referenced this pull request Oct 26, 2021
lightning/bolts#672

We check the received shutdown script against higher segwit versions and
accept closing to that script if option_shutdown_anysegwit has been
negotiated.
t-bast added a commit to ACINQ/lightning-kmp that referenced this pull request Dec 9, 2021
Opt-in to allow any future segwit script in shutdown as long as it complies
with BIP 141 (see  lightning/bolts#672).

This is particularly useful to allow wallet users to close channels to a
Taproot address.
t-bast added a commit to ACINQ/lightning-kmp that referenced this pull request Feb 7, 2022
Opt-in to allow any future segwit script in shutdown as long as it complies
with BIP 141 (see  lightning/bolts#672).

This is particularly useful to allow wallet users to close channels to a
Taproot address.
t-bast added a commit to ACINQ/lightning-kmp that referenced this pull request Feb 7, 2022
Opt-in to allow any future segwit script in shutdown as long as it complies
with BIP 141 (see  lightning/bolts#672).

This is particularly useful to allow wallet users to close channels to a
Taproot address.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Interop Approved, pending 2 or more impl interoperating Meeting Discussion Raise at next meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants