When recovering addresses, gaiacli seems to ignore the account argument.
This issue is related to #3345
Using the same mnemonic, run the following commands:
gaiacli keys add gaia0 --recover --account 0
gaiacli keys add gaia1 --recover --account 1
gaiacli keys add gaia152 --recover --account 152
In all cases, the same address and pubkey will be generated.
It looks like the --account flag isn't being respected in the gaiacli keys add implementation
yes, I would say that having both --account and --index is a bit confusing
@gamarin2 @alessio FYI
Flags:
--account uint32 Account number for HD derivation
--bip44-path string BIP44 path from which to derive a private key (default "44'/118'/0'/0/0")
--index uint32 Index number for HD derivation
Now, the confusing part is that:
--account and --index ({44, 118, account, 0, index})--bip44-path--account and --index --bip44-pathThis is very confusing and not clear in the docs or flag description.
Reference:
https://github.com/cosmos/cosmos-sdk/blob/24876aa47b57e931e1988e20c7dbbeab8b59372a/client/keys/add.go#L171-L190
I think giving the option to specify the full BIP44 path may be a bit dangerous - changing the first two fields could result in conflicts with other coins. Is there any reason a user would need to do that? Unless there is, I would vote to standardize on --account and --index` - and document those better.
I think giving the option to specify the full BIP44 path may be a bit dangerous
I very much agree to that
Closed by #3461
Most helpful comment
I think giving the option to specify the full BIP44 path may be a bit dangerous - changing the first two fields could result in conflicts with other coins. Is there any reason a user would need to do that? Unless there is, I would vote to standardize on
--accountand --index` - and document those better.