Bitcoin Forum
May 21, 2024, 11:12:30 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: dump keys from protobuf format [solved]  (Read 1191 times)
tspacepilot (OP)
Legendary
*
Offline Offline

Activity: 1456
Merit: 1078


I may write code in exchange for bitcoins.


View Profile
April 06, 2015, 05:20:40 AM
Last edit: April 06, 2015, 07:15:17 AM by tspacepilot
 #1

Hi folks,

I've got a backup from my Bitcoin Wallet for Android (Andreas S.) and I've decrypted it using openssl.  So, because of some changes to how Bitcoin Wallet works, I was surprised not to find a plain text file, but instead I have a protobuf file.  What I want to do is export the private keys.  I understand that if I dig around in bitcoinj I can apprantly "write a small app" do to do this (<http://bitcoin.stackexchange.com/questions/29586/how-do-i-extract-my-private-keys-from-a-protobuf-wallet>).  But, given that Java isn't my favorite language, I'll probably take way longer than I should to do this and given that someone must have already solved the problem, I figure it's worth asking here:

Does anyone have any recommendations for getting this done (preferably with GNU/Linux command line tools) quickly?  Or more quickly than writing my own Java app?  Looking for tips on speeding this up for myself.  To give an idea of where I'm starting from if I go the Java rout, I understand the concept that I will need to make a class and make a static main and have my main open my file and then run some static methods somewhere in the guts of the bitcoinj library on my file.  So you can see there's a lot of detail I'm going to have to go searching for.  Can you guys speed me up?
tspacepilot (OP)
Legendary
*
Offline Offline

Activity: 1456
Merit: 1078


I may write code in exchange for bitcoins.


View Profile
April 06, 2015, 06:07:51 AM
 #2

Actually, it looks like I may be able to use the "wallet-tool" program that comes with bitcoinj to do this job.  I'm currently playing around with that as a first step rather than trying to reinvent a rather complex wheel.
tspacepilot (OP)
Legendary
*
Offline Offline

Activity: 1456
Merit: 1078


I may write code in exchange for bitcoins.


View Profile
April 06, 2015, 07:14:56 AM
 #3

This is kinda like a conversation with myself, but I'm posting here as I make progress for posterity as I saw many queries like this on google but no easy answers.

It turns out you *can* very easily export your private keys from a protobuf wallet using the wallet-tool from bitcoinj (no need to build your own app).  You say:

$ ./wallet-tool dump --dump-privkeys --wallet=/path/to/protobufwallet

and you'll see a keys block in the output.  Now, the last step in my particular journey is to conver the hex-dumped keys to bitcoinbase58.  But that's another topic so I'm locking this one (solved and closed).
Pages: [1]
  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!