Currently BIP341 recommends:
If the spending conditions do not require a script path, the output key should commit to an unspendable script path instead of having no script path. This can be achieved by computing the output key point as Q = P + int(hashTapTweak(bytes(P)))G.
This would require tweaking the private key before signing.
Currently, the only way I can work around this with my downstream library is:
- calculate the pubkey
- see if it's even or odd
- negate the privkey if odd
- tweak the privkey
Then when I pass it to this library, it does steps 1-3 again before signing (to negate it)
If there was a variation of secp256k1_schnorrsig_sign that accepted a tweak, and would tweak the privkey after any negation, and before the signature calculation, that would be extremely helpful.
Then we could just pass the tweak (int(hashTapTweak(bytes(P)))) in and everything would be more efficient.
I would like to hear what everyone thinks about adding a secp256k1_schnorrsig_sign_with_tweak function.
Also, taking this one step further, we could also add secp256k1_schnorrsig_sign_keyspend_only which will generate the tweak for us based on Q = P + int(hashTapTweak(bytes(P)))G and then pass it into secp256k1_schnorrsig_sign_with_tweak
Any and all feedback appreciated.