Skip to content

Commit ae9b05d

Browse files
committed
The code uses the vbytes to determine if the input key is private or public.
However, it's only checking against MAINNET_PRIVATE by default, which can lead to issues if you're using testnet prefixes. `private = (vbytes == prefixes[0])` has been changed to `private = vbytes in PRIVATE` With this change, both mainnet (xprv) and testnet (tprv) private keys will be recognized correctly.
1 parent e7c96bf commit ae9b05d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cryptos/deterministic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def raw_bip32_ckd(rawtuple, i, prefixes=DEFAULT):
7474
vbytes, depth, fingerprint, oldi, chaincode, key = rawtuple
7575
i = int(i)
7676

77-
private = vbytes == prefixes[0]
77+
private = (vbytes in PRIVATE)
7878

7979
if private:
8080
priv = key

0 commit comments

Comments
 (0)