-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[WIP] descriptor based wallet serialization and import #15487
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
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
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. |
6457e69 to
df79475
Compare
src/wallet/wallet.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: ;; at end of line :-)
src/wallet/wallet.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be const?
src/wallet/wallet.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Just return LoadDescriptor(nID, std::move(desc));?
|
@practicalswift There is absolutely no point in giving coding nits on a PR that is just at a proof of concept stage like this. |
|
@sipa Oh, personally I'm very happy as a PR author when reviewers take time to point out areas of improvement (large or small) or small mistakes in my code also in the WIP stage. In the event that I find a particular nit irrelevant or premature I would simply hit "Resolve conversation" and be done with it. What do you think @Sjors? |
|
Perhaps "Draft pull requests" could be used to opt out of any code feedback:
Either way it would be nice to have something something similar to the developer notes for review work with clearly stated rationales for the guidelines. |
|
I don't mind and usually just fix it in the next update, but whether it's useful depends on the type of nit. Semi columns, whitespace, consts and return value stuff feedback is not useful imo, because those things are likely to be moved around. I suggest holding on off on those until I remove the WIP label. My own standard for WIP is anything that compiles and works in the happy-case scenario. What I find more useful is help like "don't use unique_ptr in this way", or suggestions anywhere I put "TODO: this is terrible". |
src/wallet/walletdb.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@practicalswift e.g. this is the kind of thing I find feedback more useful on in the WIP stage
|
I took a look at this, and it seems well structured. I'm curious what the first use-case will be. Or I guess what's the minimum thing that needs that needs to be implemented here for this to be useful for hardware wallets and #14912? Current state as of df794753284cc1bd991a5cdf0bd747fffb1db3b9 seems to be that a descriptor wallet is a blank wallet that you're allowed to import public key descriptors to, without them being used for anything yet. It does seem to me that the flag stuff might be overkill. I don't think we need a new flag or changes to createwallet now that we already have blank wallets. It looks like |
|
The reason for the flag is to prevent "legacy" keys from getting mixed with descriptors. Maybe later on I discover that such mixing is fine, then I can drop the flag. Also note that the blank flag goes away when you add a key. Which reminds me that it should also go away when you add a descriptor; that's missing in this version. |
df79475 to
7cbf31c
Compare
2adbe65 to
aa03f8e
Compare
importdescriptor replaces importmulti for descriptor based wallets.
aa03f8e to
a29ff2c
Compare
e192f02 to
4e4063d
Compare
4e4063d to
ad60f1e
Compare
| Needs rebase |
Introduces a non-backwards compatible wallet type which contains a set of output descriptors.
A new RPC method
importdescriptorworks likeimportmultibut for one descriptor at a time and with fewer options.Each wallet descriptor has a
purpose: current receive, current change, archive (receive & change)The current receive and change purposes can have one descriptor with address type bech32 and one with address type base58. It builds on top of #15590 for that.
getnewaddressfinds correct receive descriptor based on address type, which must be eitherbech32orlegacy(base58).Usage:
This initial version will have several limitations (ignoring the TODO list below). It paves the way towards usage with hardware wallets in #14912.
createwalletfollowed byimportdescriptorTODO:
For followup PR: