Support compressed keys

This commit is contained in:
Ivanq 2020-03-30 09:16:12 +03:00
parent 56acac8cd3
commit 0a9a9b5a57
5 changed files with 31 additions and 13 deletions

View file

@ -60,7 +60,7 @@ def privatekeyToAddress(privatekey): # Return address from private key
privatekey_bin = bytes.fromhex(privatekey)
else:
privatekey_bin = sslcurve.wif_to_private(privatekey.encode())
return sslcurve.private_to_address(privatekey_bin, is_compressed=False).decode()
return sslcurve.private_to_address(privatekey_bin).decode()
except Exception: # Invalid privatekey
return False
@ -71,7 +71,6 @@ def sign(data, privatekey): # Return sign to data using private key
return base64.b64encode(sslcurve.sign(
data.encode(),
sslcurve.wif_to_private(privatekey.encode()),
is_compressed=False,
recoverable=True,
hash=dbl_format
)).decode()