This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Description
Thank for your work on Keylib, but I meet some trouble when I want to generate PubKey from PrivateKey which is generated successfully.
I traced the bug and found it was about the length of pubkey, but I dont know which step is wrong, could you please help me? I really appreciate it.
the bug information is as followed:
private_key = ECPrivateKey()
private_key.to_hex()
'87afe6f0592829b21ad1a1571c4da84046cf6633356c609221ba2ee2d1c4211901'
private_key.to_wif()
'L1mU9f3yFPeVfNYrrzZs8tGxGiqUEnF3VxwUKLYLTgH6RtFBsfaf'
public_key = private_key.public_key()
Traceback (most recent call last):
File "", line 1, in
File "//keylib/private_key.py", line 92, in public_key
bin_public_key_string = compress(bin_public_key_string)
File "//keylib/key_formatting.py", line 337, in compress
f = get_pubkey_format(pubkey)
File "/*/keylib/key_formatting.py", line 266, in get_pubkey_format
raise Exception("Pubkey not in recognized format")
Exception: Pubkey not in recognized format