I have a private key from bitcoind, and I want to convert it to ECPair.
Is there some simple tool for this, either in this library or elsewhere on npm? I cannot find anything usable.
I am not 100% sure what exactly is coming from bitcoind (when using dumpprivkey), but it seems like base58. But I try to use bs58 and base58check to decode, and it doesn't work really
oh nevermind, it's already WIF, I just put in wrong network. Closing.
dumprivkey provides your key in WIF format which happens to be base58 check encoded.
See this as an example:
Yes. I put in wrong network (main instead of testnet) and it confused me. :)
ECPair.fromWIF, with the right network provided :smiley:
What is the command in node using bitcoin js to dumprivkey? I have the private key and need to generate the wif, to be use to generate ECPair.
dumpprivkey is a bitcoind CLI/RPC command. It has nothing to do with NodeJS.
Most helpful comment
Yes. I put in wrong network (main instead of testnet) and it confused me. :)