We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57cda59 commit acb94d6Copy full SHA for acb94d6
1 file changed
bip32/bip32.py
@@ -156,18 +156,19 @@ def from_xpriv(cls, xpriv):
156
extended_key = base58.b58decode_check(xpriv)
157
(prefix, depth, fingerprint,
158
index, chaincode, key) = _unserialize_extended_key(extended_key)
159
- return BIP32(chaincode, key, None)
+ # We need to remove the trailing `0` before the actual private key !!
160
+ return BIP32(chaincode, privkey=key[1:], pubkey=None)
161
162
@classmethod
- def from_xpub(cls, xpriv):
163
+ def from_xpub(cls, xpub):
164
"""Get a BIP32 "wallet" out of this xpub
165
166
:param xpub: (str) The encoded serialized extended public key.
167
"""
- extended_key = base58.b58decode_check(xpriv)
168
+ extended_key = base58.b58decode_check(xpub)
169
170
- return BIP32(chaincode, None, key)
171
+ return BIP32(chaincode, privkey=None, pubkey=key)
172
173
174
def from_seed(cls, seed):
0 commit comments