cryptoadvance / cryptoadvance/specter-desktop

Deterministically name wallet.dat file's

Open
#436 5 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
847
Forks
259
Avg merge
6d 18h
Merged PRs (30d)
2

Description

Hey guys,

I am not familiar with your method of naming wallets so apologies if this issue is not relevant or feasible.

Since you are supporting the descriptor based wallet export/import aka Account Map I thought this proposal may also be something you are interested in.

In Fully Noded and Gordian Wallet I use the sha256 hash of the descriptor that the Account Map holds (the primary receive descriptor for the wallet) to deterministically name the wallet.dat file for the associated wallet on the app.

For example a Fully Noded wallet now looks like `FullyNoded-8268d751e68922956e6b3ee6ccbb469d18e8a158ee814aa47cb07d0259c1bbad.dat`

The main benefit occurs when a user:

1. Switches devices
2. Connects new device to the same node
3. Goes to recover their wallets on the new device

At that point the app can use `bitcoin-cli listwalletdir` to check if the wallet already exists from `bitcoind` perspective by taking as input the Account Map's `descriptor`, getting the sha256 hash of it and cross checking all existing wallets to see if any match.

If it does exist we can assume that it is safe to reuse that wallet as the chances of two hashes matching are nil. This results in much better UX as no additional wallet creation commands need to take place and more importantly no rescanning is required.
This is a hugely beneficial for pruned nodes as it will prevent users from having to "re-download the entire blockchain" every-time they want to recover a wallet on a different device.

This also fixes some edge cases that can arise if users use similar wallets across multiple apps (Specter, Fully Noded, Gordian Wallet) where one app may get neglected for a period of time which can result in the `pruneheight` being bypassed for an unloaded wallet and yet another reindex would be required which happened to me recently.

Just wanted to throw that out there to see if it could possibly fit in with how you are doing things.

Thanks for the great app!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.