BTC account using bip84 private key
-
I'm submitting a ... [ ] bug report [ ] feature request [ ] question about the decisions made in the repository [x] question about how to use this project
-
Summary
How do I use a bip84 private key generated from a seed phrase generated here. I get invalid private key buffer error.
- Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)
First of all this library operates on BIP 44 so while interacting with it you might not get accurate results.. So i will advise you to use BIP44 if you want to use this library..
About the invalid private key buffer i believe you're pasting a WIF or hex key and it's expecting a Buffer one way to solve this is to use ECPair to convert the key to Keypar then pass the private key here a sample
// If private key is a WIF
const keyPair = ECPair.fromWIF('L1jbWJZUKyuVDyjqYiU4e4BxWj5mxrzXkYC4pyvX2MVAAaTu88Sx');
const account = new CryptoAccount(keyPair.privateKey);
// If private key is hex
// Remove the first 0x on the hex
const keyPair = ECPair.fromPrivateKey(
Buffer.from(
'394cf5961b2a0136d7b69b676c45bcc9dcc929b66f8380b7253ef60284cde13cf',
'hex'
)
);
const account = new CryptoAccount(keyPair.privateKey);