1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-12-23 07:08:13 +00:00

Merge pull request #829 from Jolly-Pirate/patch-1

Fix for Private Key (WIF-Compressed)
This commit is contained in:
Will Binns 2021-03-10 08:17:03 +01:00 committed by GitHub
commit c4a233cd30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,8 +20,8 @@ compressed_private_key = private_key + '01'
print("Private Key Compressed (hex) is: ", compressed_private_key)
# Generate a WIF format from the compressed private key (WIF-compressed)
wif_compressed_private_key = cryptos.encode_privkey(
cryptos.decode_privkey(compressed_private_key, 'hex'), 'wif')
wif_compressed_private_key = bitcoin.encode_privkey(
cryptos.decode_privkey(compressed_private_key, 'hex_compressed'), 'wif_compressed')
print("Private Key (WIF-Compressed) is: ", wif_compressed_private_key)
# Multiply the EC generator point G with the private key to get a public key point