Coding-Enthusiast / FinderOuter

Easy to use bitcoin recovery tool to fix damaged private key, mini-private key, address, BIP38 encrypted key, mnemonic (seed phrase), BIP-32 derivation path, Armory backups, recover passwords and more
MIT License
283 stars 107 forks source link

Allow valid armory characters #35

Closed MonkishMan closed 2 years ago

MonkishMan commented 2 years ago

in armory the valid input characters into the dialogs are based on

BASE58CHARS = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

in finderOuter they are based on constants in file ConstantsFO.cs line 18

ArmoryChars = "asdfghjkwertuion";

I might be mistaken but I think the finderOuter armory chars is too restrictive by not allowing characters such as b or c etc.

ArmoryService.cs line 600:

else if (lines.Any(line => line.Any(c => **!ConstantsFO.ArmoryChars.Contains(c)** && c != missChar))) { report.Fail("Input contains invalid characters."); }

I might be misunderstanding the code, apologies if that's the case.

Coding-Enthusiast commented 2 years ago

As far as I know the recovery phrases are encoded as base-16 but with different characters than the regular base-16 encoding aka hexadecimal. It is called "Typing-friendly Base16". In this encoding the asdfghjkwertuion charset is used instead of 0123456789abcdef.
https://github.com/etotheipi/BitcoinArmory/blob/2a6fc5355bb0c6fe26e387ccba30a5baafe8cd98/armoryengine/ArmoryUtils.py#L2151-L2162

MonkishMan commented 2 years ago

I have a root key which has characters that are outside the typing friendly set. I can only presume that the armory software has changed over time and that the typing friendly base 16 set is a new feature for new type of keys, but the armory software itself still accepts and validates a different set for recovery.

Coding-Enthusiast commented 2 years ago

If you could show me the alternative encoding algorithms on the source code and give me an example/test case I may be able to implement them too.

MonkishMan commented 2 years ago

OK I will try get you some info. Thanks

MonkishMan commented 2 years ago

Is the type friendly code not just for the qr code generation? The comment above the code in github you linked to only mentions qr codes.

MonkishMan commented 2 years ago

Also ethopi abandoned the armory project some years ago, it's now built from a fork by goatpig as far as I understand. https://github.com/goatpig/BitcoinArmory

Coding-Enthusiast commented 2 years ago

Is the type friendly code not just for the qr code generation?

No, it is used for recovery phrases mainly.

Also ethopi abandoned the armory project some years ago, it's now built from a fork by goatpig as far as I understand. https://github.com/goatpig/BitcoinArmory

Yes. But GitHub doesn't have the option to search inside forked repositories so it was easier to do it in the parent repository. Things regarding encoding doesn't seem to have changed: https://github.com/goatpig/BitcoinArmory/blob/master/armoryengine/ArmoryUtils.py#L2246

MonkishMan commented 2 years ago

Thanks for the info, I will try look at the code when I get the chance and try understand how the encoding works for wallet recovery. I really appreciate your insights. Thank you.