citadel-tech / coinswap

Functioning, minimal-viable binaries and libraries to perform a trustless, p2p Maxwell-Belcher Coinswap Protocol
https://gist.github.com/chris-belcher/9144bd57a91c194e332fb5ca371d0964
Other
68 stars 43 forks source link

[reafactor] Add unique identifier for wallet store. #215

Open mojoX911 opened 1 month ago

mojoX911 commented 1 month ago

The Wallet::init() function currently takes in the wallet_file_path which is a fully specified path with a file name.

Instead, it should take a data directory path and use a wallet.dat filename, for all wallets.

The Wallet Store instead of having the filename should have a unique_id (the master key fingerprint). This unique ID should be used as the rpc wallet file name too to ensure consistency between the coin swap wallet file and the rpc wallet file.

https://github.com/citadel-tech/coinswap/blob/4818a24c8a7c735f5c3ddc4bb4bee4a1ffa56855/src/wallet/storage.rs#L21-L23

KnowWhoami commented 1 month ago

I tried to solve this for bdk_wallet but it would be better for master.

mojoX911 commented 1 month ago

I tried to solve this for bdk_wallet but it would be better for master.

Do you wanna attempt a PR in master?

KnowWhoami commented 1 month ago

@wthrajat will take this up as he has no work right now.

KnowWhoami commented 1 month ago

RPCconfig struct also requires this replacing wallet_name with unique_id. https://github.com/citadel-tech/coinswap/blob/3727d0bfacfd62cbbef5d0bbea20d29debb3220b/src/wallet/rpc.rs#L25