bitcoinjs / ecpair

The ECPair module for bitcoinjs-lib
MIT License
15 stars 22 forks source link

keyPair.chainCode does not exists #18

Closed 0xcielo closed 8 months ago

0xcielo commented 8 months ago

const keyPair = ECPair.fromWIF(privateKey, network); bip32.fromPrivateKey(keyPair.privateKey, keyPair.chainCode, network);

I need keyPair.chainCode, and does not exists, how to retrieve?

junderw commented 8 months ago

Chain code is a concept that solely exists in BIP32.

ECPairs are just simple ECDSA key pairs.

There is no way to get a chain code from an ECPair.

Please read BIP32 for further information on what the chain code is and how it is generated.

The text of BIP32 is here.