Author

Topic: Getting Private Keys out of mobile Bitcoin Wallet (Read 425 times)

member
Activity: 133
Merit: 34
December 01, 2017, 04:16:45 PM
#6
I assume that it is made on the base of core (it sas that it was programmed by the "Bitcoin Wallet developers - but who am I to know...).
That assumption is wrong. Core does not have an Android app and never has had one. Your wallet is written by different developers and uses different technology. The wallet file is completely incompatible with Bitcoin Core.

However, I try to get hold of my private keys of this wallet. Only question: How?
Bitcoin Wallet for Android uses Bitcoinj. If you are comfortable using the command line and installing JDK and maven packages, then you can use the bitcoinj wallet-tool to extract the data from your wallet file. The wallet-tool is part of the Bitcoinj repository here: https://github.com/bitcoinj/bitcoinj

Thanks.

Tried bitcoinj, but failed miserably Sad
After executing this code:

./wallet-tool dump --dump-privkeys --wallet=[path to my wallet] > wallet.txt

I got an empty file wallet.txt and the following error:

Code:
Failed to load wallet '/path/to/my/Wallet: Could not parse input stream to protobuf
org.bitcoinj.wallet.UnreadableWalletException: Could not parse input stream to protobuf
at org.bitcoinj.wallet.WalletProtobufSerializer.readWallet(WalletProtobufSerializer.java:440)
at org.bitcoinj.tools.WalletTool.main(WalletTool.java:333)
Caused by: com.google.protobuf.InvalidProtocolBufferException: Protocol message tag had invalid wire type.
at com.google.protobuf.InvalidProtocolBufferException.invalidWireType(InvalidProtocolBufferException.java:99)
at com.google.protobuf.UnknownFieldSet$Builder.mergeFieldFrom(UnknownFieldSet.java:515)
at com.google.protobuf.GeneratedMessage.parseUnknownField(GeneratedMessage.java:205)
at org.bitcoinj.wallet.Protos$Wallet.(Protos.java:14696)
at org.bitcoinj.wallet.Protos$Wallet.(Protos.java:14653)
at org.bitcoinj.wallet.Protos$Wallet$1.parsePartialFrom(Protos.java:14859)
at org.bitcoinj.wallet.Protos$Wallet$1.parsePartialFrom(Protos.java:14854)
at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:89)
at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:95)
at com.google.protobuf.AbstractParser.parseFrom(AbstractParser.java:49)
at org.bitcoinj.wallet.Protos$Wallet.parseFrom(Protos.java:15710)
at org.bitcoinj.wallet.WalletProtobufSerializer.parseToProto(WalletProtobufSerializer.java:626)
at org.bitcoinj.wallet.WalletProtobufSerializer.readWallet(WalletProtobufSerializer.java:433)
... 1 more

Although I was able to extract the seed with wallet-decrypt, I'm wondering what went wrong here.
member
Activity: 133
Merit: 34
I'm not sure if this would work but you could try using this tool[1] to export your seed and derivation path. Then, you would be able to import them in Electrum/Electron Cash.

Please share if this works.

[1] https://github.com/jleni/wallet-decrypt

Thanks for the hint - worked like a charme.
HCP
legendary
Activity: 2086
Merit: 4363
Or... you can use decrypt_bitcoinj_seed (https://github.com/gurnec/decrypt_bitcoinj_seed)...

It will extract the 12 word seed from the Bitcoin Wallet backup file. You can then import that seed mnemonic into any BIP39 compatible wallet.
staff
Activity: 3458
Merit: 6793
Just writing some code
I assume that it is made on the base of core (it sas that it was programmed by the "Bitcoin Wallet developers - but who am I to know...).
That assumption is wrong. Core does not have an Android app and never has had one. Your wallet is written by different developers and uses different technology. The wallet file is completely incompatible with Bitcoin Core.

However, I try to get hold of my private keys of this wallet. Only question: How?
Bitcoin Wallet for Android uses Bitcoinj. If you are comfortable using the command line and installing JDK and maven packages, then you can use the bitcoinj wallet-tool to extract the data from your wallet file. The wallet-tool is part of the Bitcoinj repository here: https://github.com/bitcoinj/bitcoinj
legendary
Activity: 2758
Merit: 6830
I'm not sure if this would work but you could try using this tool[1] to export your seed and derivation path. Then, you would be able to import them in Electrum/Electron Cash.

Please share if this works.

[1] https://github.com/jleni/wallet-decrypt
member
Activity: 133
Merit: 34
Hi all,

I am running the Bitcoin Wallet (github.com/bitcoin-wallet/bitcoin-wallet) vrsion 5.40 on an Android mobile. I assume that it is made on the base of core (it sas that it was programmed by the "Bitcoin Wallet developers - but who am I to know...).

However, I try to get hold of my private keys of this wallet. Only question: How?

I can get an encrypted wallet - but this is not accepted by Bitcoin Core on my desktop. I can get an Extended Public Key, but no idea how I can get my private keys with it. If anybody could kick me a bit in the right direction as where to look here, I'd appreciate...

Thanks
Jump to: