I've spent some time, trying to understand the library layout, but I suppose I'm missing something.
I run a working wallet instance (is embarrassingly easy, Sarchar did an amazing work) and wanted to add some keys into it, to do this as far I've understand, I need to instance some pyspv' keys objects, but since pyspv doesn't have BIP0032 support, I chosen to mantain my pycoin keychain.
While I've managed the PublicKey class:
from pycoin (where I already instantiated a BIP32Node to build a BIP0032 keychain)
>>> w.subwallets[1]['key'].sec()
b'\x02\xc1\x1b\x18<\xb2S\x8f\xb9\x142N\x1b\x9fY\xd5\x9a1\x1c\xd9@\xea\x9ag\rJU\xe7\x08\xb6\xf8\x07b'
>>> w.subwallets[1]['key'].bitcoin_address()
'1GkkbxV4wHsx45Ph3MQUtdCro3uQHoL2up'
to pyspv (where 'test' is an already running pyspv instance on mainnet)
>>> pk = keys.PublicKey(b'\x02\xc1\x1b\x18<\xb2S\x8f\xb9\x142N\x1b\x9fY\xd5\x9a1\x1c\xd9@\xea\x9ag\rJU\xe7\x08\xb6\xf8\x07b')
>>> pk.as_address(test.coin)
'1GkkbxV4wHsx45Ph3MQUtdCro3uQHoL2up'
..using the SEC repr of a pubkey.
I can't do the same with the PrivateKey: passing both .secret_exponent
ial() or .serialize() objects as PrivateKey secret doesn't return the expected values (a privkey' wif match). What the PrivateKey class is expecting as 'secret' ?
https://github.com/sarchar/pyspv/blob/master/pyspv/keys.py#L188