Anchor output: handle unilateral close#1501
Merged
Merged
Conversation
093843e to
66900ae
Compare
Change the static_remotekey behavior to use a wallet basepoint only when using "standard" commitments; with anchor outputs we need to claim this output (it doesn't directly spend to our wallet) so we must use key-derivation with our lightning keys. Correctly claim all outputs in unilateral cases, and add corresponding test cases. Anchor output commitments should now work end-to-end (but there's no support for fee bumping yet).
66900ae to
2e0d024
Compare
pm47
reviewed
Sep 17, 2020
sstone
previously approved these changes
Sep 21, 2020
Member
sstone
left a comment
There was a problem hiding this comment.
I agree that it is better like this when anchor outputs are used. Thanks for hardening existing tests and adding new ones !
pm47
approved these changes
Sep 22, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR wraps up experimental support for anchor outputs by correctly handling all unilateral close scenarios.
Anchor outputs can now be activated and should work end-to-end (but we lack support for actually using the anchors and sighash changes to bump the fees - coming next).
It has been tested end-to-end against lnd master:
I had to change the
static_remotekeybehavior, @sstone let me know if that sounds good.We used a
bitcoindwallet address which made sense forstatic_remotekeywithout anchors, because our main output in the remote commitment was directly a p2wpkh to that address.But with anchor outputs, our main output in the remote commitment is a p2wsh with a CSV-1 delay (
OP_PUSHDATA(paymentPubkey) :: OP_CHECKSIGVERIFY :: OP_1 :: OP_CHECKSEQUENCEVERIFY :: Nil) so it doesn't make sense to use a key owned by thebitcoindwallet, we want to be able to claim it from our internal wallet in cases of unilateral close.