From 0471b3731fd24ef4e5d4c6d7a6a19e942b27dfa4 Mon Sep 17 00:00:00 2001 From: Determinant Date: Mon, 17 May 2021 13:24:47 -0400 Subject: ... --- README.rst | 6 ------ keytree.py | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.rst b/README.rst index c9c4f4a..752b4fa 100644 --- a/README.rst +++ b/README.rst @@ -14,12 +14,6 @@ Examples screen) - Use arbitrary UTF-8 string as your mnemonic ``./keytree.py --custom --save mykeystore.json`` - Show Fuji testnet address format ``./keytree.py --hrp fuji`` -- Use Metamask's deriving algorithm: ``./keytree.py - --path "44'/60'/0'/0"`` or ``./keytree.py --metamask``. By - default, ETH addresses/keys use AVAX's deriving path (AVAX C-Chain - keys/addresses) instead of Metamask's. To treat the mnemonic in Metamask's - way, use ``--path``. Whatever deriving path is used, the generated - individual key-address pair is always valid Ethereum format. Caveat ------ diff --git a/keytree.py b/keytree.py index 0f3166c..33c37ef 100755 --- a/keytree.py +++ b/keytree.py @@ -416,6 +416,12 @@ if __name__ == '__main__': print("{}.priv(raw/ETH) 0x{}".format(i, priv.to_string().hex())) print("{}.priv(BTC) {}".format(i, get_privkey_btc(priv))) print("{}.addr(AVAX) (X/P)-{}".format(i, bech32.bech32_encode(args.hrp, bech32.convertbits(ripemd160(sha256(cpub)), 8, 5)))) + + path2 = "m/{}/{}".format(metamask_path, i) + priv2 = gen.derive(path2) + pub2 = priv2.get_verifying_key() + print("{}.addr(AVAX) (C) {}".format(i, get_eth_addr(pub2))) + print("{}.addr(BTC) {}".format(i, get_btc_addr(pub))) print("{}.addr(ETH) {}".format(i, get_eth_addr(pub))) if args.export_mew: -- cgit v1.2.3-70-g09d2