Skip to content

indentical pub/priv keys from different derivation paths #3699

Discussion options

You must be logged in to vote

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 '):

const privateKey = wallet.getDerivedKey(CoinType.near, "m/44'/397'/1'/0'/2'");

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ArturLevchuk
Comment options

Answer selected by ArturLevchuk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug Something isn't working
2 participants
Converted from issue

This discussion was converted from issue #3696 on February 26, 2024 13:45.