Author

Topic: [HOW-TO] Export seed and private keys from your Bitcoin Wallet for Android (Read 11517 times)

newbie
Activity: 21
Merit: 1
I've some BTC stuck on this wallet, it's earlier version that is being discussed though - version 2.46.

There is no option to backup the wallet, but there is an option to backup the keys.

I have done that, exported the file and have it on the computer. None of the described methods are working though, they are all falling down at the decryption of the wallet stage (presumably because I do not have a back-up of the wallet but a backup of the keys only).

My file is formatted bitcoin-wallet-keys-YYYY-MM-DD. When opened in a notepad file is just 5 lines of mumbo jumbo. Electrum does not recognise it as anything, so I presume it's encrypted.

Any ideas?!
hero member
Activity: 1120
Merit: 540
Duelbits - Play for Free | Win for Real
This literally makes no sence to me... is there a non-nerdie version
Here, it will help you more easily see: https://www.youtube.com/watch?v=NGgY0MFtLFU&t=5s
newbie
Activity: 12
Merit: 0
This literally makes no sence to me... is there a non-nerdie version
newbie
Activity: 1
Merit: 0
First off, big thank you to mnemonicmind for writing up those instructions.

Rather than using a full-blown VM, I decided to try using a Docker container as a more lightweight way to install and compile all the necessary bits and pieces. After some tinkering I finally got it working and was able to extract my keys.

I figure my solution might be of use to others, so I wrapped up with some handy shell scripts and shared it all here: https://github.com/c1rrus/bitcoin-wallet-decode

If you've ended up in this thread wanting to extract your keys from a Bitcoin Wallet for Android backup, then my solution might save you a bit of time :-)
newbie
Activity: 20
Merit: 14
你好 我在第5步的时候会报错 ./wallet-tool:line 23: mvn command not found 这是哪里出错了, 谢谢帮忙指点下

I think you forgot step 2:
我想你忘了第二步:(Google Translate)

Code:
sudo apt-get install openssl maven default-jre default-jdk openjfx

If it still does not work, please check if Maven was successfully installed:
如果仍然不起作用,请检查Maven是否安装成功:(Google Translate)

Code:
mvn -version
newbie
Activity: 4
Merit: 0
你好 我在第5步的时候会报错 ./wallet-tool:line 23: mvn command not found 这是哪里出错了, 谢谢帮忙指点下
newbie
Activity: 14
Merit: 0
I'm just curious: but why exactly do I have to transfer my BTC to another wallet?

I understand that this is a standard phrase for safety reasons in the FOSS world.

But shouldn't BTC and BCC co-exist nicely? So will this procedure do my BTC any harm or the sky will fall on my head or something?

I just want to be sure that the BTC wallet will be okay like in a "nothing did touch me" way and the other wallet will just use this extracted private key to get the BCC...

It's not just about whether you trust your BTC funds to the developers of the BCC wallet in which you will import your BTC private keys, but also about the risk of someone finding a vulnerability in the BCC wallet. They could potentially have access to your BTC funds as well. So you have to decide for yourself whether saving the BTC transaction fee is worth the potential risks.

That's a point here. I don't think I'm completely paranoid but I always thought there's something smelly with the BCC private key import.

Decide, won't do. Thanks for your information!  Cool
newbie
Activity: 20
Merit: 14
I'm just curious: but why exactly do I have to transfer my BTC to another wallet?

I understand that this is a standard phrase for safety reasons in the FOSS world.

But shouldn't BTC and BCC co-exist nicely? So will this procedure do my BTC any harm or the sky will fall on my head or something?

I just want to be sure that the BTC wallet will be okay like in a "nothing did touch me" way and the other wallet will just use this extracted private key to get the BCC...

It's not just about whether you trust your BTC funds to the developers of the BCC wallet in which you will import your BTC private keys, but also about the risk of someone finding a vulnerability in the BCC wallet. They could potentially have access to your BTC funds as well. So you have to decide for yourself whether saving the BTC transaction fee is worth the potential risks.
newbie
Activity: 14
Merit: 0
I'm just curious: but why exactly do I have to transfer my BTC to another wallet?

I understand that this is a standard phrase for safety reasons in the FOSS world.

But shouldn't BTC and BCC co-exist nicely? So will this procedure do my BTC any harm or the sky will fall on my head or something?

I just want to be sure that the BTC wallet will be okay like in a "nothing did touch me" way and the other wallet will just use this extracted private key to get the BCC...
newbie
Activity: 20
Merit: 14
can this codes help me if i linked my android phone with vm

Do you mean if you can do this on Android OS?
member
Activity: 112
Merit: 10
BitcoinTalk Manager
can this codes help me if i linked my android phone with vm
newbie
Activity: 20
Merit: 14
I Have Remix version on my VM   is this codes will work or only ubunu

Probably, but you might need to fix some errors. Why not use Debian or Ubuntu? Takes only a couple of minutes to install. Remix OS is a dead project.
newbie
Activity: 43
Merit: 0
I Have Remix version on my VM   is this codes will work or only ubunu
newbie
Activity: 20
Merit: 14
Hi mnemonicmind


I am trying to get my keys but getting an error is step 3
Using Ubuntu (latest) from Live USB drive, installed the packages and when I try to decrypt the wallet, I get an error after typing the password

"error reading input file
xxxxxxxxxxx:error:0200B015:system library:fread:Is a directory:bss_file.c:251:
xxxxxxxxxxx:error:20082002:BIO routines:FILE_READ:system lib:bss_file.c:252:"

Not a linux guy but I think I followed the instructions correctly Smiley

Any help would be appreciated. Trying to get a bit of BCC from Android wallet.
Still don't understand why the developer can't just show us our keys in the app. Yeah I know security etc but alas, most other wallet apps do that.


TYIA
ZX


Could you post the command you used? Did you change "/PATH/TO/YOUR/BACKUP-FILE" to the location of the backup file? The path should include the file name of the backup (bitcoin-wallet-backup-2017-XX-XX).
newbie
Activity: 14
Merit: 0
Hi mnemonicmind


I am trying to get my keys but getting an error is step 3
Using Ubuntu (latest) from Live USB drive, installed the packages and when I try to decrypt the wallet, I get an error after typing the password

"error reading input file
xxxxxxxxxxx:error:0200B015:system library:fread:Is a directory:bss_file.c:251:
xxxxxxxxxxx:error:20082002:BIO routines:FILE_READ:system lib:bss_file.c:252:"

Not a linux guy but I think I followed the instructions correctly Smiley

Any help would be appreciated. Trying to get a bit of BCC from Android wallet.
Still don't understand why the developer can't just show us our keys in the app. Yeah I know security etc but alas, most other wallet apps do that.


TYIA
ZX
newbie
Activity: 20
Merit: 14
thanks for you replies and offers, i got bitcore going fine but i think it the environment im asking bitabc to work in that might be proving a little hard for it...
Originally I put an 64bit amd 3.2 X2 with a pair of 4g ddr3 dual-channel sticks. It had boot prob's. The local curbside throw out was on so i went out and collected some the fewer and fewer boxs that are thrown out these days. Along the way I picked up my sons old sli-rigged AMD2.
I get home an three hours later I've rigged a work bench and test lab for the five box's I've got disassembled and spread around the living room.
3 hours later I've got an AMD3.2 rig running 6 gig of mis-matched ram at 667, but still its way faster than my old trojan lappy I usually do things on.
I load deb9 to it and none of my usb wifi's work. I spend a few hours stuffing with that, ie, nonfree, firmware etc.. Still can't get it up, I reload it with deb8, kernel it up to 9, sid it over and the usb wifi works. Great, the next day i plan to copy the block files over to it and load abc.
The next morning it refuses to start despite it hot and cold booting all the day before. I pull it down again, get it going, post to linuxquestions how much I hate uefi boot & fs4 and proceed to load abc.
My eldest son rings, his lost his car-keys in the sand at the beach 200K's away and he is on a tinder date, can I please rescue him. My youngest is in canada atm so I jump in his after-marketed 2H turboed highly-tuned 60series and line-drag the 4.6L Rangys up and down the highway to get his carkeys to him. That old but powerful 60's really has some grunt on the highway.
I get home and that darn machine wont boot again.... argghhh
I ditch the machine, look at ol-trojy, strip it's hdd and plug in a usb drive and load the same as above 'cause I've still got the same usb wifi.
Finally i get a machine and os going, albeit on a shared usb channel splitting the usb drive and usb wifi.
But still, ol-trojy handles it with only a minor performance hit.
Installing abc i did late at night, i was tired and my install folder was just plain wrong. I installed all the dependencies listed on the page just to be sure, copied the block files from one drive to another and fired it up.
Seemed to go ok, doing the same things as bitcore.
10 hours into it I remember to check the peer addys. I add a abc peer and i can now see other abc peers.
2 hours after that it gets to 99.79% and stays there for 10 hours. I restart it, it gets to 99.58 and stays there for hours. I restart it again and it does the same with even less percentage.
I remember reading it will sorta do this but is in fact working and I could confirm that by seeing network traffic in the help panel. So i leave it for another 30 hours, still nada and post here i failed.
I may be a bit pre-emptive but it been pretty busy here. The lady downstairs partner died in custody the other night and she is breaking down sobbing. My youngest brother was killed in custody so I really feel for her an am trying to help. The little old lady from the other side of the block has been terrified by the landlord telling her she has too much stuff, so i've been helping there. The $280 battery collasped in my Diesel Auto Delica the other night, so i've been trying to sort that too annnnd Im not going to mention Im behind two days design on two websites too...

So yerrr, it's the enviorment. An ol lappy, drives an' crap hangin' outa' it, interruptions, messy os and install's.... but i have enjoyed the challenge, it truely has been a good distraction from the crap around me.
Plan is now to get a second internal drive for the lappy, a hybrid, i really like the idea of them. Also some hdd sata adapters and i mite give it another load along with using the one-boot-wonder to do the file copy over...

sometimes you wish you just didn't ask don't ya'....lol...

I'm not exactly sure what you're trying to do, but this topic is about exporting your private keys from a Bitcoin Wallet for Android.
newbie
Activity: 20
Merit: 14
HCP made this guide as well which might work better for you.

Although, if you're still stuck, I can try to get them out for you (but that'd require you to trust me with your private keys, you might want to move your bitcoins out first at least).

I'm don't want to question your credibility or good intentions, but one should NEVER EVER give private keys to a stranger.

Yes, generally that I a good rule to follow.
However, if you're completely stuck and have no other option and there could be something from it you really want to get then... Use anyone you want, I'm sure there'll be a fairly trustworthy escrow service provider that might be able to help you get the BCC out if you ask them.

The BCC won't run away Wink

I'm glad to help here on the forum if anyone runs into an error.
member
Activity: 61
Merit: 10
AWorldWideWebOfReasons AWorldWideWebOfResults
thanks for you replies and offers, i got bitcore going fine but i think it the environment im asking bitabc to work in that might be proving a little hard for it...
Originally I put an 64bit amd 3.2 X2 with a pair of 4g ddr3 dual-channel sticks. It had boot prob's. The local curbside throw out was on so i went out and collected some the fewer and fewer boxs that are thrown out these days. Along the way I picked up my sons old sli-rigged AMD2.
I get home an three hours later I've rigged a work bench and test lab for the five box's I've got disassembled and spread around the living room.
3 hours later I've got an AMD3.2 rig running 6 gig of mis-matched ram at 667, but still its way faster than my old trojan lappy I usually do things on.
I load deb9 to it and none of my usb wifi's work. I spend a few hours stuffing with that, ie, nonfree, firmware etc.. Still can't get it up, I reload it with deb8, kernel it up to 9, sid it over and the usb wifi works. Great, the next day i plan to copy the block files over to it and load abc.
The next morning it refuses to start despite it hot and cold booting all the day before. I pull it down again, get it going, post to linuxquestions how much I hate uefi boot & fs4 and proceed to load abc.
My eldest son rings, his lost his car-keys in the sand at the beach 200K's away and he is on a tinder date, can I please rescue him. My youngest is in canada atm so I jump in his after-marketed 2H turboed highly-tuned 60series and line-drag the 4.6L Rangys up and down the highway to get his carkeys to him. That old but powerful 60's really has some grunt on the highway.
I get home and that darn machine wont boot again.... argghhh
I ditch the machine, look at ol-trojy, strip it's hdd and plug in a usb drive and load the same as above 'cause I've still got the same usb wifi.
Finally i get a machine and os going, albeit on a shared usb channel splitting the usb drive and usb wifi.
But still, ol-trojy handles it with only a minor performance hit.
Installing abc i did late at night, i was tired and my install folder was just plain wrong. I installed all the dependencies listed on the page just to be sure, copied the block files from one drive to another and fired it up.
Seemed to go ok, doing the same things as bitcore.
10 hours into it I remember to check the peer addys. I add a abc peer and i can now see other abc peers.
2 hours after that it gets to 99.79% and stays there for 10 hours. I restart it, it gets to 99.58 and stays there for hours. I restart it again and it does the same with even less percentage.
I remember reading it will sorta do this but is in fact working and I could confirm that by seeing network traffic in the help panel. So i leave it for another 30 hours, still nada and post here i failed.
I may be a bit pre-emptive but it been pretty busy here. The lady downstairs partner died in custody the other night and she is breaking down sobbing. My youngest brother was killed in custody so I really feel for her an am trying to help. The little old lady from the other side of the block has been terrified by the landlord telling her she has too much stuff, so i've been helping there. The $280 battery collasped in my Diesel Auto Delica the other night, so i've been trying to sort that too annnnd Im not going to mention Im behind two days design on two websites too...

So yerrr, it's the enviorment. An ol lappy, drives an' crap hangin' outa' it, interruptions, messy os and install's.... but i have enjoyed the challenge, it truely has been a good distraction from the crap around me.
Plan is now to get a second internal drive for the lappy, a hybrid, i really like the idea of them. Also some hdd sata adapters and i mite give it another load along with using the one-boot-wonder to do the file copy over...

sometimes you wish you just didn't ask don't ya'....lol...





copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
HCP made this guide as well which might work better for you.

Although, if you're still stuck, I can try to get them out for you (but that'd require you to trust me with your private keys, you might want to move your bitcoins out first at least).

I'm don't want to question your credibility or good intentions, but one should NEVER EVER give private keys to a stranger.

Yes, generally that I a good rule to follow.
However, if you're completely stuck and have no other option and there could be something from it you really want to get then... Use anyone you want, I'm sure there'll be a fairly trustworthy escrow service provider that might be able to help you get the BCC out if you ask them.
newbie
Activity: 20
Merit: 14
HCP made this guide as well which might work better for you.

Although, if you're still stuck, I can try to get them out for you (but that'd require you to trust me with your private keys, you might want to move your bitcoins out first at least).

I don't want to question your credibility or good intentions, but one should NEVER EVER give private keys to a stranger.
newbie
Activity: 20
Merit: 14
well then, i've just thought to add my progress too.. yerr-nahh it hasn't worked for me, or more so i havn't worked for it...it's running and all, but seems to be going backwards, each time i open it i gota wait more days... i think i muffed the files transfere and it's going back and replacing blocks, i can see a mix of seeds in there and there is no date on the block files when the program is closed...it'll be my fault.... it was a long process installing deb8 for my usbwifi then upgrading to deb9 then a sid kernel...then it did what the instruction said it wouldnt do, ie got the 4.8 berkley in...then i worked out i prolly didnt install it in the right place, nonetheless i take the blame, mite try electron now, seems much easier just a client an all'...

The whole process should take maybe 10 minutes. What kind of errors do you get? Or where do you get stuck?
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Finally sorted it! Thanks. Yes, I did follow step 3, but I had to modify it to get rid of an SSL error: openssl enc -d -aes-256-cbc -md md5 -a -in bitcoin-wallet-backup -out decrypted_wallet

Also I had to insert an additional step before step 5 to decrypt the PIN-protection I had set for sending bitcoins on the phone. If you have set a sending PIN on your phone and you don't do this step you won't get your private keys at step 5, only the public keys and initialisation vectors etc. You need to run: ./wallet-tool --decrypt --password= --wallet=decrypted_wallet.

I found the instructions for wallet-tool very helpful also: https://github.com/bitcoinj/bitcoinj/blob/master/tools/src/main/resources/org/bitcoinj/tools/wallet-tool-help.txt

The whole process is a bit long-winded, but it does work and I have finally recovered my Bitcoin Cash from my phone after the split - Whoopee!

Thanks for all your help.

--------------------------------------------
BTC: 1MqYtrevyngvpyyKXZr8CgoNZXvJdtjkS7
BCC: 18crH68qTFr2yxz9mdRKvkf6gJANViSYda

Good to hear and thanks for adding this information!

well then, i've just thought to add my progress too.. yerr-nahh it hasn't worked for me, or more so i havn't worked for it...it's running and all, but seems to be going backwards, each time i open it i gota wait more days... i think i muffed the files transfere and it's going back and replacing blocks, i can see a mix of seeds in there and there is no date on the block files when the program is closed...it'll be my fault.... it was a long process installing deb8 for my usbwifi then upgrading to deb9 then a sid kernel...then it did what the instruction said it wouldnt do, ie got the 4.8 berkley in...then i worked out i prolly didnt install it in the right place, nonetheless i take the blame, mite try electron now, seems much easier just a client an all'...

HCP made this guide as well which might work better for you.

Although, if you're still stuck, I can try to get them out for you (but that'd require you to trust me with your private keys, you might want to move your bitcoins out first at least).
member
Activity: 61
Merit: 10
AWorldWideWebOfReasons AWorldWideWebOfResults
Finally sorted it! Thanks. Yes, I did follow step 3, but I had to modify it to get rid of an SSL error: openssl enc -d -aes-256-cbc -md md5 -a -in bitcoin-wallet-backup -out decrypted_wallet

Also I had to insert an additional step before step 5 to decrypt the PIN-protection I had set for sending bitcoins on the phone. If you have set a sending PIN on your phone and you don't do this step you won't get your private keys at step 5, only the public keys and initialisation vectors etc. You need to run: ./wallet-tool --decrypt --password= --wallet=decrypted_wallet.

I found the instructions for wallet-tool very helpful also: https://github.com/bitcoinj/bitcoinj/blob/master/tools/src/main/resources/org/bitcoinj/tools/wallet-tool-help.txt

The whole process is a bit long-winded, but it does work and I have finally recovered my Bitcoin Cash from my phone after the split - Whoopee!

Thanks for all your help.

--------------------------------------------
BTC: 1MqYtrevyngvpyyKXZr8CgoNZXvJdtjkS7
BCC: 18crH68qTFr2yxz9mdRKvkf6gJANViSYda

Good to hear and thanks for adding this information!

well then, i've just thought to add my progress too.. yerr-nahh it hasn't worked for me, or more so i havn't worked for it...it's running and all, but seems to be going backwards, each time i open it i gota wait more days... i think i muffed the files transfere and it's going back and replacing blocks, i can see a mix of seeds in there and there is no date on the block files when the program is closed...it'll be my fault.... it was a long process installing deb8 for my usbwifi then upgrading to deb9 then a sid kernel...then it did what the instruction said it wouldnt do, ie got the 4.8 berkley in...then i worked out i prolly didnt install it in the right place, nonetheless i take the blame, mite try electron now, seems much easier just a client an all'...
newbie
Activity: 20
Merit: 14
If anyone is interested in the instructions to install a Linux virtual machine on Windows using VMware, let me know!
newbie
Activity: 20
Merit: 14
Finally sorted it! Thanks. Yes, I did follow step 3, but I had to modify it to get rid of an SSL error: openssl enc -d -aes-256-cbc -md md5 -a -in bitcoin-wallet-backup -out decrypted_wallet

Also I had to insert an additional step before step 5 to decrypt the PIN-protection I had set for sending bitcoins on the phone. If you have set a sending PIN on your phone and you don't do this step you won't get your private keys at step 5, only the public keys and initialisation vectors etc. You need to run: ./wallet-tool --decrypt --password= --wallet=decrypted_wallet.

I found the instructions for wallet-tool very helpful also: https://github.com/bitcoinj/bitcoinj/blob/master/tools/src/main/resources/org/bitcoinj/tools/wallet-tool-help.txt

The whole process is a bit long-winded, but it does work and I have finally recovered my Bitcoin Cash from my phone after the split - Whoopee!

Thanks for all your help.

--------------------------------------------
BTC: 1MqYtrevyngvpyyKXZr8CgoNZXvJdtjkS7
BCC: 18crH68qTFr2yxz9mdRKvkf6gJANViSYda

Good to hear and thanks for adding this information!
newbie
Activity: 20
Merit: 14
Is it possible to do this all on android device?

The Bitcoin Wallet for Android app uses Bitcoinj, so it is possible to do this on an Android device. However, it would take a lot of time. You will need root and terminal access (or code an app). If you don't use Linux, it will be much easier to just use VMware.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
I noticed a lot of people are asking how to export or extract the seed and private keys from their Bitcoin Wallet for Android. You probably need them to use your BTC in another wallet, or to use your BCC coins. This how-to will show you how to retrieve your seed and private keys from the Bitcoin Wallet for Android. If you are on Windows, I recommend using VMware Workstation Player with Debian or Ubuntu.

1. Make a backup of your wallet in Bitcoin Wallet for Android:
Code:
## Menu > Safety > Back up wallet
## Enter a password and transfer the backup file to your pc

2. Install OpenSSL, Maven and Java
Code:
sudo apt-get install openssl maven default-jre default-jdk openjfx

3. Decrypt your wallet
Don't forget to change the path to your backup file!
Code:
mkdir ~/AndroidWallet
cd ~/AndroidWallet
openssl enc -d -aes-256-cbc -a -in /PATH/TO/YOUR/BACKUP-FILE -out decrypted-wallet
## Enter the password of your backup

4. Install Bitcoinj
Code:
wget https://github.com/bitcoinj/bitcoinj/archive/master.zip
unzip master.zip
cd bitcoinj-master
sudo mvn clean install -DskipTests

5. Convert the protobuf wallet with the Bitcoinj wallet tool
Code:
cd tools
./wallet-tool dump --dump-privkeys --wallet=decrypted-wallet > wallet.txt

6. Extract the seed and private keys
The seed will be stored in seed.txt and the private keys in private-keys.txt
Code:
grep "Seed as" wallet.txt > seed.txt
grep -o -E "WIF=([a-zA-Z0-9]+)" wallet.txt > private-keys.txt
sed -i 's/WIF=//g' private-keys.txt

7. You now have the seed and a list of your private keys!
You can import/sweep the seed or private keys in another BTC or BCC wallet. In case you will use the seed/private keys for a BCC wallet, I recommend to transfer your BTC to a new wallet first!

Send me a beer if this how-to was helpful to you, or if you just want to test your new BCC wallet:
Code:
BTC: 1JpNrUkbsw1sZVynSLeNMS6qQDcrmjxh3e
BCC: 124KDK76iS51ccJ7dYYtGzDg8kEmhAL4aC

Is it possible to do this all on android device?

I think you might be able to dual boot it with an OS likeUbuntu in order to do it on android but it'd be fairly difficult to do.

It'd be good for the security of your coins if you coluld do it entirely on the android device, but it'd probably need enough ram to be able to launch ubuntu, or maybe there's a fairly minimalistic linux OS that would be able to run it.

If you merely root your device, it'd be almost impossible (there's no sudo command from what I recall).
newbie
Activity: 53
Merit: 0
I noticed a lot of people are asking how to export or extract the seed and private keys from their Bitcoin Wallet for Android. You probably need them to use your BTC in another wallet, or to use your BCC coins. This how-to will show you how to retrieve your seed and private keys from the Bitcoin Wallet for Android. If you are on Windows, I recommend using VMware Workstation Player with Debian or Ubuntu.

1. Make a backup of your wallet in Bitcoin Wallet for Android:
Code:
## Menu > Safety > Back up wallet
## Enter a password and transfer the backup file to your pc

2. Install OpenSSL, Maven and Java
Code:
sudo apt-get install openssl maven default-jre default-jdk openjfx

3. Decrypt your wallet
Don't forget to change the path to your backup file!
Code:
mkdir ~/AndroidWallet
cd ~/AndroidWallet
openssl enc -d -aes-256-cbc -a -in /PATH/TO/YOUR/BACKUP-FILE -out decrypted-wallet
## Enter the password of your backup

4. Install Bitcoinj
Code:
wget https://github.com/bitcoinj/bitcoinj/archive/master.zip
unzip master.zip
cd bitcoinj-master
sudo mvn clean install -DskipTests

5. Convert the protobuf wallet with the Bitcoinj wallet tool
Code:
cd tools
./wallet-tool dump --dump-privkeys --wallet=decrypted-wallet > wallet.txt

6. Extract the seed and private keys
The seed will be stored in seed.txt and the private keys in private-keys.txt
Code:
grep "Seed as" wallet.txt > seed.txt
grep -o -E "WIF=([a-zA-Z0-9]+)" wallet.txt > private-keys.txt
sed -i 's/WIF=//g' private-keys.txt

7. You now have the seed and a list of your private keys!
You can import/sweep the seed or private keys in another BTC or BCC wallet. In case you will use the seed/private keys for a BCC wallet, I recommend to transfer your BTC to a new wallet first!

Send me a beer if this how-to was helpful to you, or if you just want to test your new BCC wallet:
Code:
BTC: 1JpNrUkbsw1sZVynSLeNMS6qQDcrmjxh3e
BCC: 124KDK76iS51ccJ7dYYtGzDg8kEmhAL4aC

Is it possible to do this all on android device?
newbie
Activity: 3
Merit: 0

I was using an older version of Debian. Now I have V9.1.0 and it is working.... However, now I can get a readable "wallet.txt" at step 5, but in plaintext it says "Seed is encrypted" and although it shows Xpub (for a watching only wallet) all of the private keys are shown as:-

"encryptedPrivateKey=EncryptedData [initialisationVector=[104, -105, -15, 72, -51,.... etc".

Presumably there needs to be additional calculations done to extract the actual private keys?

Did you follow step 3 to decrypt the wallet? You will be asked for the password of the backup.

Finally sorted it! Thanks. Yes, I did follow step 3, but I had to modify it to get rid of an SSL error: openssl enc -d -aes-256-cbc -md md5 -a -in bitcoin-wallet-backup -out decrypted_wallet

Also I had to insert an additional step before step 5 to decrypt the PIN-protection I had set for sending bitcoins on the phone. If you have set a sending PIN on your phone and you don't do this step you won't get your private keys at step 5, only the public keys and initialisation vectors etc. You need to run: ./wallet-tool --decrypt --password= --wallet=decrypted_wallet.

I found the instructions for wallet-tool very helpful also: https://github.com/bitcoinj/bitcoinj/blob/master/tools/src/main/resources/org/bitcoinj/tools/wallet-tool-help.txt

The whole process is a bit long-winded, but it does work and I have finally recovered my Bitcoin Cash from my phone after the split - Whoopee!

Thanks for all your help.

--------------------------------------------
BTC: 1MqYtrevyngvpyyKXZr8CgoNZXvJdtjkS7
BCC: 18crH68qTFr2yxz9mdRKvkf6gJANViSYda
newbie
Activity: 20
Merit: 14

I was using an older version of Debian. Now I have V9.1.0 and it is working.... However, now I can get a readable "wallet.txt" at step 5, but in plaintext it says "Seed is encrypted" and although it shows Xpub (for a watching only wallet) all of the private keys are shown as:-

"encryptedPrivateKey=EncryptedData [initialisationVector=[104, -105, -15, 72, -51,.... etc".

Presumably there needs to be additional calculations done to extract the actual private keys?

Did you follow step 3 to decrypt the wallet? You will be asked for the password of the backup.
copper member
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
Can you do any of this on Windows? isn't there a simpler way to do it?

Thanks!

Try this guide instead for Windows: https://bitcointalksearch.org/topic/m.20002671

I used this for windows 7 and it worked quite well.
newbie
Activity: 3
Merit: 0
Do you use an older version of Debian?

+1?

I was using an older version of Debian. Now I have V9.1.0 and it is working.... However, now I can get a readable "wallet.txt" at step 5, but in plaintext it says "Seed is encrypted" and although it shows Xpub (for a watching only wallet) all of the private keys are shown as:-

"encryptedPrivateKey=EncryptedData [initialisationVector=[104, -105, -15, 72, -51,.... etc".

Presumably there needs to be additional calculations done to extract the actual private keys?
member
Activity: 61
Merit: 10
AWorldWideWebOfReasons AWorldWideWebOfResults
newbie
Activity: 20
Merit: 14
Great, I got to decode using the method of extracting the seed from the wallet, thanks to this topic that helped me a lot too: https://bitcointalksearch.org/topic/has-anyone-here-been-able-to-decode-the-backup-of-bitcoin-wallet-schildbatch-1997031
That might work as well. However this method uses Bitcoinj which is also used by Bitcoin Wallet for Android.

Extracting privates from different client will always depend on its client itself. They have their own step on how to export private keys depending their formats, if not private keys its the recovery seed rather, and there's a tool for converting from recovery seed to private keys just simply as that.
I have edited the post so that you can also extract the seed.

Can you do any of this on Windows? isn't there a simpler way to do it?

Thanks!
I don't use Windows. However you can download VMware Workstation Player for free and install Debian as a virtual machine. It's very easy and will only take about 10 minutes.

Bit of a Newbie - at step 2 I get "unable to locate package openjfx". I am running Debian on Oracle Virtualbox. Any ideas please? Thanks.
Do you use an older version of Debian?
newbie
Activity: 3
Merit: 0
Bit of a Newbie - at step 2 I get "unable to locate package openjfx". I am running Debian on Oracle Virtualbox. Any ideas please? Thanks.
full member
Activity: 228
Merit: 106
Can you do any of this on Windows? isn't there a simpler way to do it?

Thanks!
copper member
Activity: 2142
Merit: 1305
Limited in number. Limitless in potential.
Extracting privates from different client will always depend on its client itself. They have their own step on how to export private keys depending their formats, if not private keys its the recovery seed rather, and there's a tool for converting from recovery seed to private keys just simply as that.
hero member
Activity: 1120
Merit: 540
Duelbits - Play for Free | Win for Real
 Great, I got to decode using the method of extracting the seed from the wallet, thanks to this topic that helped me a lot too: https://bitcointalksearch.org/topic/has-anyone-here-been-able-to-decode-the-backup-of-bitcoin-wallet-schildbatch-1997031
newbie
Activity: 20
Merit: 14
I noticed a lot of people are asking how to export or extract the seed and private keys from their Bitcoin Wallet for Android. You probably need them to use your BTC in another wallet, or to use your BCC coins. This how-to will show you how to retrieve your seed and private keys from the Bitcoin Wallet for Android. If you are on Windows, I recommend using VMware Workstation Player with Debian or Ubuntu.

1. Make a backup of your wallet in Bitcoin Wallet for Android:
Code:
## Menu > Safety > Back up wallet
## Enter a password and transfer the backup file to your pc

2. Install OpenSSL, Maven and Java
Code:
sudo apt-get install openssl maven default-jre default-jdk openjfx

3. Decrypt your wallet
Don't forget to change the path to your backup file!
Code:
mkdir ~/AndroidWallet
cd ~/AndroidWallet
openssl enc -d -aes-256-cbc -a -in /PATH/TO/YOUR/BACKUP-FILE -out decrypted-wallet
## Enter the password of your backup

4. Install Bitcoinj
Code:
wget https://github.com/bitcoinj/bitcoinj/archive/master.zip
unzip master.zip
cd bitcoinj-master
sudo mvn clean install -DskipTests

5. Convert the protobuf wallet with the Bitcoinj wallet tool
Code:
cd tools
./wallet-tool dump --dump-privkeys --wallet=decrypted-wallet > wallet.txt

6. Extract the seed and private keys
The seed will be stored in seed.txt and the private keys in private-keys.txt
Code:
grep "Seed as" wallet.txt > seed.txt
grep -o -E "WIF=([a-zA-Z0-9]+)" wallet.txt > private-keys.txt
sed -i 's/WIF=//g' private-keys.txt

7. You now have the seed and a list of your private keys!
You can import/sweep the seed or private keys in another BTC or BCC wallet. In case you will use the seed/private keys for a BCC wallet, I recommend to transfer your BTC to a new wallet first!

Send me a beer if this how-to was helpful to you, or if you just want to test your new BCC wallet:
Code:
Bitcoin Cash:
124KDK76iS51ccJ7dYYtGzDg8kEmhAL4aC

Bitcoin:
1JpNrUkbsw1sZVynSLeNMS6qQDcrmjxh3e

Ethereum:
0x18204402a9203F8ABe0CaD97C656049be1577a29

----

This how-to was written exclusively for Bitcointalk. I do not allow publication of this article on any other website. However, feel free to link to this topic if you find it helpful.
Jump to: