fortesp / bitcoinaddress

Bitcoin Wallet Address Generator
https://pypi.org/project/bitcoinaddress/
MIT License
144 stars 51 forks source link

Fixed P2WSH and P2WPKH calculations and tests #27

Open klazutin opened 1 year ago

klazutin commented 1 year ago

This should hopefully fix the calculations of bech32 P2WSH and P2WPKH (#13)

The fix for P2WSH comes from @s256s9 - to the best of my ability to confirm, it produces a valid result.

The fix for P2WPKH comes from my efforts to understand the generation process. The correctness can be verified, for instance, on https://privatekeys.pw/address/bitcoin/1NaChZV4JJysct8QYcMKFHnQ2SNFpnBund (uses the public key from test_address.py).