-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
multi: send P2TR addrs by default for co-op close, add new option_any_segwit
feature bit
#6633
multi: send P2TR addrs by default for co-op close, add new option_any_segwit
feature bit
#6633
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! left one question about possible interop bug in future world where witness versions 2-16 are a thing. My interpretation of the spec is that if we advertise this bit, the peer will think it is fine for them to send a shutdown script of these witness version. With this pr, we will error out if they do so
The refactoring I did in #6770 should make it easier to write unit tests for this change as well. |
@Roasbeef, remember to re-request review from reviewers when ready |
32e22b8
to
8c3cb95
Compare
Ok, I think this is g2g now: just pushed up fixes, a new unit test, and also an itest to make sure negotiation works e2e. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🔥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm but one comment
8c3cb95
to
543a59b
Compare
Proper version should be pushed up now (w/o the commit that bumps the Go version). |
// * sha256(initiatorKey || responderKey)[26:] | ||
// * where both keys are the multi-sig keys of the respective parties | ||
// - sha256(initiatorKey || responderKey)[26:] | ||
// -- where both keys are the multi-sig keys of the respective parties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a quirk of updating to Go 1.19 btw...
543a59b
to
369cee7
Compare
In this commit, we add awareness of the option_shutdown_anysegwit that permits both sides to send newer segwit based addresses. This'll eventually enable us to send taproot addresses for co-op close.
In this commit, we catch up our logic with the latest version of the spec that removed support for normal p2kh and p2sh addresses for co-op closes, in order to make dust calculations more uniform.
We only want to allow p2wkh, p2tr, and p2wsh addresses, so we'll utilize the newly public wallet function to restrict this.
…ptional is active
If the ShutdownAnySegwitOptional option is active, then we can safely send these newer addresses.
369cee7
to
cd7c705
Compare
In this commit, we implement the new
option_any_segwit
feature bit which enables us to start sending P2TR addresses for co-op closes as well as for upfront shutdown addresses. Along the way, we tighten up our validation a bit to only allow segwit v0 and v1 addresses.