Why did Bitcoin Core fork LevelDB? What special needs does Bitcoin Core have, which require a specialized version of LevelDB?

2 Answers 2


There are two reasons for having the fork in the first place:

  • Upstream LevelDB does not support Windows, and the branches that are available elsewhere don't support MinGW (which Bitcoin Core uses for its Windows release builds).

  • After the scare the project experienced with the BDB locks bug, which resulted in a fork between different versions (see BIP50), the developers prefer to have exact pinned versions of all libraries that may affect consensus rules. This means for example if a bug were found in LevelDB that affects every implementation equally, Bitcoin Core may be forced to not fix it, in order to not cause a diversion (depending on the nature of the bug).

Additionally, it permitted making some build system integrations easier, and disabling compression in the code (which does not help for Bitcoin Core's use case).


Sometimes LevelDB has bugs and those bugs sometimes are not fixed in a timely manner in the upstream LevelDB project. These bugs can be problematic for Bitcoin Core so a fork of LevelDB was created to handle these bugs specifically.

Additionally, to ensure security, we want to use a specific version of LevelDB at a specific commit. By having our own fork of it, we can control what version and what commit it is on so that we can control exactly what code we are putting into Bitcoin Core.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.