-
Notifications
You must be signed in to change notification settings - Fork 123
loopout: use psbt when obtaining the MuSig2 signature #509
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
Conversation
sputn1ck
left a comment
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.
Useful change! LGTM 🚀
8c171b0 to
180284c
Compare
guggero
left a comment
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.
LGTM 🎉
I think just for completeness' sake we should add the UTXO information to the packet, even though it isn't strictly needed.
sweep/sweeper.go
Outdated
| Version: 2, | ||
| TxIn: []*wire.TxIn{{ | ||
| PreviousOutPoint: htlcOutpoint, | ||
| SignatureScript: htlc.SigScript, |
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.
Are np2wkh HTLCs still supported? Otherwise we could scrap the SignatureScript.
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.
removed
| Value: int64(amount), | ||
| PkScript: htlc.PkScript, | ||
| }, | ||
| packet, err := psbt.NewFromUnsignedTx(sweepTx) |
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.
Should we set the WitnessUtxo field on the input as well?
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.
done
180284c to
53ae5a2
Compare
In this commit we deprecate the sighash field from the MuSig2SignSweepReq request in favour of using a psbt serialized sweep transaction instead. This way the sever gains full transparency about client sweep requests and can assemble the sighash to sign on its own.
53ae5a2 to
f8da106
Compare
This PR extends the
swapsserverrpc.MuSig2SignSweepReqwith the sweep txn's psbt to make server side validation of the sighash possible.