Includes #6006 and #5990 Supersedes #5686 and #5744 PR is mainly for discussion and a try to get a direction where to go.
This will demonstrate a design of a possible wallet modularity and should allow one to get “the big picture”. The new wallet (currently called “corewallet”) is completely decoupled from the core and the current wallet. It can run in parallel with the current wallet.
Modularization
- The current wallet is functional untouched, but there are serval modularity changes (mainly #5990).
CoreWallet
- Dummy wallet (can only generate addresses)
- logdb: checksummed append only file format
- basic multiwallet support
- No selected-wallet state (no “active wallet”), every RPC call should have a “walletid” arg (it would be possible to keep this empty if only one wallet is present)
- Very basic Bip32 implementation (I’m currently working on that)
RPC
- RPC endpoint for CoreWallet is
/wallet
. - RPC parameters should always come through a property list (json object like
["hex": "ea6", "flag": true]
) to avoid parameter ordering
Bitcoin-Cli
[not implemented yet]
bitcoin-cli -w
should access the new endpoint and parameters will be converted to a json property list (bitcoin-cli -w walletid=default flag=true anotherflag=1 <command>
will be converted to["walletid":"default", "flag":true, anotherflag:1]
).
Code Guidelines
- CoreWallet is completely held in a namespace to avoid interfering with CWallet and co.
- CoreWallet should not use any exiting namespaces like std, boost or json_spirit
GUI
- If CoreWallet gets stable, it would be possible to switch the GUI implementation to the new wallet
- Currently the GUI is tied to the current wallet. Supporting multiple wallet implementations on GUI level makes no sense IMO.
Step-by-step approach
- corewallet must be enabled during configuring (
--enable-corewallet=yes
), default isno
so a merging into master could be seen as safe.
How to continue
The groundwork PRs are already open (#6006, #5990, etc.). More small and reviewable PRs will follow.
A good way would be to merge the modularity groundwork as well as a very basic “corewallet” implementation. As long as corewallet will only compile with an additional flag, this should be safe and others could also start contributing to the new wallet (add implementation, help reviewing, etc.).
Critics, conceptual reviews and ideas are highly welcome.