-
Notifications
You must be signed in to change notification settings - Fork 265
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 support for taproot outputs to our "input info" class #2895
Draft
sstone
wants to merge
9
commits into
master
Choose a base branch
from
input-info-taproot
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
sstone
force-pushed
the
input-info-taproot
branch
2 times, most recently
from
September 10, 2024 16:06
cf583ea
to
8e147fb
Compare
remyers
reviewed
Sep 17, 2024
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.
Seems like pretty safe refactors. I just had one scala related question for my own information.
eclair-core/src/main/scala/fr/acinq/eclair/wire/internal/channel/version0/ChannelCodecs0.scala
Outdated
Show resolved
Hide resolved
sstone
force-pushed
the
input-info-taproot
branch
2 times, most recently
from
October 1, 2024 07:39
4163f0e
to
e15cb29
Compare
sstone
force-pushed
the
input-info-taproot
branch
2 times, most recently
from
October 15, 2024 13:26
f83f006
to
bde8e07
Compare
sstone
force-pushed
the
input-info-taproot
branch
from
October 21, 2024 14:37
bde8e07
to
a35921c
Compare
This PR is now based on #2747 |
sstone
force-pushed
the
input-info-taproot
branch
from
November 26, 2024 13:38
a35921c
to
d560a8c
Compare
This feature adds two new messages: - `closing_complete` sent after exchanging `shutdown` - `closing_sig` sent in response to `closing_complete`
The spec allows the closer to use an OP_RETURN output if their amount is too low when using `option_simple_close`.
We introduce a new `NEGOTIATING_SIMPLE` state where we exchange the `closing_complete` and `closing_sig` messages, and allow RBF-ing previous transactions and updating our closing script. We stay in that state until one of the transactions confirms, or a force close is detected. This is important to ensure we're able to correctly reconnect and negotiate RBF candidates. We keep this separate from the previous NEGOTIATING state to make it easier to remove support for the older mutual close protocols once we're confident the network has been upgraded.
Whenever one side sends `shutdown`, we restart a signing round from scratch. To be compatible with future taproot channels, we require the receiver to also send `shutdown` before moving on to exchanging `closing_complete` and `closing_sig`. This will give nodes a message to exchange fresh musig2 nonces before producing signatures. On reconnection, we also restart a signing session from scratch and discard pending partial signatures.
Whenever we exchange `shutdown`, we now require that new closing txs are signed before allowing another `shutdown` message to be sent to start a new signing round. This creates more risk of deadlock when one side fails to send their sigs, where we'll need to disconnect to start a new signing round. But that shouldn't happen if nodes are honest and not buggy, so it probably doesn't matter. If nodes are buggy or malicious, we will need to force-close anyway.
Our InputInfo class contains a tx output and the matching redeem script, which is enough to spend segwit v0 transactions. For taproot transactions, instead of a redeem script, we need a script tree instead, and the appropriate internal pubkey.
Co-authored-by: Pierre-Marie Padiou <[email protected]>
sstone
force-pushed
the
input-info-taproot
branch
from
December 9, 2024 14:23
d560a8c
to
154235d
Compare
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 is a preparation PR for simple taproot channels, which extends
InputInfo
to support spending taproot outputs (to spend v0 outputs we need a redeem script, but to spend v1 taproot output we need a script tree and an internal public key).Changes are generic (i.e. not tied to specific details of the simple taproot channels extension proposal).