Import private key to bitcoind

0

I have a bitcoin testnet account in copay wallet. I want to import its private key in bitcoind. So, I exported the private key, but they were encrypted. I got a

Test-Copaybackup.aes.json

file. Therefore, I can't use importwallet rpc in bitcoin-cli, since it requires an unlocked wallet or an unencrypted wallet. What else I do?

Prayag k

Posted 2018-03-22T09:16:25.437

Reputation: 134

Answers

0

The encrypted JSON file likely contains individual private keys, or seed bytes. The first step would be to actually decrypt it, which can be done via openssl:

openssl aes-256-cbc -d -a -in Test-Copaybackup.aes.json -out wallet.txt

Once you have that, looking at the decrypted file should tell you what kind of data you're working with. If you see regular private keys, just import them normally. If you see a mnemonic seed or something similar, you'll need to convert it to keys.

Raghav Sood

Posted 2018-03-22T09:16:25.437

Reputation: 10 897

I've run this command and entered the decryption password. But it shows "error reading input file". Is aes version is different? I couldn't find the aes version used by copay from anywhere.Prayag k 2018-03-23T03:54:22.243

when I removed the -a flag, error changed to "bad magic number"Prayag k 2018-03-23T05:22:02.790