loop: use MuSig2 1.0 scheme for the new MuSig2 swaps

This commit is contained in:
Andras Banki-Horvath 2023-01-09 19:01:07 +01:00
parent b47f67a6de
commit cd91f90ed2
No known key found for this signature in database
GPG key ID: 80E5375C094198D8
4 changed files with 41 additions and 66 deletions

View file

@ -82,8 +82,15 @@ func GetHtlc(hash lntypes.Hash, contract *loopdb.SwapContract,
)
case swap.HtlcV3:
// Swaps that implement the new MuSig2 protocol will be expected
// to use the 1.0RC2 MuSig2 key derivation scheme.
muSig2Version := input.MuSig2Version040
if contract.ProtocolVersion >= loopdb.ProtocolVersionMuSig2 {
muSig2Version = input.MuSig2Version100RC2
}
return swap.NewHtlcV3(
input.MuSig2Version040,
muSig2Version,
contract.CltvExpiry,
contract.HtlcKeys.SenderInternalPubKey,
contract.HtlcKeys.ReceiverInternalPubKey,