Bitcoin Forum
November 04, 2024, 10:25:39 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What is stored in the wallet.dat file?  (Read 5687 times)
Wolf0 (OP)
Member
**
Offline Offline

Activity: 81
Merit: 1002


It was only the wind.


View Profile
February 20, 2013, 01:34:50 AM
Last edit: October 16, 2018, 03:26:29 AM by Wolf0
 #1

NaN.
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1036



View Profile WWW
February 20, 2013, 10:48:25 PM
 #2

1. The wallet can be encrypted, you must know how to recognize this and properly decrypt and reencrypt data,
2. Examine the code of pywallet, and run pywallet to do a wallet dump to get an idea what data is stored,
3. Understand what you are doing 110%, there's stuff in there like reserve keys, transactions, address book, etc.
niko
Hero Member
*****
Offline Offline

Activity: 756
Merit: 501


There is more to Bitcoin than bitcoins.


View Profile
February 22, 2013, 12:17:43 AM
 #3

Could someone point me to pywallet? I searched for it, but couldn't find it.
Try searching the Internet using your favorite search engine.

They're there, in their room.
Your mining rig is on fire, yet you're very calm.
etotheipi
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
February 22, 2013, 12:48:19 AM
 #4

For reference, Armory's wallet format is documented here:

http://bitcoinarmory.com/armory-wallet-files/

Armory, at one point, also had code for reading the Satoshi wallet, encrypted or not.  The code was based on pywallet's code.  However, that code is commented out because Armory couldn't support Bitcoin-Qt's switch to compressed public keys.  Thus, there actually is not a way to convert new wallets to Armory format, because it will calculate different (incorrect) addresses for the private keys.  This will be fixed soon in Armory (with new wallet format), but I suspect Armory won't be the only app that has this problem.

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
DannyHamilton
Legendary
*
Offline Offline

Activity: 3472
Merit: 4801



View Profile
February 22, 2013, 05:02:45 PM
 #5

Could someone point me to pywallet? I searched for it, but couldn't find it.

http://bit.ly/WZmG1x
etotheipi
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
February 22, 2013, 07:19:02 PM
 #6

For reference, Armory's wallet format is documented here:

http://bitcoinarmory.com/armory-wallet-files/

Armory, at one point, also had code for reading the Satoshi wallet, encrypted or not.  The code was based on pywallet's code.  However, that code is commented out because Armory couldn't support Bitcoin-Qt's switch to compressed public keys.  Thus, there actually is not a way to convert new wallets to Armory format, because it will calculate different (incorrect) addresses for the private keys.  This will be fixed soon in Armory (with new wallet format), but I suspect Armory won't be the only app that has this problem.

Why not simply decompress the keys?

Because you get a different address.

EDIT:  It's not terribly complicated to implement the correct logic, it's just that I tested the bejeezuz out of the current wallet format, and it is the most sensitive part of the application.  I didn't want to mess with what was working.

If you're not clear on why compressed keys give you a different address and how they are handled in Bitcoin-Qt, you should do a little research before moving keys between wallets.  

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
etotheipi
Legendary
*
expert
Offline Offline

Activity: 1428
Merit: 1093


Core Armory Developer


View Profile WWW
February 22, 2013, 07:59:35 PM
 #7

If you're not clear on why compressed keys give you a different address and how they are handled in Bitcoin-Qt, you should do a little research before moving keys between wallets.  

I'm working on that right now. From my existing knowledge of compression, however, compressed keys should just need to be decompressed. Obviously, that's not the case, so I'll be looking into it.

I was short because I was in a hurry to respond.   Now I have 30 more seconds Smiley 

The reason is that your bitcoin address is the hash of your public key.  If you use a compressed public key, you get a different hash than if you used the uncompressed key.  The ECDSA is all the same after uncompressing, but you need to make sure you're using the right address.

As such, the Bitcoin-Qt devs decided to add a 0x01 byte to the end of all private keys that use compressed public keys.  If it was not there, then having the raw ECDSA key would give no indiciation of whether to use compressed or uncompressed for hashing to create the address.   For instance -- in Armory, the 0x01 byte will be added when keys are "encoded" to be moved around, but in the file format, they will be stored as 32-byte integers with a one-bit flag identifying whether they are compressed.  That's why it matters.

Founder and CEO of Armory Technologies, Inc.
Armory Bitcoin Wallet: Bringing cold storage to the average user!
Only use Armory software signed by the Armory Offline Signing Key (0x98832223)

Please donate to the Armory project by clicking here!    (or donate directly via 1QBDLYTDFHHZAABYSKGKPWKLSXZWCCJQBX -- yes, it's a real address!)
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!