alepop / ed25519-hd-key

🔐 Key Derivation for ed25519
https://www.npmjs.com/package/ed25519-hd-key
MIT License
60 stars 28 forks source link

Invalid derivation path #259

Closed alexiskattan closed 3 years ago

alexiskattan commented 3 years ago

When using a derivation path that is great the m/44'/501'/ the program throws an error. Does ed25519 only support HD that are only two deep?

const hexSeed = 'fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542';
const { key, chainCode} = ed25519.derivePath("m/44'/501'/0/1", hexSeed);

which then throws the error

XXX\node_modules\ed25519-hd-key\dist\index.js:58
        throw new Error('Invalid derivation path');
alexiskattan commented 3 years ago

The path must be hardened for all params.