Bitcoin Forum
December 13, 2024, 05:10:29 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: new backup of wallet.dat every transaction?  (Read 792 times)
MinerP (OP)
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
May 05, 2014, 10:30:10 AM
 #1

do i need to make a new backup of a wallet.dat file after every transaction?

for example, lets say i have saved my wallet.dat on a usb, the next day i make a few deposits as well a withdrawl and then the hard drive crashes erases all files... will i be able to retrieve my account from the wallet.dat file that was saved prior to my transactions? 
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1540


No I dont escrow anymore.


View Profile
May 05, 2014, 11:23:19 AM
 #2

do i need to make a new backup of a wallet.dat file after every transaction?

for example, lets say i have saved my wallet.dat on a usb, the next day i make a few deposits as well a withdrawl and then the hard drive crashes erases all files... will i be able to retrieve my account from the wallet.dat file that was saved prior to my transactions? 

Assuming this is about bitcoin core wallets:

Your initial wallet comes with 100 addresses. As long as you dont generate the 101st you dont have to make another backup, you can still access all your funds, even if the old wallet did not "create" the address #42 yet. The incomming transaction will look a bit funny (grey) in the front end, but you can still spend the coins. On the other hand more than one backup can help because you will "survive" several failing backups. E.g. usb stick broken, flash card burned, hard disk crashed, but you still have an encrypted file on the old laptop of your good friend X.

Im not really here, its just your imagination.
OnkelPaul
Legendary
*
Offline Offline

Activity: 1039
Merit: 1005



View Profile
May 05, 2014, 11:38:49 AM
 #3

If I understand correctly, the bitcoin-qt wallet always keeps 100 unused addresses with their public and private keys in the wallet.dat file, so you can perform up to 100 transactions without backing up the wallet.dat file in between and you will still be able to access the funds in the wallet when you recovered it from the last backup.
As anything that can go wrong will go wrong eventually, it is wise to make a backup at least around every 30 transactions. If you make regular backups of your data anyway (which is highly recommended) and you don't generate huge numbers of transactions, your wallet should be safe enough with your normal backups. Otherwise you should save a backup copy every 30-40 transactions so even if the last backup turns out to be unusable the second-to-last backup still covers your new transactions.

Onkel Paul

Light
Hero Member
*****
Offline Offline

Activity: 742
Merit: 502


Circa 2010


View Profile
May 05, 2014, 11:48:43 AM
 #4

If I understand correctly, the bitcoin-qt wallet always keeps 100 unused addresses with their public and private keys in the wallet.dat file, so you can perform up to 100 transactions without backing up the wallet.dat file in between and you will still be able to access the funds in the wallet when you recovered it from the last backup.

This is correct. As the private keys are non-deterministic it is necessary to back them up at least every 100 txs as new ones are generated which have no correlation with the past.

My advice if you're looking for a secure client would be Electrum - memorising a 12 word seed or encrypting a copy and storing it is easier and safer than having to remember to back up every 100 txs and then label the wallets accordingly. Not to mention if you somehow lose access to your newest backup you may be in a bit of strife.
MinerP (OP)
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
May 05, 2014, 11:58:32 AM
 #5

If I understand correctly, the bitcoin-qt wallet always keeps 100 unused addresses with their public and private keys in the wallet.dat file, so you can perform up to 100 transactions without backing up the wallet.dat file in between and you will still be able to access the funds in the wallet when you recovered it from the last backup.

This is correct. As the private keys are non-deterministic it is necessary to back them up at least every 100 txs as new ones are generated which have no correlation with the past.

My advice if you're looking for a secure client would be Electrum - memorising a 12 word seed or encrypting a copy and storing it is easier and safer than having to remember to back up every 100 txs and then label the wallets accordingly. Not to mention if you somehow lose access to your newest backup you may be in a bit of strife.
is it safe to say 100txs is the standard for alt coins as well?
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1540


No I dont escrow anymore.


View Profile
May 05, 2014, 12:33:14 PM
 #6

If I understand correctly, the bitcoin-qt wallet always keeps 100 unused addresses with their public and private keys in the wallet.dat file, so you can perform up to 100 transactions without backing up the wallet.dat file in between and you will still be able to access the funds in the wallet when you recovered it from the last backup.

This is correct. As the private keys are non-deterministic it is necessary to back them up at least every 100 txs as new ones are generated which have no correlation with the past.
-snip-

I cant quite follow this in the code, can you point me in the right direction?

Here is what happens when I send coins. https://dev.visucore.com/bitcoin/doxygen/class_send_coins_dialog.html#a2cab7cf9ea5040b9e2189297f7d3c764
There is "::newPossibleKeyChange", but it newer calls "GenerateNewKey()" https://github.com/bitcoin/bitcoin/search?q=GenerateNewKey%28%29

Which as far as I understand the code, is what makes a new key.

Im not really here, its just your imagination.
BookLover
Hero Member
*****
Offline Offline

Activity: 533
Merit: 500


^Bitcoin Library of Congress.


View Profile
May 05, 2014, 07:02:16 PM
 #7

You can change the number of addresses in the keypool with the -keypool="number_of_keys" option or by adding keypool="number_of_keys" to your bitcoin.conf file.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!