Skip to content
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

wallet: remove libdb from build and source #59

Open
mxaddict opened this issue Aug 22, 2022 · 10 comments
Open

wallet: remove libdb from build and source #59

mxaddict opened this issue Aug 22, 2022 · 10 comments

Comments

@mxaddict
Copy link
Collaborator

Reasoning, since we are launching a new chain with this codebase, might make more sense to drop bdb support entirely and just use the new libsqlite wallet db exclusively.

The only reason for bdb support still remaining in upstream is for backwards compatibility with older wallet.dat files.

@philmb3487
Copy link

LGTM

@philmb3487
Copy link

NACK. the current dumpmnemonic command does not support descriptor wallets. A decision needs to be made, if a switch to the new descriptor wallet then what do we do with these ~8 descriptors ??

listdescriptors true will give you a list.

@aguycalled
Copy link
Collaborator

Let me give it a thought and I will comment throughout the day.

@aguycalled
Copy link
Collaborator

As I understand the concept of descriptors, those refer to different derivation paths from the same master key for different kind of output scripts. But they all share the same master key which is the one that we need to dump as a mnemonic.

Looking at the output of listdescriptors true, the part prefixed by xprv is the master key, which is common to all the descriptors.

A new type of descriptor will need to be created in a future task for BLSCT outputs, but I can't see now how this affects to the current task of allowing to export the master key as a mnemonic.

@philmb3487
Copy link

philmb3487 commented Aug 24, 2022

As I understand the concept of descriptors, those refer to different derivation paths from the same master key for different kind of output scripts. But they all share the same master key which is the one that we need to dump as a mnemonic.

Looking at the output of listdescriptors true, the part prefixed by xprv is the master key, which is common to all the descriptors.

A new type of descriptor will need to be created in a future task for BLSCT outputs, but I can't see now how this affects to the current task of allowing to export the master key as a mnemonic.

Again, these are assumptions. There is no concept of a "master key" in the descriptor wallet, rather you have N different SPK's which may contain one of more (multisig for example) derivation key. The keys will be accumulated in a std::set<> and returned as an array of key mnemonic phrases. In most cases this should be one phrase unless the user manually adds more keys, in which case choosing the "right key" is a difficult task.

@aguycalled
Copy link
Collaborator

Please correct me if I am wrong, but as I understand it, even if a user sets a new seed using the RPC command sethdseed, the old one gets invalidated and future derivations are done from the new seed. There is always only one seed per wallet.

Is there another way to change the seed which I might be missing?

@philmb3487
Copy link

Please correct me if I am wrong, but as I understand it, even if a user sets a new seed using the RPC command sethdseed, the old one gets invalidated and future derivations are done from the new seed. There is always only one seed per wallet.

Is there another way to change the seed which I might be missing?

sethdseed is not supported on descriptor wallets.

@aguycalled
Copy link
Collaborator

How is the seed, used to derive new addresses, changed in a descriptor wallet?

@philmb3487
Copy link

philmb3487 commented Aug 24, 2022

Every descriptor is a seed for a specific type of transaction, and so the descriptor for transaction type T could be removed and a new descriptor added for type T with that target seed.

It might be possible to modify the Descriptor wallet to get single-seed phrase semantics by starting from a blank wallet and manually creating the descriptor/descriptors we need from a recorded master seed in the CWallet database. Then the semantics we want would be set that seed, update the wallet by recreating the descriptors, and there you go.

But still what type of transactions will we be using?

If I understand this correctly, please correct me if I'm wrong.

@aguycalled
Copy link
Collaborator

We will use BLSCT-type outputs, which do not require the use of Bitcoin Script, so they might (maybe) fall out of the scope of descriptors. I need to learn a bit more about them to be able to answer with conviction, but so far, with the information you shared, I tend to think we should disable descriptor wallets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants