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

Cointype values are incorrectly computed from chainId #329

Closed
jmrossy opened this issue Mar 8, 2022 · 3 comments
Closed

Cointype values are incorrectly computed from chainId #329

jmrossy opened this issue Mar 8, 2022 · 3 comments

Comments

@jmrossy
Copy link

jmrossy commented Mar 8, 2022

Hi, I believe the CoinType values for some EVM chains are being incorrectly computed from their chainId instead of their Slip44 id

EIP 2304 specifies that the Slip44 Cointype value should be used to index chain's addresses. However in #322 and #326 some Slip44 values were changed to chainIds, causing the convertEVMChainIdToCoinType utility to compute incorrect values for the Cointypes.

For example, the computed value for Celo is 2147525868 (0x8000a4ec) when it should be 52752 (0x8000ce10).

Unfortunately, I'm not sure if there's an easy way to fix. I assume that changing the way CoinTypes are calculated in this lib would effectively invalidate all the existing records. Maybe I'm missing something?

@jmrossy
Copy link
Author

jmrossy commented Mar 8, 2022

cc @makoto who authored changes #322 and #326

Was the change to these new cointypes intentional? And should this be documented somewhere?

For context, I encountered this when trying to use Ethers.js to resolve an address. I expect others will run into issues when trying to find the cointype for evm chains if they're using any lib other than this one.

@jmrossy
Copy link
Author

jmrossy commented Mar 8, 2022

Related: #318

@makoto
Copy link
Member

makoto commented Jun 14, 2022

ENSIP superceeds SLIP44 cointype under ENSIP11 https://docs.ens.domains/ens-improvement-proposals/ensip-11-evmchain-address-resolution

@makoto makoto closed this as completed Jun 14, 2022
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

2 participants