• Forum has been upgraded, all links, images, etc are as they were. Please see Official Announcements for more information

Why BDB is still a requirement?

dashvolution

New member
Hi,

I've been compiling Dash from sources and I saw that Berkeley DB is still a requirement in the Makefile. Why is that? I thought that Dash (and Bitcoin) migrated from BDB to LevelDB years ago. Actually in the file dbwrapper.cpp I can see references to LevelDB and not to BDB.

Any idea why BDB is still part of the hard requirements to build?

Cheers
 
LevelDB is used for block index and chainstate DBs. Wallet still uses BDB.
 
Thank you!
Can you point me to the code where BDB is used to parse the wallet? I guess it's being used to parse the .dat files when you back up the wallet data right?

Thank you!
 
The discussion of LevelDB vs BDB has a long history in Bitcoin. There are many arguments why BDB should not be used anymore for the wallet code, but there is also one single argument why it can't be removed that simply: Compatibility. The Bitcoin devs fear that the upgrade from of the wallet.dat from BDB to anything else is too dangerous, as people would actually loose money if it goes wrong in any case. It goes so far, that they even fear upgrading the BDB version to a newer one as it would immediately make the existing wallet.dat incompatible with older versions of the software, making a downgrade impossible. Also, many devs seem to believe that a key/value store is in general the wrong choice, and thus changing BDB to LevelDB would just replace one bad solution with another bad solution.

The plan is to eventually use and migrate to a custom append-only wallet format. Code for this is already available, but as far as I know not merged yet. IMHO what they plan is a good solution to the problem, because it solves many problems and may avoid many future problems.

As Dash is based on Bitcoin, we suffer from the same problems with BDB. We also can't simply upgrade or migrate to something different, without taking many things into consideration. Luckily, sticking to the old BDB version does not harm users that much atm. It's mainly a burden for developers, but they should be able to live with it with some effort and slight pain. We are going to backport a lot of stuff from Bitcoin after the release of Dash 12.2. After that, we can reevaluate the situation with BDB and either take the fixes from Bitcoin (if they are ready by that time) or think about going our own way.
 
Back
Top