kukai-wallet / kukai

Web wallet for the Tezos blockchain
Apache License 2.0
180 stars 100 forks source link

Switching between derivation paths #378

Open clauswilke opened 2 years ago

clauswilke commented 2 years ago

Is there any way to use multiple derivation paths and switch between them? This is commonly done in other wallets to create more than one address. For example, create an address for 44'/1729'/0'/0', one for 44'/1729'/1'/0', and one for 44'/1729'/2'/0', and then switch between them quickly without having to log in and out every time.

I was hoping that if I created a wallet for 44'/1729'/1'/0' that the one for 44'/1729'/0'/0' was found as well, but that doesn't seem to be the case.

klassare commented 2 years ago

If you import an HD wallet in Kukai it will do account discovery as described in bip44. So it will first check 44'/1729'/0'/0', if it's a used account it will continue with 44'/1729'/1'/0' and so on until it finds an unused account (no blockchain history). Note that Kukai will also prevent creation of an account if a previous account is unused (as recommend in bip44).

clauswilke commented 2 years ago

I see. I used 44'/1729'/1'/0' as the derivation path and then it didn't seem to see 44'/1729'/0'/0', so I was unsure. But if I understand correctly, if I send any funds to 44'/1729'/1'/0' then that wallet will exist and then Kukai will see both if I leave the derivation path as default? I'm still not quite sure what the best way is to create the next account in the sequence.

It would be great if this could be added to the documentation somewhere, as right now I don't think it's stated anywhere.

klassare commented 2 years ago

I thought you had a keystore wallet. If you use a Ledger device it's a little bit different. In that case you will need to logout and import to switch between accounts (for the moment). Account discovery have not been possible with Ledger before from a web wallet. But now with web hid that's no longer a blocker.

clauswilke commented 2 years ago

Got it. Either way, I'm starting to understand how all of this works. Thanks for your help!