Open louisinger opened 2 months ago
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.
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.
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.
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
andinternalKeyPath
are hardcoding the account member in derivation path towaddrmgr.DefaultAccountNum
.Is it expected ? Is there a way to recover an account with account index greater than 0 ?
https://github.com/btcsuite/btcwallet/blob/ffb143c77cc57602c812bf7498ef1d407ba41581/wallet/wallet.go#L1010