Introduce solver classes to simplify how we create a spend LN transactions#3073
Closed
Introduce solver classes to simplify how we create a spend LN transactions#3073
Conversation
We update CommitmentOutput to include the actual output that it represents in the commit tx, and the redeem script to spend it. We also include 2nd level HTLC transactions when they are not trimmed. We remove CommitmentOutputLink which is now useless, and simplify how we create commitment and HTLC transactions. We add solvers to create and sign spending transactions, and remove makeXXXTx() aand addSigs() methods.
3019c61 to
6e40c49
Compare
…nd ClaimHtlcTimeoutTx We previously saved the redeem script in the InputInfo class: we'll extract these fields from the redeem script (which would be an HTLC offered or received script) or witness of data persisted with older codecs.
6e40c49 to
94ce2e2
Compare
Member
Author
|
closed in favour of #3074 |
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.
The goal of this PR is to simplify how we create and spend LN transactions (HTLC success/timeout, pemality transactions, ...) by refactoring how we create "redeem info" (information needed to spend specific outputs).
The biggest change is that
redeemInfois removed from ourInputInfoclass:TransactionWithInputInfo#3056 and Add high-level helpers for taproot channels #3028)HtlcSuccessTx,HtlcTimeoutTx, andClaimHtlcTimeoutTx, and update codecs to store this informationInputInfoclass, or from the transaction's witness. These transactions were signed and published so this info has to be there.This PR includes tooling support for taproot channels (i.e. solvers already implement signing/spending taproot transactions) , which helps validate whether this approach is suitable and extensible enough, but does not include code to actually create live taproot channels.
Codecs have been updated, payment hash and expiry fields that have been added to some of our class will be extracted either from the redeem script that we used to persist or from the transaction's witness (they're all
p2wshtransactions).