-
Notifications
You must be signed in to change notification settings - Fork 110
Ideas for wallet storage
The current way in which wallets are stored is a direct serialisation of the wallet class. This causes a couple of problems:
- the serialisation is quite brittle, small changes make the wallet unreadable
- because of the above I (Jim) have basically frozen the bitcoinj code by including it into MultiBit. This will cause problems as it is difficult to keep up to date with bitcoinj and contribute patches back.
- the serialisation is not readable by humans
In preparation of something better, I have put a wallet version number in the [info files](wiki/Wallet info files). This gives a hook to introducing a new wallet format whilst still supporting the old.
My prefered wallet format is XML. We read it in and create a wallet from the nodes. Similiarly we write it out by writing out the wallet keys and transactions etc. We traverse the XML in code (i.e. no automatic XMl -> object conversion) and then can cope in code with the various versions we will have to support over time.
We put a wallet version in the XML.
We can also add the information that is currently going into the [info files](wiki/Wallet info files) and can eliminate them.