Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
julian-payne opened this issue Jul 26, 2024 · 4 comments

Comments

@julian-payne
Copy link

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.

@crystalin
Copy link
Collaborator

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

@crystalin
Copy link
Collaborator

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

@RomarQ
Copy link
Contributor

RomarQ commented Dec 7, 2024

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.

@RomarQ
Copy link
Contributor

RomarQ commented Dec 7, 2024

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants