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

Restore non-default accounts #957

Open
louisinger opened this issue Sep 26, 2024 · 3 comments
Open

Restore non-default accounts #957

louisinger opened this issue Sep 26, 2024 · 3 comments

Comments

@louisinger
Copy link

louisinger commented Sep 26, 2024

While restoring from seed, default account (index = 0) addresses are restored perfectly. However, all other custom accounts are not checked by the recovery process.

After some debugging, it seems to me that externalKeyPath and internalKeyPath are hardcoding the account member in derivation path to waddrmgr.DefaultAccountNum.

Is it expected ? Is there a way to recover an account with account index greater than 0 ?

func externalKeyPath(index uint32) waddrmgr.DerivationPath {

@Roasbeef
Copy link
Member

Is there a way to recover an account with account index greater than 0 ?

Sure, make a PR that expands the ressurection logic beyond the first account index. Usage in lnd uses the BIP 44 scopes as our account construction essentially.

@louisinger
Copy link
Author

Sure, make a PR that expands the ressurection logic beyond the first account index. Usage in lnd uses the BIP 44 scopes as our account construction essentially.

Not as easy as it sounds because most getters does not support well the non-default accounts. For instance, UnspentOutputs seems unable to filter by key scope (filter account = 0 returns utxos whatever the keyscope type). It makes the custom account really hard and confuse to use and probably also need a rework beside recovery functions.

At least, I'd put a comment or enrich the documentation to explain how custom accounts are managed by the wallet.

@Roasbeef
Copy link
Member

That sounds like a good list of intermediate steps to address for whoever to take on this issue in the future. Those that have this requirement would be the most suited to implement this feature with those requirements in mind.

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

No branches or pull requests

2 participants