Bitcoin Forum

Bitcoin => Electrum => Topic started by: DireWolfM14 on May 12, 2019, 09:43:37 PM



Title: View multiple Trezor accounts in Electrum?
Post by: DireWolfM14 on May 12, 2019, 09:43:37 PM
Is there a way to use Electrum to view the additional accounts I've created in my Trezor hardware wallet?  I can only see the first account I created, and don't see an option to find the other accounts.

Thanks for your help.


Title: Re: View multiple Trezor accounts in Electrum?
Post by: TryNinja on May 12, 2019, 09:56:34 PM
Setup your wallet on Electrum as you normally would (Standard Wallet -> Use a hardware wallet) and when it comes to the part where you select the script type and derivation path, change the last digit of the derivation path to the number of your wallet.

Eg:

Quote
m/49'/0'/0' (first account)
m/49'/0'/1' (second account)
m/49'/0'/2' (third account)
https://wiki.trezor.io/Apps:Electrum


Title: Re: View multiple Trezor accounts in Electrum?
Post by: HCP on May 12, 2019, 10:11:58 PM
EDIT: TryNinja'd ;)

I can see how that wording is a bit misleading. But when they say "you need to import them individually", they're not talking about importing the actual seed... They're saying that you need to create a new Electrum wallet for each account, and change the derivation path as required.

you can modify the derivation path when setting up the wallet:
https://talkimg.com/images/2023/11/15/zBtOq.png

So just select the appropriate script type (p2pkh or p2sh-segwit) and then change the "account" value of the derivation path as outlined by TryNinja.




Title: Re: View multiple Trezor accounts in Electrum?
Post by: DireWolfM14 on May 13, 2019, 03:30:42 PM
Setup your wallet on Electrum as you normally would (Standard Wallet -> Use a hardware wallet) and when it comes to the part where you select the script type and derivation path, change the last digit of the derivation path to the number of your wallet.

Eg:

Quote
m/49'/0'/0' (first account)
m/49'/0'/1' (second account)
m/49'/0'/2' (third account)
https://wiki.trezor.io/Apps:Electrum

Thank you.  I knew there had to be a way to get this done, and I'm not a fan of the Trezor wallet interface.

So, another question; Can I use the same method to create multiple accounts using a single seed phrase generated by Electrum?

Thanks again.


Title: Re: View multiple Trezor accounts in Electrum?
Post by: TryNinja on May 13, 2019, 04:23:29 PM
So, another question; Can I use the same method to create multiple accounts using a single seed phrase generated by Electrum?
Yes.

Trezor web wallet I think only allows 10 accts. If you enable passphrase, would that give you ten accts per phrase? And does electrum recognize passphrase?
I’m not sure if Electrum supports this when using a Trezor (I’ve never tried). But I know you can do this when importing a seed directly into it by clicking the “Options” button and checking “Extend this seed with custom words”, then inputing the password in the next step.


Title: Re: View multiple Trezor accounts in Electrum?
Post by: HCP on May 13, 2019, 09:09:39 PM
And does electrum recognize passphrase?
The short answer is yes... as long as you have actually enabled passphrase functionality using the wallet.trezor.io interface first. If that setting has not been turned on, Electrum will prompt for PIN but not passphrase. Once it is enabled, you will see the following during the initial wallet setup:

https://talkimg.com/images/2023/11/15/zBGwd.png


Title: Re: View multiple Trezor accounts in Electrum?
Post by: DireWolfM14 on May 16, 2019, 03:14:21 AM
So, another question; Can I use the same method to create multiple accounts using a single seed phrase generated by Electrum?
Yes.

And yes, more questions:

1) How many accounts can I set up?  Only ten, (0-9)?


2) Can I use the same seed to create or "restore" wallets with different derivation paths to create different wallet types?  For example: can I have a native segwit, a nested segwit, and a legacy wallet all backed up by the same seed?  And are these the correct derivation paths that I would use:

m/44'/0'/0'/0 (p2pkh)
m/49'/0'/0'/0 (p2wpkh-in-p2sh)
m/84'/0'/0'/0 (p2wpkh bech32)

Thanks!


Title: Re: View multiple Trezor accounts in Electrum?
Post by: DarkStar_ on May 16, 2019, 03:26:13 AM
1) How many accounts can I set up?  Only ten, (0-9)?

The web interface supports 10 accounts per coin. This is a arbitrary limit designed to decrease the limit on Trezor's servers. If you use Electrum, I don't believe there's an account limit. There is however a soft maximum 1 million addresses per account regardless of wallet chosen (you'll get warnings if you go over 1 mil) but I don't think that's a huge issue for the very very large majority of people.

2) Can I use the same seed to create or "restore" wallets with different derivation paths to create different wallet types?  For example: can I have a native segwit, a nested segwit, and a legacy wallet all backed up by the same seed?  And are these the correct derivation paths that I would use:

m/44'/0'/0'/0 (p2pkh)
m/49'/0'/0'/0 (p2wpkh-in-p2sh)
m/84'/0'/0'/0 (p2wpkh bech32)

Thanks!

Yup, you are correct on both parts.


Title: Re: View multiple Trezor accounts in Electrum?
Post by: HCP on May 16, 2019, 03:31:29 AM
1) How many accounts can I set up?  Only ten, (0-9)?
Theoretically... You can have as many as you like. The 10 account "limit" is simply a UI limitation on wallet.trezor.io... it's not a technical limitation. These accounts are not "stored" within your Trezor device etc... they are based on the "account" number value in the derivation path structure (https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#path-levels): m / purpose' / coin_type' / account' / change / address_index

Quote
2) Can I use the same seed to create or "restore" wallets with different derivation paths to create different wallet types?  For example: can I have a native segwit, a nested segwit, and a legacy wallet all backed up by the same seed?  And are these the correct derivation paths that I would use:

m/44'/0'/0'/0 (p2pkh)
m/49'/0'/0'/0 (p2wpkh-in-p2sh)
m/84'/0'/0'/0 (p2wpkh bech32)

SIDEBAR: That last 0 in each of your paths is probably best left off... according to BIP44 (https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#path-levels) (see above) that is the "change" value... 0 = receiving addresses, 1 = change... however, generally most wallets expect a path that "ends" at the account level... and will automatically add the "change" and "index" levels as required

As for what you can create, well you can actually "create" whatever you like... in whatever combination you want...

So you can "create" a wallet that generates Native Segwit, using a derivation path of m/0' or a wallet that generates Legacy addresses, using a derivation path of m/49'/0'/0' or anything other combination of script type and derivation path that you like. ;)

Electrum simply stores the derivation path and determines the script type based on the xpub "type"... ie. xpub = P2PKH, ypub = P2SH-P2WPKH and zpub = P2WPKH
Quote from: Legacy created with derivation path m/0'
"keystore": {
        "derivation": "m/0'",
        "hw_type": "trezor",
        "label": "............",
        "type": "hardware",
        "xpub": "xpub67...............mtZ"
    },
Quote from: Native SegWit using m/44'/0'/0'
   "keystore": {
        "derivation": "m/44'/0'/0'",
        "hw_type": "trezor",
        "label": "............",
        "type": "hardware",
        "xpub": "zpub6re.............S3z"
    },


Title: Re: View multiple Trezor accounts in Electrum?
Post by: DireWolfM14 on May 16, 2019, 03:56:17 AM

SIDEBAR: That last 0 in each of your paths is probably best left off... according to BIP44 (https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#path-levels) (see above) that is the "change" value... 0 = receiving addresses, 1 = change... however, generally most wallets expect a path that "ends" at the account level... and will automatically add the "change" and "index" levels as required

As for what you can create, well you can actually "create" whatever you like... in whatever combination you want...

So you can "create" a wallet that generates Native Segwit, using a derivation path of m/0' or a wallet that generates Legacy addresses, using a derivation path of m/49'/0'/0' or anything other combination of script type and derivation path that you like. ;)

Electrum simply stores the derivation path and determines the script type based on the xpub "type"... ie. xpub = P2PKH, ypub = P2SH-P2WPKH and zpub = P2WPKH
Quote from: Legacy created with derivation path m/0'
"keystore": {
        "derivation": "m/0'",
        "hw_type": "trezor",
        "label": "............",
        "type": "hardware",
        "xpub": "xpub67...............mtZ"
    },
Quote from: Native SegWit using m/44'/0'/0'
   "keystore": {
        "derivation": "m/44'/0'/0'",
        "hw_type": "trezor",
        "label": "............",
        "type": "hardware",
        "xpub": "zpub6re.............S3z"
    },

If I'm understanding you correctly, the script type determines the address configuration?  So, in your first example do the addresses start with 1 (xpub,) and in your second example, bc1 (zpub)?

That is quite an interesting sidebar, by the way.  Thank you for derailing my derailed thread.


Title: Re: View multiple Trezor accounts in Electrum?
Post by: HCP on May 16, 2019, 04:33:20 AM
If I'm understanding you correctly, the script type determines the address configuration?  So, in your first example do the addresses start with 1 (xpub,) and in your second example, bc1 (zpub)?
Yes, Yes and Yes.

And obviously, if it was a ypub it would be "3-type" ;)