Pages:
Author

Topic: MultiBit - page 71. (Read 336309 times)

legendary
Activity: 1708
Merit: 1066
May 21, 2012, 04:18:30 AM
We've had over a 1000 downloads of MultiBit in the last month!

Github download statistics

I think it is the new clients page on http://bitcoin.org/clients that has increased the download rate.

:-)
legendary
Activity: 1708
Merit: 1066
May 19, 2012, 05:58:17 AM
To extract the private keys from the current MultiBit wallets is not for the faint of heart!

First you will need a hex editor. I used HexEditor for the Mac.

Here is a typical block of bytes that you are searching for, containing the all important private key and the public key:

Code:
78 70 00 00 00 20                                           << The 20 is the length of the private key in hex
                  e5 d4  25 0e 2e 45 ff 82 4e ff            << private key in hex
3b 49 da 1a 4e 9a 4c b5  3f 71 cb 8f b6 80 46 10            << private key in hex
e1 ed 1a 7b 16 28                                           << private key in hex
                  78                                        << ignore this byte
                     75  71 00 7e 00 11 00 00 00            << search bytes
41                                                          << length of public key in hex
   04 19 0a 40 a0 a7 d0  48 c8 79 eb 93 e9 63 48            << public key in hex
82 09 ea ab 65 13 95 c2  7f 21 c2 0e 79 a0 24 18            << public key in hex
05 62 55 34 fc a2 bb 7f  04 46 ce 23 43 89 06 52            << public key in hex
9a 0c 32 11 c5 ef 1b e1  d4 ca 16 fc e3 48 29 73            << public key in hex
10 14                                                       << public key in hex
      78 73                                                 << public key post amble

In reality your hex editor will show them all together - I have added the line separations just for clarity.

To identify a block of bytes containing a private and public key, seach for the hex "75 71 00 7e 00 11 00 00 00 41". You are actually searching for a boundary between the private key and public key stored in a serialization of the class ECKey (which contains the private and public key).

The "41" is the length of the public key (=65 in decimal) so look forward 65 bytes. It should look completely random. This is the public key in hex. After these bytes there should be "78 73".

Before the search string is a single byte which is usually "78" but does seem to vary. Ignore that. Look backwards for 33 bytes and you should see a "20". This is the length of the private key (=32 bytes in decimal). The 32 bytes following the "20" are your private key in hex.

Result!

Repeat this search through your wallet until you extract all the private keys. You will sometimes get false positives in that you get a search hit but the bytes around it have a different structure. You can ignore these.

In Java this hexadecimal representation of the private key can be added to a bitcoinj wallet using:

Code:
Wallet newWallet = new Wallet(NetworkParameters.prodNet());
ECKey key1 = new ECKey(new BigInteger(1, Hex.decode("e5d4250e2e45ff824eff3b49da1a4e9a4cb53f71cb8fb6804610e1ed1a7b1628")));
newWallet.keychain.add(key1);

A useful check that you have not extracted garbage is to print out the bitcoinj wallet using toString() and look at the public key in hex. It should match the public key you extracted from the wallet at the byte level.

You then need to replay the blocks from the date of the first transaction for that address to get the transactions. I just looked up the address in blockchain.info and looked at the first transaction to see what this date was.
legendary
Activity: 1708
Merit: 1066
May 19, 2012, 05:51:05 AM
Cheers Tittiez!
Quite good fun trying to hunt down where the private keys were in those megabytes of wallet.

I will write up how to extract the private key from MultiBit wallets in case it is useful to other people and post it here.

hero member
Activity: 686
Merit: 500
May 19, 2012, 05:49:18 AM
Awesome, thanks Jim I received what was left in the wallet.
hero member
Activity: 686
Merit: 500
May 18, 2012, 05:52:17 PM
I have made a bit of progress in recovering the keys from Tittiez's wallet.
After staring at the wallet in a hex editor for a few hours I figured out where the public and private keys are exactly and how they are stored. So far I have put exactly one into a MultiBit wallet (it's a start! :-) ). I cannot tell if I can recover every private key yet.

It is all very cut and paste at the moment - I am just doing it manually for now.

Hey, if it helps, I'm looking for 151fndibtR6LBe6VXSYrvV2wjiEGvH9Yhb. Seeing as I created it shortly before the wallet corrupted, wouldn't it be at the bottom of them all? Thanks for the help jim. Smiley

As for the rest of them, I have all the private keys except for maybe one or two addresses, which have no coins on them. The one above is the only one I need.
legendary
Activity: 1708
Merit: 1066
May 18, 2012, 05:36:28 PM
I have made a bit of progress in recovering the keys from Tittiez's wallet.
After staring at the wallet in a hex editor for a few hours I figured out where the public and private keys are exactly and how they are stored. So far I have put exactly one into a MultiBit wallet (it's a start! :-) ). I cannot tell if I can recover every private key yet.

It is all very cut and paste at the moment - I am just doing it manually for now.
hero member
Activity: 686
Merit: 500
May 18, 2012, 05:19:52 AM
@Tittiez
When you create a new address the wallet gets written immediately so the new private keys would have been written to disk. If you have a look at the size of your main.wallet how big is it ? If it is a little bit bigger than your backups we might be able to recover it. If it is something like zero bytes I am afraid the new private keys might be lost.

The wallet still has its file-size, it didn't corrupt.



But I didn't actually have the backup of a wallet, just the backup of the private keys. I don't know how big the file-size was before. Undecided

I've transferred all my coins out and I'll email the wallet to [email protected].

Thanks for trying I guess!
legendary
Activity: 1708
Merit: 1066
May 18, 2012, 02:38:43 AM
@Tittiez
When you create a new address the wallet gets written immediately so the new private keys would have been written to disk. If you have a look at the size of your main.wallet how big is it ? If it is a little bit bigger than your backups we might be able to recover it. If it is something like zero bytes I am afraid the new private keys might be lost.

I googled the error message you had and the hits are to do with Java writing out objects. MultiBit writes out any wallets that are dirty (ie have changed) when it closes so I suspect there was a problem when you reset.

If the wallet is the right size then I would be happy to try and recover the private key(s) you added by hacking down at the byte level. I cannot promise anything but can try. This does mean you will 'burn' any private keys in the wallet (ie show them to someone else and hence can no longer trust them) so if you have any vanity addresses in the wallet this is a bad idea. If you have ordinary private keys and want to try it you could do the following:
1) keep your current (broken) wallet somewhere safe.
2) make a new wallet.
3) use your backup main.wallet to transfer all the BTC out of your backup to your new wallet. (this is so that I cannot steal your BTC. I won't but never trust anyone with your private keys).
4) send me the broken wallet by email and I will see if I can recover the private keys by looking at the bytes.

@da2ce7 yes the HD wallets where you can back up the seed will be a step change for bitcoin I think. I am going to work on 'vanilla' encrypted private keys first (simply encrypting the private keys with AES) and then looking at supporting HD after that. This should be a contribution into bitcoinj and hence available to everyone. It is quite a lot if work of course.
legendary
Activity: 1222
Merit: 1016
Live and Let Live
May 17, 2012, 11:19:35 PM
Yeah... I must admit.  I would be much more confable in using multibit if it used an deterministic wallet.  At-least, sipa has completed the BIP:

https://en.bitcoin.it/wiki/BIP_0032
hero member
Activity: 686
Merit: 500
May 17, 2012, 05:05:29 PM
Code:
18:03:42.622 [main] DEBUG org.multibit.MultiBit - Locating wallets 
18:03:42.622 [main] DEBUG org.multibit.MultiBit - When loading wallets, there were 1
18:03:42.622 [main] DEBUG org.multibit.MultiBit - Loading wallet from 'C:\Users\***\AppData\Roaming\MultiBit\Main.wallet'
18:03:48.969 [main] ERROR org.multibit.MultiBit - Could not load the wallet file "C:\Users\***\AppData\Roaming\MultiBit\Main.wallet".
The error message was "invalid type code: 00"

Fuck. I accidentally hit the reset button on my computer while MultiBit was running. I have most of my private keys backed up, but just minutes before I created a few new addresses and hadn't yet backed them up. I was transferring coins to them.

What do?  Embarrassed

If I can't retrieve my wallet luckily I only lost 0.1239 bitcoins.
legendary
Activity: 1708
Merit: 1066
May 15, 2012, 02:59:36 AM
Hi gaurmiaur,
Good that your bitcoin are safe. I will look at the core problem you had with the blocks not verifying/ downloading. That will help other people in the future.
newbie
Activity: 76
Merit: 0
May 14, 2012, 08:16:42 PM
Blazr, Jim, thank You very much for your response. Now I use wallet in blockchain.info
When I'll got free time, I'll consider all your advices more detailed.
My timezone is GMT+8
legendary
Activity: 1708
Merit: 1066
May 14, 2012, 10:22:42 AM
Thanks for the logs.
There is an error in them: 'checksum does not verify' when it downloads particular blocks which I think is the cause of the problem. I will have a look to track it down but it will take a while as it may depend on the actual peer/ version of bitcoind being connected to.


(this is the same as Blazr's suggestion)

In the meantime, to get your private key into blockchain.info, try the following:

Open up the private key file you exported from MultiBit.
There is a load of comment text (lines beginning with #) and then the private key - a long mixture of numbers and letters that begins with a '5'.

Copy this out of the file.
Ignore the date that is on the same line as the private key - you do not need that.

In blockchain.info there is an import key option. (I am on my iPhone so cannot give you the exact text).
Import it and make sure you specify the 'sipa wallet import format'. It should be able to understand the key and put it in your blockchain.info wallet.

I think you are in a Russian timezone so it is probably getting late for you. Let me know if this works either tonight or tomorrow morning your time.
newbie
Activity: 76
Merit: 0
May 14, 2012, 10:06:30 AM
legendary
Activity: 1708
Merit: 1066
May 14, 2012, 09:07:33 AM
I think it is the fact that you are stuck at block 178910 (or 178916 as in your previous post) that is preventing you seeing the transactions at : 185cuK5cLvu7BGPL5Zgnmd1F6bi2Aor1Tw

Block 178910 is about a week ago, whereas the transactions at 185cu are dated May 13th.
I just ran MultiBit (v0.3.5) and reset the blockchain from before that block to see if there was a general problem with reading blocks 178910 and 178916 - they both were read in fine.


I suggest you do a couple of things:
1) Send me your log files, which will be in the Russian equivalent of:
    C:/Documents and Settings//Application Data/MultiBit/log

(It might be 'roaming' rather than 'Application Data' depending on your version of Windows).
The two files are multibit_console.log and multibit_debig.log. I will then have a look through them.


2) If Blazr's suggestion does not work and you just want to get your bitcoin now, I suggest you export the private key out of MultiBit and import it into a blockchain.info wallet. (The private key is the most important think with bitcoin - as long as you have that you can get your bitcoin). To do this, do the following:

2.1) Choose the wallet in question in the wallet side panel.
2.2) Export the private keys WITHOUT A PASSWORD in the 'Export private keys' screen.
2.3) Open the output key file, select everything and copy it into your paste buffer.
2.4) Go to http://blockchain.info and either log in to your blockchain.info wallet or create a new one.
2.5) Go to the 'Import/Export' screen.
2.6) In the 'Import Wallet' text area, paste in the contents of the key file.
2.7) Press 'Import Wallet'.

This puts your private keys in your blockchain.info wallet.
(You sometimes have to log out/ shut down/ start up/ login again to get blockchain.info to refresh the wallet to see the transactions).

Let me know how you get on.
newbie
Activity: 76
Merit: 0
May 14, 2012, 07:06:18 AM
Did it.



I watched at 178910 and movement since than.   Sad
legendary
Activity: 1708
Merit: 1066
May 14, 2012, 05:23:07 AM
@gaurmiaur

Thanks for your detailed posting - sorry to hear you are having trouble.
Try Tittiez's suggestion to do a reset as he suggests.

Let us know here if it solves it or not.

Jim
hero member
Activity: 686
Merit: 500
May 14, 2012, 05:18:40 AM
Hi Tittiez,
It is on my list of TODOs but I must admit I am pushing to get the groundwork done for supporting encrypted wallets so have not worked on it. Supporting encrypted wallets is long overdue so I am going to work on that (and the background work needed to support it) pretty much exclusively until it is done. Sorry.

Jim

Okay, I understand and I agree that it needs to get done.
hero member
Activity: 686
Merit: 500
May 14, 2012, 05:17:49 AM
I'm almost in despair, so I wrote to Jim and copy it here
Hope someome will help me to resolve this big trouble.



legendary
Activity: 1708
Merit: 1066
May 14, 2012, 05:17:11 AM
So I'm guessing its not possible to add a Sign Message feature then? Sad

Hi Tittiez,
It is on my list of TODOs but I must admit I am pushing to get the groundwork done for supporting encrypted wallets so have not worked on it. Supporting encrypted wallets is long overdue so I am going to work on that (and the background work needed to support it) pretty much exclusively until it is done. Sorry.

Jim
Pages:
Jump to: