Skip to content

Conversation

brunoerg
Copy link
Contributor

This PR adds an account parameter in createwallet RPC. It's the
BIP44 account that will be used in SetupDescriptorScriptPubKeyMans
to fetch the descriptors from the external signer.

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 21, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
Concept ACK BrandonOdiwuor

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #28710 (Remove the legacy wallet and BDB dependency by achow101)
  • #28574 (wallet: optimize migration process, batch db transactions by furszy)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot DrahtBot changed the title wallet, rpc: add BIP44 account in createwallet wallet, rpc: add BIP44 account in createwallet Dec 21, 2023
@brunoerg brunoerg force-pushed the 2023-12-externalsigner-account-parameter branch from cf8021c to 523ad34 Compare December 21, 2023 13:32
brunoerg added a commit to brunoerg/bitcoin that referenced this pull request Dec 21, 2023
@brunoerg brunoerg marked this pull request as ready for review December 21, 2023 17:55
Copy link
Contributor

@BrandonOdiwuor BrandonOdiwuor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

@luke-jr
Copy link
Member

luke-jr commented Dec 26, 2023

Feels like this could be confused with real/beancounter accounts like we used to support years ago. Maybe hd_account or something?

@brunoerg brunoerg force-pushed the 2023-12-externalsigner-account-parameter branch from 523ad34 to 911eba3 Compare December 27, 2023 01:21
@achow101
Copy link
Member

I think this might be a better candidate for a createwalletdescriptor (#29130) equivalent for external signers rather than continuing to jam more arguments into createwallet.

@brunoerg
Copy link
Contributor Author

Feels like this could be confused with real/beancounter accounts like we used to support years ago. Maybe hd_account or something?

I agree, had same thought. Just changed in latest push.

@brunoerg
Copy link
Contributor Author

I think this might be a better candidate for a createwalletdescriptor (#29130) equivalent for external signers rather than continuing to jam more arguments into createwallet.

You mean have a specific RPC for external signers or extending createwalletdescriptor?

Copy link
Member

@luke-jr luke-jr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beyond wallet_name, none of the positional parameters make sense as positional, and that goes for this new one too. Migrating this to an options object should probably be done sooner rather than after making the problem worse

@achow101
Copy link
Member

achow101 commented Jan 4, 2024

You mean have a specific RPC for external signers or extending createwalletdescriptor?

Unsure of the final design, but something like createwalletdescriptor for external signers seems like it would be useful, and having an account argument in that would probably also make sense. Actually, that might make sense for createwalletdescriptor itself.

@ryanofsky
Copy link
Contributor

re: #29129 (comment)

I think this might be a better candidate for a createwalletdescriptor (#29130) equivalent for external signers rather than continuing to jam more arguments into createwallet.

This makes sense, and I added this idea to my list of potential createwalletdescriptor extensions: #29130 (comment)

But in general, as long as the createwallet blank option defaults to false and it creates descriptors by default, probably we should expect createwallet and createwalletdescriptor to accept some of the same options (and hopefully not duplicate the code implementing those options internally).

In this case, I'm not sure if it will be more common to have single bitcoin core wallets with multiple hd_accounts, or multiple bitcoin core wallets with single hd_accounts? In the latter case, it really does make sense to add the option to createwallet. And again as long as blank is not false, it seems like it would be useful to merge this PR to be able to control the descriptors that createwallet will add.

Also agree very much with luke-jr that it would be good not to allow this option to be passed by position, and instead to add an OBJ_NAMED_PARAMS options parameter instead. It probably makes sense to have a separate PR disallowing the other options from being passed by position as well, especially since 6 of the 7 options are bool values, so very easy to confuse if passed by position.

@brunoerg
Copy link
Contributor Author

Also agree very much with luke-jr that it would be good not to allow this option to be passed by position, and instead to add an OBJ_NAMED_PARAMS options parameter instead. It probably makes sense to have a separate PR disallowing the other options from being passed by position as well, especially since 6 of the 7 options are bool values, so very easy to confuse if passed by position.

I strongly agree with that. I could turn this draft until we've that.

@brunoerg
Copy link
Contributor Author

Closing for now.

@brunoerg brunoerg closed this Jul 16, 2024
@bitcoin bitcoin locked and limited conversation to collaborators Jul 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants