moonbeam-foundation/moonbeam

Why does the util "moonkey" generate addresses with derivation path "m/44'/60'/0'/0/0" using "ethereum" as it's "coin_type"?

Opened this issue · 4 comments

Shouldn't "coin_type" be "1284" as registered in SLIP-0044, hence the derivation path be "m/44'/1284'/0'/0/0"?

Or is this necessary for full compatibility with ethereum addresses on moonbeam?

I'd like to understand the reasoning behind it.

Thanks.

The moonkey binary is not used anymore. moonbeam key is replacing it.

Concerning the derivation path, you are correct:

let derivation_path = format!("m/44'/60'/0'/0/{}", self.account_index.unwrap_or(0));

It uses Ethereum one but should have been using Moonbeam specific one.

I think if we want to fix this @RomarQ , we would have to print both to ensure legacy support for those using existing mnemonic into private key. Ideally we should keep the same generate-account-key (adding a warning message) and provide a generate-moonbeam-key using the correct derivation path

Agree, we could simply update the output of the command to print a disclaimer informing that old versions of this command used Ether coin_type.

Something like:

Address:      0x...
Mnemonic:     like ...
Private Key:  0x...
Path:         m/44'/1284'/0'/0/0


⚠️ (Deprecated) Legacy derivation path ⚠️

Old versions of this tool, used `Ether` as coin_type.

Address:      0x...
Mnemonic:     like ...
Private Key:  0x...
Path:         m/44'/60'/0'/0/0

If really necessary, we could create a new command that uses the correct coin_type and deprecate the current one.

Added a new command generate-moonbeam-key.
#3090

The old command generate-account-key now prints a warning:
image