avoided public derivation at root level
@@ -16,8 +16,9 @@ from btclib.hashes import fingerprint
def test_fingerprint():
- xpub = "xpub661MyMwAqRbcFMYjmw8C6dJV97a4oLss6hb3v9wTQn2X48msQB61RCaLGtNhzgPCWPaJu7SvuB9EBSFCL43kTaFJC3owdaMka85uS154cEh"
- pf = fingerprint(xpub)
- child_key = bip32.derive(xpub, 0)
+ seed = "bfc4cbaad0ff131aa97fa30a48d09ae7df914bcc083af1e07793cd0a7c61a03f65d622848209ad3366a419f4718a80ec9037df107d8d12c19b83202de00a40ad"
+ xprv = bip32.rootxprv_from_seed(seed)
+ pf = fingerprint(xprv) # xprv is automatically converted to xpub
+ child_key = bip32.derive(xprv, 0x80000000)
pf2 = bip32.deserialize(child_key)["parent_fingerprint"]
assert pf == pf2
