Title: Import Android wallet to Trezor [SOLVED] Post by: d4n13 on December 23, 2017, 04:11:55 AM Anyone try this.... thought it might be fun.
So I saw in decrypt threads (https://bitcointalk.org/index.php?topic=1997031.0) that someone was able to extract the BIP32 key and derivation path. Since both of these can be loaded into a Trezor, has anyone tried this to see if they get the proper key data? I plan to... but not till next year. Too much to do right now. Maybe we can get a thread started to try to figure out the gotchas before I dig to deep. Thx Title: Re: Import Android wallet to Trezor Post by: HCP on December 23, 2017, 12:44:31 PM I was under the impression that you cannot use a "custom derivation path" in a Trezor... for BTC it will always use m/44'/0'/0' as it is a BIP44 compatible hardware wallet.
Your seed will still likely work, as it is still a BIP39 seed... but without the ability to specify the "non-BIP44" derivation path that Android Bitcoin Wallet uses, you will NOT be able to seed the same addresses as generated by the Android app. Title: Re: Import Android wallet to Trezor Post by: d4n13 on December 23, 2017, 04:13:31 PM trezorctl allows any derivation
Title: Re: Import Android wallet to Trezor Post by: HCP on December 27, 2017, 12:07:32 AM Unfortunately, I don't think it will work. :-\
The "load_device" command will allow you to load the mnemonic or xprv... Code: Usage: trezorctl load_device [OPTIONS] but there is no command that you can issue that will cough up private keys etc... The best I can see is get_address, command which will return an address for a specified coin type and derivation path, but I don't see a way to get the private key data... :( Code: Usage: trezorctl get_address [OPTIONS] Only the "pubkey" using get_public_node: Code: Usage: trezorctl get_public_node [OPTIONS] which returns the following: Code: node.public_key: 03edc955f8d1d49d6fdc11c183063f58320c969c7b5d7e6f5705523b9ef19bbd24 Title: Re: Import Android wallet to Trezor Post by: d4n13 on December 27, 2017, 10:04:41 PM Yep... totally works... Here's the howto.
Required tools:
Walk through Code: pip install git+git://github.com/trezor/python-trezor.git@888b6f9 Few things to note
Title: Re: Import Android wallet to Trezor [SOLVED] Post by: HCP on December 28, 2017, 08:45:40 AM Oh... right, so you weren't actually after the key data... you just wanted to load a BIP39 seed with a custom derivation path and then use that in conjuction with your Trezor on an ongoing basis...
sorry, got confused when you said: ... Since both of these can be loaded into a Trezor, has anyone tried this to see if they get the proper key data? Given that the "sign_transaction" command will also accept the m/0'/0 address argument, there should be no issues making your Trezor work like this... except of course the fact that you need to use trezorctl to do anything with it :P Still, nice to know that it can be done... that's another plus for Trezor! Title: Re: Import Android wallet to Trezor [SOLVED] Post by: d4n13 on December 28, 2017, 08:55:43 PM Oh... right, so you weren't actually after the key data... Sure I was. I wanted the Trezor to obtain the proper key data. Never thought the Trezor would give that data to me. Reason I went on the BIP39 route instead of the BIP32 route was the availability of decrypt_bitcoinj_seed. I have a hate in my heart for Java, and there is a special spot in heaven for those that labor through it. A python / nodejs solution was much more to my liking. If you wanted to do the BIP32 route, I believe that the BIP32 xpriv is extractable from the protobuf as well. I generated some random BIP32 nodes and verified that Trezor accepted them just fine. |