I would like to propose modularization of Bitcoin Core. This will make it easier for different people to to experiment with and implement different features without over-burdening the basic code.
The main code will only consist of a full P2P node implementation with RPC server to control it (similar to –disable-wallet build now), which can be extended with optional modules.
Example modules:
- wallets: the current wallet, but could also be a simple read-only wallet, super-HD wallet with alternative storage, …
- internalminer: the current internal miner will be an optional module
- notifications: launch a script (current), ZeroMQ (#2415), websocket (#3388), …
- unauthenticated HTTP REST interface (#2844), …
Modules exist in their own directory and have one entry point that is called at startup that can register RPC calls, HTTP path handlers, as well as hook into certain events at startup, shutdown, or node events (through CWalletInterface).
They can do this through the ‘module interface’ which will replace and extend the current UI interface (in ui_interface.h
). Like the current UI interface this will be a global structure with boost::signals.
Initially all modules will be built in the bitcoin/bitcoin repository, and which ones are built can be configured through configure flags. Which ones are initialized can be specified through bitcoind command line or bitcoin.conf.
Later on, building modules externally as well as dynamic loading of modules could be added but this requires a stabilized API first (and maybe security measures like code signing).