8000 wallet: rpc to add automatically generated descriptors by achow101 · Pull Request #25907 · bitcoin/bitcoin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

wallet: rpc to add automatically generated descriptors #25907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 22 commits into from

Conversation

achow101
Copy link
Member
@achow101 achow101 commented Aug 22, 2022

It is useful to have a RPC that can create and add the automatically generated descriptors (that are normally made during creation) to a wallet. This is especially useful when a new default descriptor has been implemented as it allows wallets created before that time to quickly and easily add that type of descriptor.

In particular, descriptor wallets created before Taproot was implemented can use the new createwalletdescriptor RPC in order to get a Taproot descriptor.

Furthermore, to keep the newly generated descriptor in line with the existing descriptors, this PR uses #26728 as it exposes a "wallet extended key" for us (in addition to upgrading wallets implemented prior to have a wallet xpub). The newly generated descriptors will use the "wallet extended key" stored in CWallet that PR adds.

createwalletdescriptor is generic and so it can also be used with the other address types. Of course, it given the same wallet extended key, address type, and internal-ness, it will create the same descriptor. So some refactoring has been done in order to detect that the same descriptor is about to be created, and to avoid overwriting any existing descriptors.

@DrahtBot
Copy link
Contributor
DrahtBot commented Aug 23, 2022

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 w0xlt, Sjors
Stale ACK Rspigler

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:

  • #bitcoin-core/gui/733 (Deniability - a tool to automatically improve coin ownership privacy by denavila)
  • #29136 (wallet: addhdkey RPC to add just keys to wallets via new void(KEY) descriptor by achow101)
  • #29130 (wallet: Add createwalletdescriptor and gethdkeys RPCs for adding new automatically generated descriptors by achow101)
  • #29124 (wallet: Automatically repair corrupted metadata with doubled derivation path by achow101)
  • #29016 (RPC: add new listmempooltransactions by niftynei)
  • #28574 (wallet: optimize migration process, batch db transactions by furszy)
  • #28333 (wallet: Construct ScriptPubKeyMans with all data rather than loaded progressively by achow101)
  • #28142 (wallet: Allow users to create a wallet that encrypts all database records by achow101)
  • #27865 (wallet: Track no-longer-spendable TXOs separately by achow101)
  • #27792 (wallet: Deniability API (Unilateral Transaction Meta-Privacy) by denavila)
  • #27286 (wallet: Keep track of the wallet's own transaction outputs in memory by achow101)
  • #26728 (wallet: Have the wallet store the key for automatically generated descriptors by achow101)
  • #26008 (wallet: cache IsMine scriptPubKeys to improve performance of descriptor wallets by achow101)
  • #24748 (test/BIP324: functional tests for v2 P2P encryption by stratospher)
  • #22838 (descriptors: Be able to specify change and receiving in a single descriptor string by achow101)
  • #22341 (rpc: add path to gethdkey by Sjors)

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.

@luke-jr
Copy link
Member
luke-jr commented Aug 26, 2022

I would expect upgradewallet to do this. Is there a reason for the approach here?

@achow101
Copy link
Member Author

I would expect upgradewallet to do this. Is there a reason for the approach here?

The wallet version isn't modified by this. Also this allows for much more granulated control of what is added. While this can be used for upgrading a wallet to support a new kind of descriptor, it's not strictly just an upgrade function as it can also be used on blank wallets and after rotating the hd key. So I didn't think it was appropriate for upgradewallet.

@w0xlt
Copy link
Contributor
w0xlt commented Aug 27, 2022

Concept ACK

Copy link
Member
@Sjors Sjors 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 on createwalletdescriptor.

@Sjors
Copy link
Member
Sjors commented Sep 6, 2022

The GUI receive address type dropdown is not updated after calling this.

@achow101 achow101 force-pushed the upgrade-to-tr-2 branch 2 times, most recently from 70a8266 to 29ce197 Compare December 19, 2023 22:28
furszy and others added 5 commits December 19, 2023 18:27
…ster

The test creates a wallet on master, downgrades and encrypts the wallet.
Then, it tries to open it again on master.
We will need access to a function that sets up a singular
DescriptorSPKM, so refactor this out of the multiple DescriptorSPKM
setup function.
@achow101
Copy link
Member Author
achow101 commented Jan 6, 2024

Superseded by #29130

I don't think there's a reason to come back to this design, but the branch won't be deleted so we can reopen if desired.

@achow101 achow101 closed this Jan 6, 2024
@bitcoin bitcoin locked and limited conversation to collaborators Jan 5, 2025
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.

9 participants
0