Bitcoin Forum
May 09, 2024, 06:14:23 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: [HOW-TO] Export seed and private keys from your Bitcoin Wallet for Android  (Read 11488 times)
mnemonicmind (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 14


View Profile
August 03, 2017, 12:08:43 AM
Last edit: November 11, 2017, 11:38:50 PM by mnemonicmind
Merited by kaicrypzen (7), LoyceV (6), BitMaxz (1)
 #1

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.
1715278463
Hero Member
*
Offline Offline

Posts: 1715278463

View Profile Personal Message (Offline)

Ignore
1715278463
Reply with quote  #2

1715278463
Report to moderator
1715278463
Hero Member
*
Offline Offline

Posts: 1715278463

View Profile Personal Message (Offline)

Ignore
1715278463
Reply with quote  #2

1715278463
Report to moderator
The grue lurks in the darkest places of the earth. Its favorite diet is adventurers, but its insatiable appetite is tempered by its fear of light. No grue has ever been seen by the light of day, and few have survived its fearsome jaws to tell the tale.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715278463
Hero Member
*
Offline Offline

Posts: 1715278463

View Profile Personal Message (Offline)

Ignore
1715278463
Reply with quote  #2

1715278463
Report to moderator
1715278463
Hero Member
*
Offline Offline

Posts: 1715278463

View Profile Personal Message (Offline)

Ignore
1715278463
Reply with quote  #2

1715278463
Report to moderator
1715278463
Hero Member
*
Offline Offline

Posts: 1715278463

View Profile Personal Message (Offline)

Ignore
1715278463
Reply with quote  #2

1715278463
Report to moderator
Forsyth Jones
Hero Member
*****
Offline Offline

Activity: 1162
Merit: 623


Press F for Leo


View Profile WWW
August 04, 2017, 08:36:23 PM
 #2

 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://bitcointalk.org/index.php?topic=1997031.0

▄▄███████████████████▄▄
▄█████████▀█████████████▄
███████████▄▐▀▄██████████
███████▀▀███████▀▀███████
██████▀███▄▄████████████
█████████▐█████████▐█████
█████████▐█████████▐█████
██████████▀███▀███▄██████
████████████████▄▄███████
███████████▄▄▄███████████
█████████████████████████
▀█████▄▄████████████████▀
▀▀███████████████████▀▀
Peach
BTC bitcoin
Buy and Sell
Bitcoin P2P
.
.
▄▄███████▄▄
▄████████
██████▄
▄██
█████████████████▄
▄███████
██████████████▄
███████████████████████
█████████████████████████
████████████████████████
█████████████████████████
▀███████████████████████▀
▀█████████████████████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀

▀▀▀▀███▀▀▀▀
EUROPE | AFRICA
LATIN AMERICA
▄▀▀▀











▀▄▄▄


███████▄█
███████▀
██▄▄▄▄▄░▄▄▄▄▄
████████████▀
▐███████████▌
▐███████████▌
████████████▄
██████████████
███▀███▀▀███▀
.
Download on the
App Store
▀▀▀▄











▄▄▄▀
▄▀▀▀











▀▄▄▄


▄██▄
██████▄
█████████▄
████████████▄
███████████████
████████████▀
█████████▀
██████▀
▀██▀
.
GET IT ON
Google Play
▀▀▀▄











▄▄▄▀
bL4nkcode
Copper Member
Legendary
*
Offline Offline

Activity: 2142
Merit: 1305


Limited in number. Limitless in potential.


View Profile
August 05, 2017, 02:25:58 AM
 #3

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.
PabloW
Full Member
***
Offline Offline

Activity: 228
Merit: 106


View Profile
August 06, 2017, 08:19:04 PM
 #4

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

Thanks!
martindt
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
August 07, 2017, 03:31:24 PM
 #5

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.
mnemonicmind (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 14


View Profile
August 08, 2017, 01:14:37 AM
Last edit: August 08, 2017, 01:25:57 AM by mnemonicmind
 #6

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://bitcointalk.org/index.php?topic=1997031.0
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?
robertbruce
Member
**
Offline Offline

Activity: 61
Merit: 10

AWorldWideWebOfReasons AWorldWideWebOfResults


View Profile
August 09, 2017, 01:23:39 PM
 #7

Do you use an older version of Debian?

+1?

A World Wide Web Of Reasons
A World Wide Web Of Results
martindt
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
August 12, 2017, 06:46:15 PM
 #8

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?
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
August 12, 2017, 08:05:23 PM
 #9

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://bitcointalk.org/index.php?topic=1997031.msg20002671#msg20002671

I used this for windows 7 and it worked quite well.
mnemonicmind (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 14


View Profile
August 17, 2017, 07:37:40 PM
 #10


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.
martindt
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
August 18, 2017, 11:03:04 AM
Last edit: August 18, 2017, 02:49:44 PM by martindt
 #11


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=<sending pin> --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
Deansss
Newbie
*
Offline Offline

Activity: 53
Merit: 0


View Profile
August 19, 2017, 03:01:21 PM
 #12

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?
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
August 19, 2017, 03:44:38 PM
 #13

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).
mnemonicmind (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 14


View Profile
August 20, 2017, 11:24:18 PM
 #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.
mnemonicmind (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 14


View Profile
August 20, 2017, 11:41:38 PM
 #15

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=<sending pin> --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!
mnemonicmind (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 14


View Profile
August 20, 2017, 11:52:32 PM
 #16

If anyone is interested in the instructions to install a Linux virtual machine on Windows using VMware, let me know!
robertbruce
Member
**
Offline Offline

Activity: 61
Merit: 10

AWorldWideWebOfReasons AWorldWideWebOfResults


View Profile
August 21, 2017, 02:01:03 PM
 #17

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=<sending pin> --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'...

A World Wide Web Of Reasons
A World Wide Web Of Results
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
August 21, 2017, 06:18:33 PM
 #18

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=<sending pin> --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).
mnemonicmind (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 14


View Profile
August 21, 2017, 09:47:08 PM
 #19

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?
mnemonicmind (OP)
Newbie
*
Offline Offline

Activity: 20
Merit: 14


View Profile
August 21, 2017, 09:55:33 PM
Last edit: November 12, 2017, 07:21:20 PM by mnemonicmind
 #20

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.
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!