Closed jeanmonet closed 4 years ago
Thank you for posting this. I will fix it. For the unrelated it can be done. Just not sure if would be better to decouple that responsibility from the Address class. I will add it in the TODO Projects here. Thanks.
First of all, thank you for sharing this library.
I noticed that the
__init__
method of theKey
class does not store the optionally passedseed
value as an instance variable: https://github.com/fortesp/bitcoinaddress/blob/b7f4385b71688f162652e99b4bbe762a96969d12/bitcoinaddress/key.py#L12Also, the
generate()
method does not try to useself.seed
in case it was defined upon instantiation.Consequently, when you do:
It will generate from a random seed instead of the value passed upon instantiation. For example here: https://github.com/fortesp/bitcoinaddress/blob/b7f4385b71688f162652e99b4bbe762a96969d12/bitcoinaddress/wallet.py#L11
To work, it would need to look like this (currently):
(Unrelated: it would be interesting if the
Address
class would provide convenience functions to convert one format to another without having a private key. The use case would be: I have a bc1 address and want to know its base58 version starting with 1 etc. This means one can have anAddress
instance without having a private key, but at least one version of the public key.)