Author Topic: How to backup and restore Protoshares-qt wallet?  (Read 19282 times)

0 Members and 1 Guest are viewing this topic.

Offline santaclause102

  • Hero Member
  • *****
  • Posts: 2486
    • View Profile
Ah, I see Riverhead has addressed that. Yes, before 100 transactions, your change will be safe because of the key pool. Please just be aware of how this works. I lost a lot of btc back in the day from not understanding this.

Ok. So as long as I copy the wallet.dat file that was in use every 100 transactions or less I am safe. And also it doesn't do harm to replace the original wallet.dat copy with the wallet.dat file that was recently used. Correct?
 
Offtopic: How can I empty the wallet on a USB stick that was connected to a Internet Cafe omputer? Does my system (potentially) get infected just by pluging a USB stick into an infected computer and afterwards into my main computer?

And would I be able to send coins from the wallet that is within Linux on an USB Stick? Will linux connect to the Internet via the computer to which the USB stick is connected to?
« Last Edit: January 05, 2014, 05:01:04 pm by delulo »

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
Ah, I see Riverhead has addressed that. Yes, before 100 transactions, your change will be safe because of the key pool. Please just be aware of how this works. I lost a lot of btc back in the day from not understanding this.
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai


When I want to use coins I copy the wallet.dat file on the USB stick to the maleware free computer  (to appdata/protoshares) and send my coins either to the hot wallet address or directly to whoever I want to send coins to... Then I erase the wallet.dat file on the maleware free computer again without saving it.


Careful! Don't do quite this!
Your wallet will generate a change address and send some number of coins to that address. Your original backup will not have this change address!
You will either have to re-save it, or use sendmany via the console to send it back.
There is a bounty open to build a client that will control your change address so that this is not an issue.
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline Riverhead

Waoh that was accurate :)

...so I have to replace the originally stored wallet.dat file with the one that was recently used (by the client) every 100 (or less) transactions?


Yup.


...so storing my wallet.dat file, alongside with an installed client within a Linux environment on a USB Stick, helps me to not get my USB stick infected when I have to use it (in an internet cafe) with maleware infected computers?


It may or may not help you.  If you can reboot the cafe computer to boot off your USB stick you're probably more protected than not.  However if you're sticking a USB stick into a cafe computer running its, most likely, infected OS it won't make a difference if you have Linux installed on the stick or not unless your install, or at least home directory, is encrypted.  In that case though even you wouldn't be able to access the wallet.dat file haha.  So the whole putting Linux on a USB stick to protect your wallet.dat file only works if you can boot off the USB stick.

IMHO putting a wallet.dat file onto a cafe computer is very dangerous because you never know what has been done to them.  For example hardware key loggers can sit between the keyboard and the computer and then it doesn't matter what OS or security you're using.  That doesn't get them your private key per se but it's a step closer.  Basically once you expose your wallet.dat and your passphrase (to send money) in an unknown computer your taking a risk.  Maybe not always a big one but a risk none the less.

There's no reason you can't have another wallet with a very very small amount of coins in it for cafe use.  Just assume it's like cash in your pocket that could be lost or stolen.  Load it up before you leave your home and empty what you haven't spent when you get home again.


Offline arcke

  • Full Member
  • ***
  • Posts: 115
    • View Profile
    • Diaspora
Waoh that was accurate :)

...so I have to replace the originally stored wallet.dat file with the one that was recently used (by the client) every 100 (or less) transactions?

...so storing my wallet.dat file, alongside with an installed client within a Linux environment on a USB Stick, helps me to not get my USB stick infected when I have to use it (in an internet cafe) with maleware infected computers?
I choose not to type my passphrase on a public computer. This is one part of wallet security. When there is malware on a public computer it might be logging keys and the passphrase gets stolen.
OpenPGP: 0x22d7e9cc35375665
PTS - PawnbhoiXhmkrKJEPAsCiwkpP81nRXJGTD
Diaspora profile - https://pod.orkz.net/u/arcke

Offline santaclause102

  • Hero Member
  • *****
  • Posts: 2486
    • View Profile
Waoh that was accurate :)

...so I have to replace the originally stored wallet.dat file with the one that was recently used (by the client) every 100 (or less) transactions?

...so storing my wallet.dat file, alongside with an installed client within a Linux environment on a USB Stick, helps me to not get my USB stick infected when I have to use it (in an internet cafe) with maleware infected computers?

Offline Riverhead

So is it true that the wallet.dat file contains your public and your private key as well as the encryption you used? <- I am thinking that because you said the only thing that has to be done is to encrypt wallet (within the client) and then only safe the wallet.dat file. So the encryption must be stored in the wallet.dat file?

The wallet.dat file contains everything specific to the addresses you claim as yours.  The public/private key pairs, some transaction information, etc.  It is encrypted using your passphrase.  What the wallet.dat file specifically contains and how it is encrypted (using I believe AES-256-CBC) is well documented elsewhere.  The important takeaway from this thread is that the wallet.dat file is all you need.  Everything else is generic software that everyone has.

Also if I rename the wallet.da file I would have to re-rename it to "wallet.dat" again when I want to do a transaction with it, right?

Yes.  The renaiming is only for your personal reference.  The client looks for a wallet.at file in the specific location (%AppData%/Protoshares for example) and creates one if it doesn't find one.  When restoring your wallet from your pts_wallet.dat backup you'd need to rename it back to wallet.dat for the client to recognize and load it.
After having done a transaction there is nothing that changed within the wallet.dat file, right (its still just the public and the private key and the encryption)? So I don't have to replace this wallet.dat file that I just used with the one that I originally made a copy of, right?

The wallet.dat file holds a bit more information than that however the most import part, you are correct, is the public/private key pool.  This pool has a default of 100 key pairs and gets another 100 added once they are used up.

My solution would look like this: I have one Computer with a hot wallet for daily transactions. From this wallet I send all the PTS/Coins I want to store to an address that is generated by a client on a computer with a fresh OS (this Computer has no other function; surely maleware free). Then I encrypt this wallet and safe only the wallet.dat file on a USB Stick that is encryped with TrueCrypt.
When I want to use coins I copy the wallet.dat file on the USB stick to the maleware free computer  (to appdata/protoshares) and send my coins either to the hot wallet address or directly to whoever I want to send coins to... Then I erase the wallet.dat file on the maleware free computer again without saving it.

This works well.  Just keep in mind that unless you send ALL your coins from your address the coins you do not send get returned to a hidden change address.  So if your "fresh os" wallet has 100 PTS and you send 10 PTS to another address the remaining 90 PTS will get sent to a Change Address in your wallet - burning one of the 100 pub/priv keys in your pool.  It's for this reason you need to refresh your backups every 100 transactions.

I am pretty sure I doent have maleware on my laptop because no coins have been stolen yet. But by the solution with the additional computer that has a fresh OS I can make sure that I dont copy and maleware onto the USB where I also safe my wallet.dat. Does that make sense ?!  :o

Any flaws in there?

Other people suggest to install an OS (Linux) on an USB Stick. What advantage would that have?

Sounds like you have a good strategy.  The one nice thing about Linux on a USB stick is that you can pretty much boot it with any computer and have access to an already downloaded blockchain, client, etc. in a malware/virus free environment.  The client AES-256-CBC encryption for the wallet.dat is pretty good, especially if you use a good pass phrase, so you don't need to get too paranoid :).

« Last Edit: January 05, 2014, 03:45:05 pm by Riverhead »

Offline Riverhead

Riverhead that was a nice summary :) Thanks! But it didnt answer any of my questions (specifically):)

Your post wasn't there when I started mine :).  I'll read yours and reply shortly.

Offline santaclause102

  • Hero Member
  • *****
  • Posts: 2486
    • View Profile
Riverhead that was a nice summary :) Thanks! But it didnt answer any of my questions (specifically):)

Offline Riverhead


The quickest, safest, and easiest way to make sure you backup all you need is to follow these simple steps:

0) Make sure your wallet is encrypted!  This should have already been done anyway so it's step 0 :).

1) Shut down your client

2) Find your wallet.dat file (in %AppData%/Protoshares or /home/<user>/.protoshares)

3) Copy your wallet.dat to another location and called it pts_wallet.dat or something similar so you don't confuse it with your XYZcoin.dat wallets.  For example I have pts_wallet.dat, ftc_wallet.dat, ltc_wallet.dat, btc_wallet.dat, etc. etc.).

4) Put the USB stick or whatever you copied it to in another physical location (in a drawer at work and/or home, your garage, etc.).  Somewhere that can be accessed if one location burns to the ground, gets wiped out by a plague of locus, etc.

5) Restart the client.

6) Rinse and repeat about every 100 transactions to make sure your backups have all your latest change address key pairs.

Depending on your level of trust in online storage solutions you could rename the pts_wallet.dat file to something like mittens.jpg and put it in the pictures folder of your Google Drive or other service.  Since it's encrypted it's reasonable safe from theft (though technically not totally safe) and renaming the file would save you from quick scans by someone who hacks an online storage site and scans for wallet.dat files.

The wallets are really really small.  On most $10 USB sticks now you could even back up the entire blockchain if you wanted to save yourself the time of downloading it again in the future but it's not required.  Your wallet.dat file is like your SIM card in your phone.  Everything else is generic software.


Offline santaclause102

  • Hero Member
  • *****
  • Posts: 2486
    • View Profile
So is it true that the wallet.dat file contains your public and your private key as well as the encryption you used? <- I am thinking that because you said the only thing that has to be done is to encrypt wallet (within the client) and then only safe the wallet.dat file. So the encryption must be stored in the wallet.dat file?

Also if I rename the wallet.da file I would have to re-rename it to "wallet.dat" again when I want to do a transaction with it, right?

After having done a transaction there is nothing that changed within the wallet.dat file, right (its still just the public and the private key and the encryption)? So I don't have to replace this wallet.dat file that I just used with the one that I originally made a copy of, right?

My solution would look like this: I have one Computer with a hot wallet for daily transactions. From this wallet I send all the PTS/Coins I want to store to an address that is generated by a client on a computer with a fresh OS (this Computer has no other function; surely maleware free). Then I encrypt this wallet and safe only the wallet.dat file on a USB Stick that is encryped with TrueCrypt.
When I want to use coins I copy the wallet.dat file on the USB stick to the maleware free computer  (to appdata/protoshares) and send my coins either to the hot wallet address or directly to whoever I want to send coins to... Then I erase the wallet.dat file on the maleware free computer again without saving it.

I am pretty sure I doent have maleware on my laptop because no coins have been stolen yet. But by the solution with the additional computer that has a fresh OS I can make sure that I dont copy and maleware onto the USB where I also safe my wallet.dat. Does that make sense ?!  :o

Any flaws in there?

Other people suggest to install an OS (Linux) on an USB Stick. What advantage would that have?

Offline MrJeans

  • Hero Member
  • *****
  • Posts: 599
    • View Profile
  • BitShares: mrjeans
Can someone link to the process of entirely restoring your address and private key in a new wallet from an encrypted wallet.dat backup?
So for mac you would download the client, allow it to sync. Then enable viewing of hidden files.
Then look for your .protoshares folder. This may be under your user name.
Open the .protoshares folder. Make sure the protoshares client shows 0 protoshares in the wallet. Delete the wallet.dat file in there (provided its a wallet you not using)!!!!
And replace the wallet.dat file with your encrypted wallet.

Offline renkcub

  • Full Member
  • ***
  • Posts: 143
    • View Profile
Can someone link to the process of entirely restoring your address and private key in a new wallet from an encrypted wallet.dat backup?

Offline pvaladares

  • Full Member
  • ***
  • Posts: 100
    • View Profile
You may print your Private Key in a paper and keep it in a safe.
PTS : PkbJAm9uxuGgC9n2NVwWYs8bvX3Mj8uAg3 | MMC : M91vp33SSVBG7N3X9CbrgMcwSBxTDQeDAb
BTC : 1CrAkkYZrVCnwDKSBw3bcnMSYMakEhfB6N
Trade BTC/PTS @ cryptsy.com

Offline danielauhlig

  • Jr. Member
  • **
  • Posts: 35
    • View Profile
is there anyway to create a paper wallet and just get them off the computer all together?