Any interrelation between walletS and walletB

Hi everyone,

As we know there is a peercoin address accompanying nushare address, and they share the same private key according to my understanding. On the other hand, my question is is there any interrelation between walletS and walletB? If I have no NBT, can I just backup walletS and delete walletB.dat? So the system can automatically generate walletB.dat when I put walletS.dat back?

Thanks.

There is no relation between the two. They are totally separate. If you delete WalletB.dat your NuShares will still be fine in WalletS.dat. If one of the wallet files is missing on start-up Nu will generate a new wallet file for the missing one and start using it.

I see. Thank you CoinGame.

what was the reason for separating the private keys ? Why not use one private key for both? Just wondering

When I make wallet backup there is only one file generated. How do I restore from a backup file? With peercoin or bitcoin I think I can just copy the backup to the datadir and rename it to wallet.dat. What about nu wallet?

You have to use the backup wallet function on each side of the wallet. So if you backup on the NuShares display you’ll backup your walletS.dat file, and if you backup on the NuBits display you’ll backup your walletB.dat file.

Alternatively you can find both of those files together in your AppData folder for Nu (sometimes its hidden), and you can just copy them from there.

1 Like

Thank you for the explanation. I guess I am not the only one who thought the backup file was a zipped archive with both the B and the S wallet…

btw Sunny once said that copying is not a reliable way to backup. The back up function is the official way. My guess for the reason is that when you run the client or just after you quit, the wallet file may not be completely sync’ed.

Disclaimer
This is only the picture I have in my mind; it would be great if someone who knows the source code (Peercoin source code might be able to answer this question as well) can verify or correct this picture :wink:

Picture
Although I’ve never understood why it is in general an unreliable way to backup, I can imagine that backing up the wallet.dat file while the application is still running might lead to corrupt files (by the application writing into the wallet.dat while the file is being copied on file system level).

To be sure that there is no file handle used to write into wallet.dat, it is a good idea to have the application running and let it make the backup of the wallet.dat; it takes care that the backup is not corrupted by interfering access.

Definitely a best practice, thanks mhps. Copying the files while the client is open or recently opened could introduce defects.