News for hackers. Stuff that matters.
Re:Bitcoin Private Key Necromancy by graemian on Wednesday December 18, 2013 @10:12AM (#6927878)
Doesn't work for Bitcoin Wallet on Android :-(

I lost some Bitcoins on an old phone that used Bitcoin Wallet (https://github.com/schildbach/bitcoin-wallet) by doing "Settings > Reset".

I tried using this app to find them by dumping the /data partition, but no luck. Apparently it uses a different wallet format:

The wallet file format is not compatible to wallet.dat (Satoshi client). Rather, it uses a custom protobuf format which should be compatible between clients using bitcoinj.

Any ideas on how to find such coins?

Re:Bitcoin Private Key Necromancy by sillysaurus2 on Wednesday December 18, 2013 @10:22AM (#6927963)
I like a good challenge. Would you send me a dump of the phone's harddrive? The command to dump the harddrive is `dd if=/dev/hda1 of=./phone.image`

Then I'll examine the bitcoinj wallet format and write a tool to search for the private key within the phone.image file.

My email's in my profile.

Re:Bitcoin Private Key Necromancy by ge0rg on Wednesday December 18, 2013 @11:45AM (#6928597)
Haha, this is a nice try :D
Re:Bitcoin Private Key Necromancy by ansible on Wednesday December 18, 2013 @10:40AM (#6928094)
It may have made a new filesystem and written that to your NAND Flash or eMMC drive partition. So the filesystem itself won't contain any old data.

Depending on the type of filesystem used, it may have walked through all the blocks of the NAND Flash, erased them, and then marked them as 'ready for use'.

If you are very serious about this, your best bet is to (A) stop using the phone now, (B) dump the raw partition contents using the Android tools.

The situation might be better or worse if the phone uses eMMC, but the above holds. The chip itself does the Flash management (wear leveling, bad block detection, etc.). So it can hide more, but there may be leftover data from the old /data partition still in the unused blocks.

Re:Bitcoin Private Key Necromancy by graemian on Wednesday December 18, 2013 @11:37AM (#6928531)
I'd love to know if the partition was completely wiped as you describe. It's a Galaxy S2 running Android 4.0.4. It's the /data partition on the internal storage, I think.

How would I find out?

Re:Bitcoin Private Key Necromancy by mrb on Wednesday December 18, 2013 @02:25PM (#6929920)
I wrote a tool one day (during a long car ride :D) to recover keys from Bitcoin Wallet on Android. It consists of searching for the header of the wallet-protobuf file (always starts with "\x0a\x16org.bitcoin.production") and then parsing the protobuf data.

Once the 256-bit private ECDSA keys were dumped in hex, I didn't even bother finding/writing a converter to WIF format. I just used brainwallet.org for that purpose (pasting the value in "secret exponent", and making sure to select "compressed" as Bitcoin Wallet creates compressed pub keys), then imported the WIF into a local bitcoind instance.

Re:Bitcoin Private Key Necromancy by romaniv on Wednesday December 18, 2013 @10:25AM (#6927991)
I lost some Bitcoins on an old phone that used Bitcoin Wallet (https://github.com/schildbach/bitcoin-wallet) by doing "Settings > Reset".

That sounds like remarkably horrible UI design.

Being purely digital and having no institutional overhead, Bitcoin seems to "uncover" a lot of security and design problem in modern apps.

Re:Bitcoin Private Key Necromancy by graemian on Wednesday December 18, 2013 @10:54AM (#6928191)
It was an Android "Settings > Reset", not from within the app