Skip to content

Conversation

@jonasschnelli
Copy link
Contributor

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

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 is no 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.

@jonasschnelli jonasschnelli force-pushed the 2015/04/parallel_wallet2 branch 5 times, most recently from 7cdade5 to 49ea27f Compare April 16, 2015 19:22
@jonasschnelli jonasschnelli force-pushed the 2015/04/parallel_wallet2 branch from 49ea27f to 9933ba2 Compare May 2, 2015 14:26
@laanwj laanwj added the Wallet label May 6, 2015
laanwj and others added 23 commits July 8, 2015 16:57
CTransAction::IsEquivalentTo was introduced in bitcoin#5881.
This functionality is only useful to the wallet, and should never have
been added to the primitive transaction type.
Fixes wrong scriptPubkey problem, which caused the transaction to
not actually be signed.
Reduced wallet/core coupling.

- hides CWalletDB behind CWallet
- reduces ENABLE_WALLET ifdefs
- remove some whitespace
CExtPubKey should be serializable like CPubKey.
Conflicts:
	src/makefile.unix
…et manager signeton

- this is required to have a clean CValidationInterface listener who can support multiple wallets
- create transaction logic is more or less copied from the current wallet
- refactoring of main/mempool interaction from corewallet
@jonasschnelli jonasschnelli force-pushed the 2015/04/parallel_wallet2 branch from fd6900c to 50a8c57 Compare July 8, 2015 14:59
@jgarzik
Copy link
Contributor

jgarzik commented Sep 15, 2015

Strong supporter of this work - concept ACK - though I tend to prefer closing this as matching the "likely to be a very long lived PR" template.

@jonasschnelli
Copy link
Contributor Author

Agreed.
Currently this was getting to big for a PR and therefor continued in a standalone fork https://github.com/jonasschnelli/bitcoin

@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants