Issue #15732 describes how the Bitcoin Core project is striving to organize libraries and their associated source code, copied below for convenience:
Here is how I am thinking about the organization:
libbitcoinqt.ashould all be terminal dependencies. They should be able to depend on other symbols in other libraries, but no other libraries should depend on symbols in them (and they shouldn’t depend on each other).
libbitcoin_consensus.ashould be a standalone library that doesn’t depend on symbols in other libraries mentioned here
libbitcoin_util.aseem very interchangeable right now and mutually depend on each other. I think we should either merge them into one library, or create a new top-level
src/util/, and start to distinguish general purpose utility code (like argument parsing) from bitcoin-specific utility code (like formatting bip32 paths and using ChainParams). Both these libraries can be depended on by
libbitcoinqt.a, and they can depend on
libbitcoin_consensus.a. If we want to split util and common up, as opposed to merging them together, then util shouldn’t depend on libconsensus, but common should.
Over time, I think it’d be nice if source code organization reflected library organization . I think it’d be nice if all
libbitcoin_utilsource files lived in
libbitcoin_consensus.asource files lived in
src/consensus, and all
libbitcoin_server.acode lived in
src/node(and maybe the library was called
You can track the progress of these changes by following links from the issue to associated PRs.
libbitcoin-kernel project will provide further clean-ups and improvements in this area.
If you want to explore for yourself which sources certain libraries require on the current codebase, you can open the file
src/Makefile.am and search for