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

Fix btc wallet restore #332

Merged
merged 6 commits into from
Sep 27, 2024
Merged

Fix btc wallet restore #332

merged 6 commits into from
Sep 27, 2024

Conversation

louisinger
Copy link
Collaborator

This PR is a draft, waiting for btcsuite/btcwallet#957

TL;DR

  • remove unused Rescan call
  • first account index set to 0 ("default" name)

It fixes the restore process for the main account, but the connectors account (with index = 1) is not restored (see btcwallet issue).

@tiero
Copy link
Member

tiero commented Sep 26, 2024

Reason to NOT mix the connectors scripts in the same main account script? We still know which is which by database no?

@louisinger
Copy link
Collaborator Author

louisinger commented Sep 26, 2024

Reason to NOT mix the connectors scripts in the same main account script? We still know which is which by database no?

connectors must not be spent during a certain period of time so having two accounts makes the coin selection simpler.
also for ASP "analysis", I do think it makes the available liquidity clearer if we don't mix connectors and main funds.

another way to solve would be to use p2tr scope for connector instead of p2wpkh : this way the connector account index will be 0 and should be restored

@tiero
Copy link
Member

tiero commented Sep 27, 2024

p2tr scope

Care to elaborate here?

we don't mix connectors and main funds.

This is important, and assigning a bip44 account to each makes sense, but we could have those information in database worst case.

@louisinger
Copy link
Collaborator Author

Care to elaborate here?

Only the "default" account for each scope is restored. Today we are using the same scope for the connector and the main account (the p2wkh one). It means that one is the default account and the other a custom account. If we move one of the accounts to p2tr scope instead of p2wkh, we could use "default" for all accounts and thus make the restoration work.

TL;DR if connector account = default p2tr account, it will remove the need for custom account

@louisinger louisinger marked this pull request as ready for review September 27, 2024 14:36
@altafan altafan merged commit 72e31d8 into ark-network:master Sep 27, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

3 participants