244 | @@ -245,10 +245,12 @@ TapTweak = tagged_hash("TapTweak", p + ABCDE)
245 | '''Spending using the key path''' A Taproot output can be spent with the secret key corresponding to the <code>internal_pubkey</code>. To do so, a witness stack consists of a single element: a [[bip-0340.mediawiki|BIP340]] signature on the signature hash as defined above, with the secret key tweaked by the same <code>h</code> as in the above snippet. See the code below:
246 |
247 | <source lang="python">
248 | -def taproot_sign_key(script_tree, internal_seckey, hash_type):
249 | +def taproot_sign_key(script_tree, internal_seckey, hash_type, aux_rand=None):
BIP-340 says:
The auxiliary random data should be set to fresh randomness generated at signing time [emphasis added]
Given that recommendation, I'd not make this argument optional and perhaps rename it to bip340_aux_rand.
Thanks, that makes sense. I made it required and renamed it to bip340_aux_rand.