1200wd / bitcoinlib

Bitcoin and other Cryptocurrencies Library for Python. Includes a fully functional wallet, Mnemonic key generation and management and connection with various service providers to receive and send blockchain and transaction information.
http://bitcoinlib.readthedocs.io/
GNU General Public License v3.0
613 stars 204 forks source link

Call to RFC6979 needs another argument added #410

Open ellacodecamp opened 4 months ago

ellacodecamp commented 4 months ago

When you call RFC6979() function in USE_FASTECDSA case, you need to pass it additional argument True for prehashed parameter. This means that the message that you pass it to generate k does not need to be hashed again. Indeed, this value has already been double hashed in by Transaction object. There is no need to hash it again. While there is no harm in hashing it again, it makes you inconsistent with other wallets as you won't have the same signature for the same transaction, which was the whole point for actually generating deterministic signatures.