commit 3842205b8a1b48bbe8da58de34f60f2145aea7f5
parent 152c6abb86f41e3fdf0992501f500571e806091b
Author: SomberNight <somber.night@protonmail.com>
Date: Wed, 12 Sep 2018 18:22:34 +0200
keystore: add note regarding xpubkeys
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/electrum/keystore.py b/electrum/keystore.py
@@ -253,12 +253,17 @@ class Xpub:
@classmethod
def parse_xpubkey(self, pubkey):
+ # type + xpub + derivation
assert pubkey[0:2] == 'ff'
pk = bfh(pubkey)
+ # xpub:
pk = pk[1:]
xkey = bitcoin.EncodeBase58Check(pk[0:78])
+ # derivation:
dd = pk[78:]
s = []
+ # FIXME: due to an oversight, levels in the derivation are only
+ # allocated 2 bytes, instead of 4 (in bip32)
while dd:
n = int(bitcoin.rev_hex(bh2u(dd[0:2])), 16)
dd = dd[2:]