BIP341: add aux_rand argument to taproot_sign_key #1379

pull DariusParvin wants to merge 1 commits into bitcoin:master from DariusParvin:bip341-aux_rand changing 1 files +2 −2
  1. DariusParvin commented at 9:55 PM on October 9, 2022: contributor

    The schnorr_sign function from the bip340 reference code has a third required argument aux_rand: bytes.

    Change:

    • ~adding aux_rand as an optional argument that defaults to 0x0000...~
    • adding bip340_aux_rand as a required argument to the function taproot_sign_key
  2. in bip-0341.mediawiki:248 in 8fde2cd45a outdated
     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):
    


    jonasnick commented at 8:21 AM on October 24, 2022:

    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.


    DariusParvin commented at 4:29 AM on November 4, 2022:

    Thanks, that makes sense. I made it required and renamed it to bip340_aux_rand.

  3. BIP341: add bip340_aux_rand argument to taproot_sign_key e24f685971
  4. DariusParvin force-pushed on Nov 4, 2022
  5. jonasnick approved
  6. jonasnick commented at 12:57 PM on November 4, 2022: contributor

    ACK e24f6859710a8047931eb68788dce0d0400a1569

    Thanks @DariusParvin !

  7. sipa commented at 6:14 PM on November 10, 2022: member

    ACK e24f6859710a8047931eb68788dce0d0400a1569

  8. kallewoof merged this on Jan 4, 2023
  9. kallewoof closed this on Jan 4, 2023


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 23:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me