Update RPCs to support multi-scope multi-account [WIP] #26

Merged
roylee17 merged 29 commits from roylee/support-multi-scope-multi-account into master 2022-09-28 20:48:23 +02:00
roylee17 commented 2022-08-26 08:07:00 +02:00 (Migrated from github.com)

bitcoin-core used to have an accounting system, which has been ripped off and replaced by labels around 0.17.0. Over the last few releases, bitcoin-core has completely deprecated account-related RPCs and account-related fields of other RPCs.

lbcwallet(and btcwallet) and other modern wallets implement HD wallets conforming to BIP 32, 43, 44, 49, 84, etc. However, primary users of upstream btcwallet use gRPC-based APIs instead of JSON RPCs. While the wallet application itself and its components support multi-scope (address types) and multi-account, most of the JSON RPCs are half-baked and hard-coded to use only one "default" account and legacy(p2pkh) address type only.

This PR resurrects those accounting RPCs and revives those deprecated fields.

Todo:

  • Review APIs and ponder the default values for compatibility.
    For example, without specifying "account," should we return the balance of "all accounts" or "default account"?
  • Update the help messages.
  • Support multi-account rescan/recovery
  • Update(and extend) the test cases to cover the changes.
  • Sanitize the commits to make future reference easier.
  • Upload local changes to the btcjson package of lbcd
  • Update imported addresses for multi-scope
  • Support non-interactive startup options to unlock the wallet.
**bitcoin-core** used to have an accounting system, which has been ripped off and replaced by labels around 0.17.0. Over the last few releases, **bitcoin-core** has completely deprecated account-related RPCs and account-related fields of other RPCs. **lbcwallet**(and **btcwallet**) and other modern wallets implement HD wallets conforming to BIP 32, 43, 44, 49, 84, etc. However, primary users of upstream **btcwallet** use gRPC-based APIs instead of JSON RPCs. While the wallet application itself and its components support multi-scope (address types) and multi-account, most of the JSON RPCs are half-baked and hard-coded to use only one "default" account and legacy(p2pkh) address type only. This PR resurrects those accounting RPCs and revives those deprecated fields. Todo: - [x] Review APIs and ponder the default values for compatibility. For example, without specifying "account," should we return the balance of "all accounts" or "default account"? - [x] Update the help messages. - [x] Support multi-account rescan/recovery - [x] Update(and extend) the test cases to cover the changes. - [x] Sanitize the commits to make future reference easier. - [x] Upload local changes to the **btcjson** package of **lbcd** - [ ] Update imported addresses for multi-scope - [ ] Support non-interactive startup options to unlock the wallet.
roylee17 commented 2022-09-28 20:48:29 +02:00 (Migrated from github.com)

It's functioning and in good shape now.
Merge it and work on the remaining tasks on the master branch.

It's functioning and in good shape now. Merge it and work on the remaining tasks on the master branch.
Sign in to join this conversation.
No description provided.