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?

2 Answers 2

1

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.

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

for (!) testnet accounts I use the following to encrypt the copay exported files:

https://bitwiseshiftleft.github.io/sjcl/demo/

add the password in it´s green field and the content of the copay exported file in the blue box and klick decrypt. the decrypted content appears in the red area.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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