diff --git a/btcrecover/btcrseed.py b/btcrecover/btcrseed.py index 9cc27a35..5c65178c 100644 --- a/btcrecover/btcrseed.py +++ b/btcrecover/btcrseed.py @@ -399,10 +399,15 @@ def create_from_params(cls, mpk = None, addresses = None, address_limit = None, if not mpk and not addresses and not hash160s: init_gui() while True: - mpk = tk.simpledialog.askstring("Electrum 1.x master public key", - "Please enter your master public key if you have it, or click Cancel to search by an address instead:", - initialvalue="c79b02697b32d9af63f7d2bd882f4c8198d04f0e4dfc5c232ca0c18a87ccc64ae8829404fdc48eec7111b99bda72a7196f9eb8eb42e92514a758f5122b6b5fea" - if is_performance else None) + if tk_root: # Skip if TK is not available... + mpk = tk.simpledialog.askstring("Electrum 1.x master public key", + "Please enter your master public key if you have it, or click Cancel to search by an address instead:", + initialvalue="c79b02697b32d9af63f7d2bd882f4c8198d04f0e4dfc5c232ca0c18a87ccc64ae8829404fdc48eec7111b99bda72a7196f9eb8eb42e92514a758f5122b6b5fea" + if is_performance else None) + else: + print("Error: No MPK or addresses specified... Exiting...") + exit() + if not mpk: break # if they pressed Cancel, stop prompting for an mpk mpk = mpk.strip() @@ -453,10 +458,15 @@ def create_from_params(cls, mpk = None, addresses = None, address_limit = None, if not address_limit: init_gui() # might not have been called yet before_the = "one(s) you just entered" if addresses else "first one in actual use" - address_limit = tk.simpledialog.askinteger("Address limit", - "Please enter the address generation limit. Smaller will\n" - "be faster, but it must be equal to at least the number\n" - "of addresses created before the "+before_the+":", minvalue=1) + if tk_root: # Skip if TK is not available... + address_limit = tk.simpledialog.askinteger("Address limit", + "Please enter the address generation limit. Smaller will\n" + "be faster, but it must be equal to at least the number\n" + "of addresses created before the "+before_the+":", minvalue=1) + else: + print("No address generation limit specified... Exiting...") + exit() + if not address_limit: sys.exit("canceled") self._addrs_to_generate = address_limit @@ -550,9 +560,13 @@ def config_mnemonic(cls, mnemonic_guess = None, closematch_cutoff = 0.65): # If a mnemonic guess wasn't provided, prompt the user for one if not mnemonic_guess: init_gui() + if tk_root: # Skip if TK is not available... + mnemonic_guess = tk.simpledialog.askstring("Electrum seed", + "Please enter your best guess for your Electrum seed:") + else: + print("No mnemonic guess specified... Exiting...") + exit() - mnemonic_guess = tk.simpledialog.askstring("Electrum seed", - "Please enter your best guess for your Electrum seed:") if not mnemonic_guess: sys.exit("canceled") @@ -692,10 +706,15 @@ def create_from_params(cls, mpk = None, addresses = None, address_limit = None, if not mpk and not addresses and not hash160s: init_gui() while True: - mpk = tk.simpledialog.askstring("Master extended public key", - "Please enter your account extended public key (xpub, ypub or zpub) if you " - "have it, or click Cancel to search by an address instead:", - initialvalue=self._performance_xpub() if is_performance else None) + if tk_root: # Skip if TK is not available... + mpk = tk.simpledialog.askstring("Master extended public key", + "Please enter your account extended public key (xpub, ypub or zpub) if you " + "have it, or click Cancel to search by an address instead:", + initialvalue=self._performance_xpub() if is_performance else None) + else: + print("Error: No MPK or addresses specified... Exiting...") + exit() + if not mpk: break # if they pressed Cancel, stop prompting for an mpk mpk = mpk.strip() @@ -778,10 +797,15 @@ def create_from_params(cls, mpk = None, addresses = None, address_limit = None, if not address_limit: init_gui() # might not have been called yet before_the = "one(s) you just entered" if addresses else "first one in actual use" - address_limit = tk.simpledialog.askinteger("Address limit", - "Please enter the address generation limit. Smaller will\n" - "be faster, but it must be equal to at least the number\n" - "of addresses created before the "+before_the+":", minvalue=1) + if tk_root: # Skip if TK is not available... + address_limit = tk.simpledialog.askinteger("Address limit", + "Please enter the address generation limit. Smaller will\n" + "be faster, but it must be equal to at least the number\n" + "of addresses created before the "+before_the+":", minvalue=1) + else: + print("No address generation limit specified... Exiting...") + exit() + if not address_limit: sys.exit("canceled") self._addrs_to_generate = address_limit @@ -1060,8 +1084,13 @@ def _config_mnemonic(self, mnemonic_guess, lang, passphrase, expected_len, close # If a mnemonic guess wasn't provided, prompt the user for one if not mnemonic_guess: init_gui() - mnemonic_guess = tk.simpledialog.askstring("Seed", - "Please enter your best guess for your seed (mnemonic):") + if tk_root: # Skip if TK is not available... + mnemonic_guess = tk.simpledialog.askstring("Seed", + "Please enter your best guess for your seed (mnemonic):") + else: + print("No mnemonic guess specified... Exiting...") + exit() + if not mnemonic_guess: sys.exit("canceled") @@ -1170,8 +1199,13 @@ def _config_mnemonic(self, mnemonic_guess, lang, passphrase, expected_len, close if passphrase is True: init_gui() while True: - passphrase = tk.simpledialog.askstring("Passphrase", - "Please enter the passphrase you added when the seed was first created:", show="*") + if tk_root: # Skip if TK is not available... + passphrase = tk.simpledialog.askstring("Passphrase", + "Please enter the passphrase you added when the seed was first created:", show="*") + else: + print("No passphrase specified... Exiting...") + exit() + if not passphrase: sys.exit("canceled") if passphrase == tk.simpledialog.askstring("Passphrase", "Please re-enter the passphrase:", show="*"): @@ -1416,14 +1450,17 @@ def config_mnemonic(self, mnemonic_guess = None, lang = None, passphrase = u"", file=sys.stderr) else: init_gui() - - if tk.messagebox.askyesno("Electrum 2.x version", - "Did you CREATE your wallet with Electrum version 2.7 (released Oct 2 2016) or later? (Or using a fork like Electron-Cash)" - "\n\nPlease choose No if you're unsure.", - default=tk.messagebox.NO): - expected_len = 12 + if tk_root: # Skip if TK is not available... + if tk.messagebox.askyesno("Electrum 2.x version", + "Did you CREATE your wallet with Electrum version 2.7 (released Oct 2 2016) or later? (Or using a fork like Electron-Cash)" + "\n\nPlease choose No if you're unsure.", + default=tk.messagebox.NO): + expected_len = 12 + else: + expected_len = 13 else: - expected_len = 13 + print("No You need to specify expected mnemonic length with this versonof electrum2 wallet.. Exiting...") + exit() else: expected_len_specified = True if expected_len > 13: @@ -1432,10 +1469,15 @@ def config_mnemonic(self, mnemonic_guess = None, lang = None, passphrase = u"", if self._needs_passphrase and not passphrase: passphrase = True # tells self._config_mnemonic() to prompt for a passphrase below init_gui() - tk.messagebox.showwarning("Passphrase", - 'This Electrum seed was extended with "custom words" (a seed passphrase) when it ' - "was first created. You will need to enter it to continue.\n\nNote that this seed " - "passphrase is NOT the same as the wallet password that's entered to spend funds.") + if tk_root: # Skip if TK is not available... + tk.messagebox.showwarning("Passphrase", + 'This Electrum seed was extended with "custom words" (a seed passphrase) when it ' + "was first created. You will need to enter it to continue.\n\nNote that this seed " + "passphrase is NOT the same as the wallet password that's entered to spend funds.") + else: + print("No passphrase specified... Exiting...") + exit() + # Calls WalletBIP39's generic version (note the leading _) with the mnemonic # length (which for Electrum2 wallets alone is treated only as a maximum length) passphrase = self._config_mnemonic(mnemonic_guess, lang, passphrase, expected_len, closematch_cutoff) @@ -1569,16 +1611,17 @@ def init_gui(): sys.modules["win32api"] = None sys.modules["win32com"] = None - import tkinter as tk - import tkinter.filedialog - import tkinter.simpledialog - import tkinter.messagebox - tk_root = tk.Tk(className="seedrecover.py") # initialize library - tk_root.withdraw() # but don't display a window (yet) - if not disable_security_warnings: - tkinter.messagebox.showinfo("Security Warning", "Most crypto wallet software and hardware wallets go to great lengths to protect your wallet password, seed phrase and private keys. BTCRecover isn't designed to offer this level of security, so it is possible that malware on your PC could gain access to this sensitive information while it is stored in memory in the use of this tool...\n\nAs a precaution, you should run this tool in a secure, offline environment and not simply use your normal, internet connected desktop environment... At the very least, you should disconnect your PC from the network and only reconnect it after moving your funds to a new seed... (Or if you run the tool on your internet conencted PC, move it to a new seed as soon as practical\n\nYou can disable this message by running this tool with the --dsw argument") - - + try: + import tkinter as tk + import tkinter.filedialog + import tkinter.simpledialog + import tkinter.messagebox + tk_root = tk.Tk(className="seedrecover.py") # initialize library + tk_root.withdraw() # but don't display a window (yet) + if not disable_security_warnings: + tkinter.messagebox.showinfo("Security Warning", "Most crypto wallet software and hardware wallets go to great lengths to protect your wallet password, seed phrase and private keys. BTCRecover isn't designed to offer this level of security, so it is possible that malware on your PC could gain access to this sensitive information while it is stored in memory in the use of this tool...\n\nAs a precaution, you should run this tool in a secure, offline environment and not simply use your normal, internet connected desktop environment... At the very least, you should disconnect your PC from the network and only reconnect it after moving your funds to a new seed... (Or if you run the tool on your internet conencted PC, move it to a new seed as soon as practical\n\nYou can disable this message by running this tool with the --dsw argument") + except: + print("Warning: Unable to load TK, no gui available, you will need to set some recovery arguments manually") # seed.py uses routines from password.py to generate guesses, however instead # of dealing with passwords (immutable sequences of characters), it deals with @@ -1806,6 +1849,7 @@ def main(argv): parser.add_argument("--language", metavar="LANG-CODE", help="the wordlist language to use (see wordlists/README.md, default: auto)") parser.add_argument("--bip32-path", metavar="PATH", help="path (e.g. m/0'/0/) excluding the final index. You can specify multiple derivation paths seperated by a comma Eg: m/84'/0'/0'/0,m/84'/0'/1'/0. (default: BIP44,BIP49 & BIP84 account 0)") parser.add_argument("--pathlist", metavar="FILE", help="A list of derivation paths to be searched") + parser.add_argument("--coin", metavar="COIN-CODE", help="Coin to be searched for (Checks the derivation pahts in the corresponding file in ./common-derication-pathlists/") parser.add_argument("--skip", type=int, metavar="COUNT", help="skip this many initial passwords for continuing an interrupted search") parser.add_argument("--threads", type=int, metavar="COUNT", help="number of worker threads (default: For CPU Processing, logical CPU cores, for GPU, physical CPU cores)") parser.add_argument("--worker", metavar="ID#(ID#2, ID#3)/TOTAL#", help="divide the workload between TOTAL# servers, where each has a different ID# between 1 and TOTAL# (You can optionally assign between 1 and TOTAL IDs of work to a server (eg: 1,2/3 will assign both slices 1 and 2 of the 3 to the server...)") @@ -1853,6 +1897,10 @@ def main(argv): parser.parse_args(argv) # re-parse them just to generate an error for the unknown args assert False + # Automatically convert coin argument to pathlist + if args.coin: + args.pathlist = "./common-derivation-pathlists/" + args.coin + ".txt" + # Pass an argument so that btcrpass knows that we are running a seed recovery extra_args.append("--btcrseed") @@ -2081,7 +2129,12 @@ def main(argv): # Ask for a wallet file init_gui() - wallet_filename = tk.filedialog.askopenfilename(title="Please select your wallet file if you have one") + if tk_root: # Skip if TK is not available... + wallet_filename = tk.filedialog.askopenfilename(title="Please select your wallet file if you have one") + else: + print("No wallet file specified... Exiting...") + exit() + if wallet_filename: loaded_wallet = btcrpass.load_wallet(wallet_filename) # raises on failure; no second chance @@ -2089,30 +2142,35 @@ def main(argv): if not wallet_type: # if --wallet-type wasn't specified - # Without a wallet file, we can't automatically determine the wallet type, so prompt the - # user to select a wallet that's been registered with @register_selectable_wallet_class - selectable_wallet_classes.sort(key=lambda x: x[1]) # sort by description - class WalletTypeDialog(tk.simpledialog.Dialog): - def body(self, master): - self.wallet_type = None - self._index_to_cls = [] - self._selected_index = tk.IntVar(value= -1) - for i, (cls, desc) in enumerate(selectable_wallet_classes): - self._index_to_cls.append(cls) - tk.Radiobutton(master, variable=self._selected_index, value=i, text=desc) \ - .pack(anchor=tk.W) - def validate(self): - if self._selected_index.get() < 0: - tk.messagebox.showwarning("Wallet Type", "Please select a wallet type") - return False - return True - def apply(self): - self.wallet_type = self._index_to_cls[self._selected_index.get()] - # - wallet_type_dialog = WalletTypeDialog(tk_root, "Please select your wallet type") - wallet_type = wallet_type_dialog.wallet_type - if not wallet_type: - sys.exit("canceled") + if tk_root: # Skip if TK is not available... + # Without a wallet file, we can't automatically determine the wallet type, so prompt the + # user to select a wallet that's been registered with @register_selectable_wallet_class + selectable_wallet_classes.sort(key=lambda x: x[1]) # sort by description + class WalletTypeDialog(tk.simpledialog.Dialog): + def body(self, master): + self.wallet_type = None + self._index_to_cls = [] + self._selected_index = tk.IntVar(value= -1) + for i, (cls, desc) in enumerate(selectable_wallet_classes): + self._index_to_cls.append(cls) + tk.Radiobutton(master, variable=self._selected_index, value=i, text=desc) \ + .pack(anchor=tk.W) + def validate(self): + if self._selected_index.get() < 0: + tk.messagebox.showwarning("Wallet Type", "Please select a wallet type") + return False + return True + def apply(self): + self.wallet_type = self._index_to_cls[self._selected_index.get()] + # + wallet_type_dialog = WalletTypeDialog(tk_root, "Please select your wallet type") + wallet_type = wallet_type_dialog.wallet_type + if not wallet_type: + sys.exit("canceled") + + else: + print("No wallet or wallet type speciiced... Exiting...") + exit() try: loaded_wallet = wallet_type.create_from_params(**create_from_params) @@ -2285,10 +2343,8 @@ def apply(self): # These two phases are added to all searches phases.extend(( dict(typos=1, big_typos=1), dict(typos=2, big_typos=1, min_typos=2) )) # - # Add a final more thorough phase if it's not likely to take more than a few hours - if len(mnemonic_ids_guess) <= 13 and passwords_per_seconds >= 750 or \ - len(mnemonic_ids_guess) <= 19 and passwords_per_seconds >= 2500: - phases.append(dict(typos=3, big_typos=1, min_typos=3, extra_args=["--no-dupchecks"])) + # Add a final more thorough phase (This one will take a few hours) + phases.append(dict(typos=2, big_typos=2, min_typos=2, extra_args=["--no-dupchecks"])) for phase_num, phase_params in enumerate(phases, 1): # Print Timestamp that this step occured diff --git a/btcrecover/test/test_seeds.py b/btcrecover/test/test_seeds.py index 238a6411..58aac894 100644 --- a/btcrecover/test/test_seeds.py +++ b/btcrecover/test/test_seeds.py @@ -393,63 +393,78 @@ def test_bip84_addr_BTC_defaultderivationpaths(self): def test_bip44_addr_XRP(self): self.address_tester(btcrseed.WalletBIP39, "rJGNUmwiYDwXEsLzUFV9njhP3syrDvA6hs", 2, - "certain come keen collect slab gauge photo inside mechanic deny leader drop", "m/44'/144'/0'/0") + "certain come keen collect slab gauge photo inside mechanic deny leader drop", + "m/44'/144'/0'/0") def test_bip44_addr_BTC(self): self.address_tester(btcrseed.WalletBIP39, "1AiAYaVJ7SCkDeNqgFz7UDecycgzb6LoT3", 2, - "certain come keen collect slab gauge photo inside mechanic deny leader drop", "m/44'/0'/0'/0") + "certain come keen collect slab gauge photo inside mechanic deny leader drop", + "m/44'/0'/0'/0") def test_bip44_addr_BTC_multi_coin_derivationpaths(self): self.address_tester(btcrseed.WalletBIP39, "1AiAYaVJ7SCkDeNqgFz7UDecycgzb6LoT3", 2, - "certain come keen collect slab gauge photo inside mechanic deny leader drop", "m/44'/4'/0'/0,m/44'/3'/0'/0,m/44'/2'/0'/0,m/44'/1'/0'/0,m/44'/0'/0'/0") + "certain come keen collect slab gauge photo inside mechanic deny leader drop", + "m/44'/4'/0'/0,m/44'/3'/0'/0,m/44'/2'/0'/0,m/44'/1'/0'/0,m/44'/0'/0'/0") def test_bip44_addr_BTC_multi_account_derivationpaths(self): self.address_tester(btcrseed.WalletBIP39, "1Bi4fRZTPna1nbBJ8KLxaFfWV3BFDV9xj3", 2, - "certain come keen collect slab gauge photo inside mechanic deny leader drop", "m/44'/0'/0'/0,m/44'/0'/1'/0,m/44'/0'/2'/0,m/44'/0'/3'/0,m/44'/0'/4'/0") + "certain come keen collect slab gauge photo inside mechanic deny leader drop", + "m/44'/0'/0'/0,m/44'/0'/1'/0,m/44'/0'/2'/0,m/44'/0'/3'/0,m/44'/0'/4'/0") def test_bip49_addr_BTC(self): self.address_tester(btcrseed.WalletBIP39, "3NiRFNztVLMZF21gx6eE1nL3Q57GMGuunG", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/49'/0'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/49'/0'/0'/0") def test_bip84_addr_BTC(self): self.address_tester(btcrseed.WalletBIP39, "bc1qv87qf7prhjf2ld8vgm7l0mj59jggm6ae5jdkx2", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/84'/0'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/84'/0'/0'/0") def test_bip44_addr_LTC(self): self.address_tester(btcrseed.WalletBIP39, "LhHbcBk84JpB41otvD7qqWzyGgyr8yDJ2a", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/44'/2'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/44'/2'/0'/0") def test_bip49_addr_LTC(self): self.address_tester(btcrseed.WalletBIP39, "MQT8szKNYyJU1hUPLnsfCYXkqLQbTewsj9", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/49'/2'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/49'/2'/0'/0") def test_bip84_addr_LTC(self): self.address_tester(btcrseed.WalletBIP39, "ltc1qeyk3wpf2zjqh8h6zz722tfrf4asq0st2mc05ed", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/84'/2'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/84'/2'/0'/0") def test_bip44_addr_VTC(self): self.address_tester(btcrseed.WalletBIP39, "VwrYFHeKbneYZdkPWTpXsUs3ZQ4ERan9tG", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/44'/28'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/44'/28'/0'/0") def test_bip49_addr_VTC(self): self.address_tester(btcrseed.WalletBIP39, "33DUUsVoodofnbrxFhqCSBkKaqjCHzQyYU", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/49'/28'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/49'/28'/0'/0") def test_bip84_addr_VTC(self): self.address_tester(btcrseed.WalletBIP39, "vtc1q4r6d6w0xnd4t2rlj8njcl7m7a9k0ezk9rjnc77", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/84'/28'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/84'/28'/0'/0") def test_bip44_addr_MONA(self): self.address_tester(btcrseed.WalletBIP39, "MHKtawgixN8ZKgae3ZxRuwd3ueKZy573By", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/44'/22'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/44'/22'/0'/0") def test_bip49_addr_MONA(self): self.address_tester(btcrseed.WalletBIP39, "P8gv2vrMyVhDdjHgJf6yxH3vGarM9fCZ9f", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/49'/22'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/49'/22'/0'/0") def test_bip84_addr_MONA(self): self.address_tester(btcrseed.WalletBIP39, "monacoin1q9v93ngm8srxtq7lwzypehax7xvewh2vch68m2f", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/84'/22'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/84'/22'/0'/0") def test_bip44_addr_DGB(self): self.address_tester(btcrseed.WalletBIP39, "D8uui9mGXztcpZy5t5jWpSimCCyEDjYRHY", 5, @@ -468,24 +483,41 @@ def test_bip84_addr_DGB(self): def test_bip44_addr_BCH_CashAddr(self): self.address_tester(btcrseed.WalletBIP39, "bitcoincash:qrdupm96x04u3ssjnuj7lpy7adt9y34p5vzh95y0y7", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/44'/145'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/44'/145'/0'/0") def test_bip44_addr_BCH_CashAddr_NoPrefix(self): self.address_tester(btcrseed.WalletBIP39, "qrdupm96x04u3ssjnuj7lpy7adt9y34p5vzh95y0y7", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/44'/145'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/44'/145'/0'/0") def test_bip44_addr_DASH(self): self.address_tester(btcrseed.WalletBIP39, "XkRVBsXz1UG7LP48QKT4ZEbyUS54oRjYpM", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/44'/5'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/44'/5'/0'/0") def test_bip44_addr_DOGE(self): self.address_tester(btcrseed.WalletBIP39, "DANb1e9B2WtHJNDJUsiu1fTrtAzGJhqkPa", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/44'/3'/0'/0") + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/44'/3'/0'/0") @skipUnless(can_load_groestlcoin_hash, "requires groestlcoin_hash") def test_bip44_addr_GRS(self): - self.address_tester(btcrseed.WalletBIP39, "FWoJyPj8sFzBN1dVdLfG8ozrVLRjwZaC78", 2, - "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/44'/17'/0'/0") + self.address_tester(btcrseed.WalletBIP39, "FqGMQvKCb2idGbDd6SUBFuugynXRACEzuQ", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/44'/17'/0'/0") + + @skipUnless(can_load_groestlcoin_hash, "requires groestlcoin_hash") + def test_bip49_addr_GRS(self): + self.address_tester(btcrseed.WalletBIP39, "384swZndJ7CjZhqx7JL29Whnommy9s9phF", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/49'/17'/0'/0") + + @skipUnless(can_load_groestlcoin_hash, "requires groestlcoin_hash") + def test_bip84_addr_GRS(self): + self.address_tester(btcrseed.WalletBIP39, "grs1qk3w05mpw042rldy692lxp0wee0fgxw7au7umpc", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/84'/17'/0'/0") @unittest.skipUnless(can_load_keccak(), "requires pycryptodome") def test_ethereum_addr(self): @@ -556,6 +588,7 @@ def test_pathfile_Eth_Coinomi(self): self.address_tester(btcrseed.WalletEthereum, "0xE16fCCbBa5EC2C2e4584A846ce3b77a6F37E863c", 2, "talk swamp tool right wide vital midnight cushion fiber blouse field transfer", pathlist_file="ETH.txt") + @unittest.skipUnless(can_load_keccak(), "requires pycryptodome") def test_pathfile_Eth_Default(self): self.address_tester(btcrseed.WalletEthereum, "0x1a05a75E4041eFB46A34F208b677F82C079197D8", 2, @@ -572,6 +605,79 @@ def test_pathfile_BCH(self): "certain come keen collect slab gauge photo inside mechanic deny leader drop", pathlist_file="BCH.txt") + def test_pathfile_bip44_addr_VTC(self): + self.address_tester(btcrseed.WalletBIP39, "VwrYFHeKbneYZdkPWTpXsUs3ZQ4ERan9tG", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + pathlist_file="VTC.txt") + + def test_pathfile_bip49_addr_VTC(self): + self.address_tester(btcrseed.WalletBIP39, "33DUUsVoodofnbrxFhqCSBkKaqjCHzQyYU", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + pathlist_file="VTC.txt") + + def test_pathfile_bip84_addr_VTC(self): + self.address_tester(btcrseed.WalletBIP39, "vtc1q4r6d6w0xnd4t2rlj8njcl7m7a9k0ezk9rjnc77", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + pathlist_file="VTC.txt") + + def test_pathfile_bip44_addr_MONA(self): + self.address_tester(btcrseed.WalletBIP39, "MHKtawgixN8ZKgae3ZxRuwd3ueKZy573By", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + pathlist_file="MONA.txt") + + def test_pathfile_bip49_addr_MONA(self): + self.address_tester(btcrseed.WalletBIP39, "P8gv2vrMyVhDdjHgJf6yxH3vGarM9fCZ9f", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + pathlist_file="MONA.txt") + + def test_pathfile_bip84_addr_MONA(self): + self.address_tester(btcrseed.WalletBIP39, "monacoin1q9v93ngm8srxtq7lwzypehax7xvewh2vch68m2f", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + pathlist_file="MONA.txt") + + def test_bip44_addr_DGB(self): + self.address_tester(btcrseed.WalletBIP39, "D8uui9mGXztcpZy5t5jWpSimCCyEDjYRHY", 5, + "barrel tag debate reopen federal fee soda fog twelve garage sweet current", + pathlist_file="DGB.txt") + + def test_pathfile_bip49_addr_DGB(self): + self.address_tester(btcrseed.WalletBIP39, "SjM4p9vWB7GvsiNMgyZef67SJz3SgmPwhj", 5, + "barrel tag debate reopen federal fee soda fog twelve garage sweet current", + pathlist_file="DGB.txt") + + def test_pathfile_bip84_addr_DGB(self): + self.address_tester(btcrseed.WalletBIP39, "dgb1qmtpcmpt5amuvvwvpelh220ec2ck7q4prsy2tqy", 5, + "barrel tag debate reopen federal fee soda fog twelve garage sweet current", + pathlist_file="DGB.txt") + + def test_pathfile_bip44_addr_DASH(self): + self.address_tester(btcrseed.WalletBIP39, "XkRVBsXz1UG7LP48QKT4ZEbyUS54oRjYpM", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + pathlist_file="DASH.txt") + + def test_pathfile_bip44_addr_DOGE(self): + self.address_tester(btcrseed.WalletBIP39, "DANb1e9B2WtHJNDJUsiu1fTrtAzGJhqkPa", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + pathlist_file="DOGE.txt") + + @skipUnless(can_load_groestlcoin_hash, "requires groestlcoin_hash") + def test_bip44_addr_GRS(self): + self.address_tester(btcrseed.WalletBIP39, "FqGMQvKCb2idGbDd6SUBFuugynXRACEzuQ", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + pathlist_file="GRS.txt") + + @skipUnless(can_load_groestlcoin_hash, "requires groestlcoin_hash") + def test_bip49_addr_GRS(self): + self.address_tester(btcrseed.WalletBIP39, "384swZndJ7CjZhqx7JL29Whnommy9s9phF", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + pathlist_file="GRS.txt") + + @skipUnless(can_load_groestlcoin_hash, "requires groestlcoin_hash") + def test_bip84_addr_GRS(self): + self.address_tester(btcrseed.WalletBIP39, "grs1qk3w05mpw042rldy692lxp0wee0fgxw7au7umpc", 2, + "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + pathlist_file="GRS.txt") + @skipUnless(has_any_opencl_devices, "requires OpenCL and a compatible device") def test_BIP39_BTC_OpenCL_Brute(self): the_address = "1AiAYaVJ7SCkDeNqgFz7UDecycgzb6LoT3" @@ -893,28 +999,34 @@ def test_addressdb_bip84_vtc(self): #MONA AddressDB Tests # m/44'/22'/1'/0/1 MPEbQUqKXPf8A9TCQTiGPhMcRBPwySroHg def test_addressdb_bip44_mona(self): - self.addressdb_tester(btcrseed.WalletBIP39, 2, "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/44'/22'/1'/0", "addresses-MONA-Test.db") + self.addressdb_tester(btcrseed.WalletBIP39, 2, "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/44'/22'/1'/0", "addresses-MONA-Test.db") # m/49'/22'/1'/0/1 PNJmRN936aqgzuyXaRKiEHsy5mHKw4QWqn def test_addressdb_bip49_mona(self): - self.addressdb_tester(btcrseed.WalletBIP39, 2, "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/49'/22'/1'/0", "addresses-MONA-Test.db") + self.addressdb_tester(btcrseed.WalletBIP39, 2, "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/49'/22'/1'/0", "addresses-MONA-Test.db") # m/84'/22'/1'/0/1 mona1qx9kllhxc4u4evjdhyejsseyqntjursxtewdcmm def test_addressdb_bip84_mona(self): - self.addressdb_tester(btcrseed.WalletBIP39, 2, "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", "m/84'/22'/1'/0", "addresses-MONA-Test.db") + self.addressdb_tester(btcrseed.WalletBIP39, 2, "element entire sniff tired miracle solve shadow scatter hello never tank side sight isolate sister uniform advice pen praise soap lizard festival connect baby", + "m/84'/22'/1'/0", "addresses-MONA-Test.db") #DGB AddressDB Tests # m/44'/20'/0'/4 D8uui9mGXztcpZy5t5jWpSimCCyEDjYRHY def test_addressdb_bip44_dgb(self): - self.addressdb_tester(btcrseed.WalletBIP39, 5, "barrel tag debate reopen federal fee soda fog twelve garage sweet current", "m/44'/20'/0'/0", "addresses-DGB-Test.db") + self.addressdb_tester(btcrseed.WalletBIP39, 5, "barrel tag debate reopen federal fee soda fog twelve garage sweet current", + "m/44'/20'/0'/0", "addresses-DGB-Test.db") # m/49'/20'/0'/4 SjM4p9vWB7GvsiNMgyZef67SJz3SgmPwhj def test_addressdb_bip49_dgb(self): - self.addressdb_tester(btcrseed.WalletBIP39, 5, "barrel tag debate reopen federal fee soda fog twelve garage sweet current", "m/49'/20'/0'/0", "addresses-DGB-Test.db") + self.addressdb_tester(btcrseed.WalletBIP39, 5, "barrel tag debate reopen federal fee soda fog twelve garage sweet current", + "m/49'/20'/0'/0", "addresses-DGB-Test.db") # m/84'/20'/0'/4 dgb1qmtpcmpt5amuvvwvpelh220ec2ck7q4prsy2tqy def test_addressdb_bip84_dgb(self): - self.addressdb_tester(btcrseed.WalletBIP39, 5, "barrel tag debate reopen federal fee soda fog twelve garage sweet current", "m/84'/20'/0'/0", "addresses-DGB-Test.db") + self.addressdb_tester(btcrseed.WalletBIP39, 5, "barrel tag debate reopen federal fee soda fog twelve garage sweet current", + "m/84'/20'/0'/0", "addresses-DGB-Test.db") class TestSeedTypos(unittest.TestCase): diff --git a/common-derivation-pathlists/DASH.txt b/common-derivation-pathlists/DASH.txt new file mode 100644 index 00000000..e6a13192 --- /dev/null +++ b/common-derivation-pathlists/DASH.txt @@ -0,0 +1 @@ +m/44'/5'/0'/0 #Default BIP44 P2PKH \ No newline at end of file diff --git a/common-derivation-pathlists/DGB.txt b/common-derivation-pathlists/DGB.txt new file mode 100644 index 00000000..5107a7ef --- /dev/null +++ b/common-derivation-pathlists/DGB.txt @@ -0,0 +1,3 @@ +m/44'/20'/0'/0 #BIP44 (Legacy) +m/49'/20'/0'/0 #BIP49 (Segwit) +m/84'/20'/0'/0 #BIP84 (Native Segwit) \ No newline at end of file diff --git a/common-derivation-pathlists/DOGE.txt b/common-derivation-pathlists/DOGE.txt new file mode 100644 index 00000000..9a5970f9 --- /dev/null +++ b/common-derivation-pathlists/DOGE.txt @@ -0,0 +1 @@ +m/44'/3'/0'/0 #BIP44 (Legacy) \ No newline at end of file diff --git a/common-derivation-pathlists/GRS.txt b/common-derivation-pathlists/GRS.txt new file mode 100644 index 00000000..fd7db0c9 --- /dev/null +++ b/common-derivation-pathlists/GRS.txt @@ -0,0 +1,3 @@ +m/44'/17'/0'/0 #BIP44 (Legacy) +m/49'/17'/0'/0 #BIP49 (Segwit) +m/84'/17'/0'/0 #BIP84 (Native Segwit) \ No newline at end of file diff --git a/common-derivation-pathlists/MONA.txt b/common-derivation-pathlists/MONA.txt new file mode 100644 index 00000000..51207715 --- /dev/null +++ b/common-derivation-pathlists/MONA.txt @@ -0,0 +1,3 @@ +m/44'/22'/0'/0 #BIP44 (Legacy) +m/49'/22'/0'/0 #BIP49 (Segwit) +m/84'/22'/0'/0 #BIP84 (Native Segwit) \ No newline at end of file diff --git a/common-derivation-pathlists/VTC.txt b/common-derivation-pathlists/VTC.txt new file mode 100644 index 00000000..0a8f89f9 --- /dev/null +++ b/common-derivation-pathlists/VTC.txt @@ -0,0 +1,3 @@ +m/44'/28'/0'/0 #BIP44 (Legacy) +m/49'/28'/0'/0 #BIP49 (Segwit) +m/84'/28'/0'/0 #BIP84 (Native Segwit) \ No newline at end of file diff --git a/common-derivation-pathlists/XRP.txt b/common-derivation-pathlists/XRP.txt new file mode 100644 index 00000000..4d35639b --- /dev/null +++ b/common-derivation-pathlists/XRP.txt @@ -0,0 +1 @@ +m/44'/144'/0'/0 #BIP44 (Legacy) \ No newline at end of file