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?

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.

  • 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 Mar 23 at 3:54
  • when I removed the -a flag, error changed to "bad magic number" – Prayag k Mar 23 at 5:22

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.