Read wallet.dat error?

6

1

I use BitcoinSharp with C#.net. I try to reading my wallet.dat (dont encrpyt). And some error : "The input stream is not a valid binary format. The starting contents (in bytes) are: 00-00-00-00-01-00-00-00-00-00-00-00-62-31-05-00-09 .."

Have any Idea ?

Thanks..

Darkwave34

Posted 2011-12-13T09:18:04.703

Reputation: 221

Can you reproduce this with a fresh test wallet? Perhaps you can post a link to such a wallet here, to help reproduce it? Also, perhaps Bitcoin SE isn't the best place to ask this - try contacting the developers of BitcoinSharp.ripper234 2011-12-13T10:04:15.590

Answers

5

BitcoinSharp does not use the same format that the standard Bitcoin client uses for its wallet file.

BitcoinSharp simply serializes the Wallet object into Binary and writes it to a file whereas the standard Bitcoin client writes its wallet.dat file in a BerkeleyDB format, so the two are not compatible.

You could use something like pywallet to export the keys from wallet.dat and then manually add them to BitcoinSharp's Wallet object, but you won't be able to directly read a wallet.dat.

David Perry

Posted 2011-12-13T09:18:04.703

Reputation: 13 848

I am using serial&desirial wallet object into to file. Thanks..Darkwave34 2011-12-15T12:13:54.950

Not sure I understand the comment, could you rephrase? It doesn't matter what method you're using to open or read the file, Bitcoin's wallet.dat and BitcoinSharp's wallet file are not in the same format - one cannot read or write to the other.David Perry 2011-12-15T16:55:36.767