alepop / ed25519-hd-key

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

Getting different values than in the example #258

Closed alexiskattan closed 3 years ago

alexiskattan commented 3 years ago

Getting different values when I'm trying out the example.

const hexSeed = 'fffcf9f6f3f0edeae7e4e1dedbd8d5d2cfccc9c6c3c0bdbab7b4b1aeaba8a5a29f9c999693908d8a8784817e7b7875726f6c696663605d5a5754514e4b484542';

const { key, chainCode } = getMasterKeyFromSeed(hexSeed);
console.log(key.toString('hex'))
// EXPECTED => 2b4be7f19ee27bbf30c667b642d5f4aa69fd169872f8fc3059c08ebae2eb19e7
// WHAT I GOT => 171cb88b1b3c1db25add599712e36245d75bc65a1a5c9e18d76f9f2b1eab4012
alepop commented 3 years ago

Hello @alexiskattan! It may be possible that I was past a wrong values into readme for some mistake. But you could be sure that everything is works fine, because tests is green and I use original test data from SLIP-0010 for them.

alexiskattan commented 3 years ago

Cool cool. Thank you.

alexiskattan commented 3 years ago

One other quick question. Is there a place where we can find the hexSeed constants for all the different chains? Specifically been trying to find Solana but have not had much luck.

alexiskattan commented 3 years ago

I have a bit of a question. I'm confused about something. When using this library, are there any constants that are chain dependent? The hexSeed is derived from crypto stuff which I think is independent of the chain? Then we do const { key, chainCode } = getMasterKeyFromSeed(hexSeed); which gives the chain code which sounds like it is dependent on the chain. So my question is, where did the chain dependency come in?