Commit Graph

5 Commits (84c3ef0402c389ebfa383f7a85173b553bb4420a)

Author SHA1 Message Date
Carla Kirk-Cohen 84c3ef0402
multi: update sweeping to allow different sighashes and claim scripts
Taproot spends require a different sighash, so we update our HtlcScript
interface to provide the appropriate sighash when sweeping. We also add
distinct Timeout/Success Script functions to allow for tapleaf spends
which have different locking scripts for different paths. Note that the
timeout and success paths will be the same for segwit v0 htlcs, because
it has a single branched script containing all spend paths.

In future iterations, this differentiation of claim scripts can also
be used to use musig2 to collaboratively keyspend P2TR htlcs with the
server. This script can be expressed as PriorityScript (because we'll
try to keyspend as a priority, and then fall back to a tap leaf spend).
As we've done here, segwit v0 spends would just return their single
script for PriorityScript, and the claim would be no different from
our other claims.
2 years ago
Harsha Goli d22b064e54
swap: HTLCV3 added
In this commit we add the version 3 htlc, which is implemented with
taproot script spending the two payment paths: the claim path case, and
the timeout case.
2 years ago
Carla Kirk-Cohen 9d2d5a78d4
multi: pass shared key to new htlc
TODO - our view etc functions don't have our shared key, find a good way
to get this. A possible solution is just to lazily store it so that we
don't need to call lnd/create a session every time we want to restore
it.
2 years ago
Harsha Goli 7a16e3b25d
multi: bump btcec/v2 and btcutil to new versions 2 years ago
Andras Banki-Horvath 64991813ed
test: spend tests for the new v2 htlc 4 years ago