-
Notifications
You must be signed in to change notification settings - Fork 118
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
script: static address taproot script #690
Conversation
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 🎉
staticaddr/script/script_test.go
Outdated
} | ||
} | ||
|
||
func MuSig2Sign(version input.MuSig2Version, privKeys []*btcec.PrivateKey, |
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.
I wonder if it's worth moving this to say utils
package?
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.
There's a utils.go
and a utils/htlc_utils.go
. Should we create utils/musig.go
. Although sometimes utils is an anti pattern.
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.
Yeah sgtm, it is somewhat of a too generic name I agree, but at least it is reusable.
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.
Ideally the server would also use this functionality.
7827315
to
5931612
Compare
5931612
to
249a493
Compare
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! Very nice addition with the tests!
staticaddr/script/script.go
Outdated
|
||
// TaprootExpiryScriptSize evaluates to 39 bytes: | ||
// - OP_DATA: 1 byte (trader_key length) | ||
// - <trader_key>: 32 bytes |
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.
nit here and in other places: trader key is a relict from loop (that is also found in the reservations scripts cough cough)
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.
...from pool? Will change it caugh caugh.
} | ||
|
||
// NewStaticAddress constructs a static address script. | ||
func NewStaticAddress(muSig2Version input.MuSig2Version, csvExpiry int64, |
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.
IMO I think it makes sense to pass over *btcec.PublicKey
, as a toplevel function should handle the parsing
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
958a7b7
to
7c2640d
Compare
In this PR we introduce taproot scripting for static loop-in addresses.