indentical pub/priv keys from different derivation paths #3699
-
maybe it's problem with my code but i get indentical pairs of public/private keys for different derivations paths like 44'/397'/0'/0'/0 44'/397'/0'/0'/1 44'/397'/0'/0'/2 and so on
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @ArturLevchuk, thank you for opening the issue! const privateKey = wallet.getDerivedKey(CoinType.near, "m/44'/397'/1'/0'/2'"); |
Beta Was this translation helpful? Give feedback.
Hi @ArturLevchuk, thank you for opening the issue!
NEAR uses ED25519 cryptography that doesn't support non-hardened child keys as per standard BIP32.
Unfortunately,
HDWallet::getDerivedKey
consider change and address indexes as non-hardened always, so it does not work properly with blockchains built upon ED25519.Please consider using
HDWallet::getKey
with the derivation path as a string where all indexes are hardened (ends with'
):