etotheipi / BitcoinArmory

Python-Based Bitcoin Software
Other
820 stars 617 forks source link

Use Copy-On-Write to minimize the "double blockchain" disk space requirement #218

Open unimportantdavidz opened 10 years ago

unimportantdavidz commented 10 years ago

I'm having a lot of trouble finding out just what Armory's full blockchain-sized database DOES, but it's obviously based heavily on the original Bitcoin-Qt blockchain db.

The thought that occurs to me is, if the DBs are similar enough, could Armory use a Copy-On-Write system ( https://en.wikipedia.org/wiki/Copy-on-write ) to obviate the need for a whole duplicate DB? All it would need to store in addition to the original blockchain data would be an index of its own modifications to that original data, instead of a whole modified duplicate.

Obviously if the purpose of the duplicate is a complete re-formatting of the blockchain data (encrypting it, etc.), then this will not work, but if there's still a good bit of the original data intact in the Armory DB, I would say that C.O.W. is definitely the way to go.

int03h commented 10 years ago

I think the point is, Its all encrypted and the DB (in bitcoins blockchain ) is there to make the chain except headers etc- its not really there to provide database like functionality. I would imagine the more obvious question is .. why does bitcoin use btrieve to store its data? Armory makes a traditional database so that that transactions are properly indexed etc but the crypted data is still there, at least thats my basic understanding of how the whole thing works.

Armory is simply trying to make all this "crap" more useable.

unimportantdavidz commented 10 years ago

So if Armory's DB includes the original crypted data from the Bitcoin-Core blockchain, a COW system could probably reduce the size of Armory's DB at least 100-fold, it sounds like, while still providing Armory's higher-level "true" DB functions. Is that correct?