Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: ivikasrana on December 25, 2017, 08:56:59 AM



Title: How to export decrypted private key from Bitcoin wallet app? wil give you tip
Post by: ivikasrana on December 25, 2017, 08:56:59 AM
Hi,

I've some fund in BTC wallet app which is provided on bitcoin.com website
I want the decrypted private key so I can sweep/import my wallet into other wallets like counterparty.io or electrum
How is that possible?

Thanks


Title: Re: How to export decrypted private key from Bitcoin wallet app? wil give you tip
Post by: LoyceV on December 25, 2017, 09:24:34 AM
There's this guide (https://www.bitcoin.com/guides/how-to-import-and-export-bitcoin-private-keys), but it seems to only let you export encrypted private keys, and doesn't show how to actually read them.
Don't you just have the 12 word seed, which you can use (offline!) in https://iancoleman.io/bip39/ to get your private keys?


Title: Re: How to export decrypted private key from Bitcoin wallet app? wil give you tip
Post by: HCP on December 26, 2017, 06:11:22 AM
Ok... so I think I've found a way to do this... but I cannot guarantee the "safety" of doing this...

Firstly, follow the guide here: https://www.bitcoin.com/guides/how-to-import-and-export-bitcoin-private-keys

Create the password and then "copy to clipboard"...

Once you have the encrypted text, you can visit: https://bitwiseshiftleft.github.io/sjcl/demo/

- Paste the encrypted text into the purple "CipherText" box
- Enter your password in the green "Password" section
- Click the purple "decrypt" arrow

It will put the unencrypted wallet info into the red "plaintext" box.

The dummy wallet I decrypted gave me:
Quote
{"coin":"btc","network":"livenet","xPrivKey":"xprv9s21ZrQH143K4ZrP6SLuBgsMkQv635f1mwn5KEXsb4sZf3XnfwkwQE1AeHdzsdXMkx5uzXuDZbm NXsNLhzKFWipKhHPHE2meqi2rk1nD9Ma","xPubKey":"xpub6CVZ6Q75Ro88WSqa5yFQBdPWcXKwB7cLAu3YG17VGxEBDYqXfrTFxYyBoKaHoeHRn7Fw3UKUypn MpWvyZVZY6k7TqdVXQ4eL49N5rJonXRz","requestPrivKey":"27c9b86a89f917ba6cddf1cece90c7c03b2697a25d850f4749797cfa630ab62e","requestPubKey":"035990a78bc75a4b793bffa05b0327d8ffb04f35b1481e037963a9e940fdf3fa04","copayerId":"402a0e3c781ffd3d6b3b95d3b1dbd794850540dbc18c5d046fd331e20ea32759","publicKeyRing":[{"xPubKey":"xpub6CVZ6Q75Ro88WSqa5yFQBdPWcXKwB7cLAu3YG17VGxEBDYqXfrTFxYyBoKaHoeHRn7Fw3UKUypn MpWvyZVZY6k7TqdVXQ4eL49N5rJonXRz","requestPubKey":"035990a78bc75a4b793bffa05b0327d8ffb04f35b1481e037963a9e940fdf3fa04"}],"walletId":"2236fd31-7e11-4754-a394-375884eb6fba","walletName":"Personal Wallet","m":1,"n":1,"walletPrivKey":"a9d617cfb9db3385f7d8ba370b3e313c0bfccc0e92783797a3123b3e6347dc3e","personalEncryptingKey":"PFL1KGb+yvMaj6ZtcMewWA==","sharedEncryptingKey":"JWlH5/sACSzyWwllqPan9A==","copayerName":"me","mnemonic":"push chief foot street refuse robust core success donor detect gasp choice","entropySource":"4f4c34c9cb10c740f161b1a3b27805c6f2617287117adcd5ef9bde85bd4398fd","mnemonicHasPassphrase":false,"derivationStrategy":"BIP44","account":0,"compliantDerivation":true,"addressType":"P2PKH","addressBook":[]}

It seems to have the xPrivKey and the mnemonic... Both of which can be used on https://iancoleman.io/bip39/ with a derivation path of m/44'/0'/0'/0 (ie. click on the BIP44 tab) to generate a list of your addresses/private keys for importing to another wallet.

Or, you can simply restore the seed mnemonic into any BIP44 compatible wallet :)



With regards to "safety"... I usually recommend to run these sites OFFLINE by downloading them and running them locally... but you'd probably need to do that on a PC as opposed to your phone.

The bitwiseshiftleft page for decrypting the wallet can be downloaded here: https://github.com/bitwiseshiftleft/sjcl
(click the green "clone or download" button and select "download zip"... extract the zip and then open the index.html in the "demo" folder)... you might also be able to simply right click on the page and select "save as"

Ian Coleman can be downloaded following the instructions at the bottom of the page