Pages:
Author

Topic: You never backuped your wallet.dat? (Read 2312 times)

newbie
Activity: 15
Merit: 0
September 02, 2012, 03:29:51 AM
#34
i never backup the wallet before.. but i backup entirely computer every day heh
legendary
Activity: 1610
Merit: 1004
September 01, 2012, 07:37:06 PM
#33
i just backed up my wallet.dat - i do not deserve to lose my BTC!

however i intend to store some of my future bitcoin wealth in a brainwallet. 
donator
Activity: 2772
Merit: 1019
September 01, 2012, 04:03:00 PM
#32
A useful feature would be for the wallet/client to record the last address backed up and warn the user when they are down to say less than 10 new addresses remaining in the last backup.

Not necessary. According to freewil (see my above post: https://bitcointalksearch.org/topic/m.1151980), the keypool is constantly being refreshed to contain unused keys (unless the wallet is kept in a locked state). Since the wallet is being unlocked when you get a new address, the suggested warning should never be displayed.

I think you misunderstand.

"less than 10 new addresses remaining in the last backup"

I am not saying warn the user once the keypool has less than 10 addresses (which will likely never happen).
I am saying warn the user when less than 10 addresses existing in the keypool which are also recorded in the last backup.

If the client records in the wallet the newest key in the keypool at the time of the last backup it can know at any time how many more keys can be used before the backup is out of date.

oops, you're right. I read too fast. Sorry 'bout that.

This is a good idea!
sr. member
Activity: 476
Merit: 250
Tangible Cryptography LLC
September 01, 2012, 04:00:52 PM
#31
A useful feature would be for the wallet/client to record the last address backed up and warn the user when they are down to say less than 10 new addresses remaining in the last backup.

Not necessary. According to freewil (see my above post: https://bitcointalksearch.org/topic/m.1151980), the keypool is constantly being refreshed to contain unused keys (unless the wallet is kept in a locked state). Since the wallet is being unlocked when you get a new address, the suggested warning should never be displayed.

I think you misunderstand.

"less than 10 new addresses remaining in the last backup"

I am not saying warn the user once the keypool has less than 10 addresses (which will likely never happen).
I am saying warn the user when less than 10 addresses existing in the keypool which are also recorded in the last backup.

If the client records in the wallet file, the "newest" (last to be used) key in the keypool at the time of the last backup, then the client will know how many more new keys can be used before the backup is out of date.
donator
Activity: 2772
Merit: 1019
September 01, 2012, 03:52:28 PM
#30
A useful feature would be for the wallet/client to record the last address backed up and warn the user when they are down to say less than 10 new addresses remaining in the last backup.

Not necessary. According to freewil (see my above post: https://bitcointalksearch.org/topic/m.1151980), the keypool is constantly being refreshed to contain unused keys (unless the wallet is kept in a locked state). Since the wallet is being unlocked when you get a new address, the suggested warning should never be displayed.
legendary
Activity: 1232
Merit: 1001
September 01, 2012, 03:40:01 PM
#29
TangibleCryptography, thanks from me too.

You have helped a lot.
newbie
Activity: 45
Merit: 0
September 01, 2012, 03:00:12 PM
#28
Now everything is clearer, many thanks TangibleCryptography!
hero member
Activity: 616
Merit: 500
September 01, 2012, 11:06:57 AM
#27
Thanks for the great explanations TangibleCryptography. Also, thank for creating the FastCash4Bitcoins website. While I have not specifically used your services yet, it seems like it'll be the easiest way to 'cash out'.

 Grin
sr. member
Activity: 476
Merit: 250
Tangible Cryptography LLC
September 01, 2012, 09:47:16 AM
#26
One last thing.  The keypool is by default "the next 100 keys".  You can change the size of the keypool but only from the command line.

Code:
bitcoin -keypool=300

will change the keypool to the next 300 keys.  It does take some time to generate the keys so if you pick a larger number and the computer seems like it is "frozen" just wait. It will generate enough keys to expand the keypool and launch the client.  Once you change the size of the keypool you can start the client "normally" after that.  Don't go crazy though.  If you use a hundred or so keys per week making your keypool 3,000 keys is probably overkill but maybe 300 gives you a larger margin of error.

Also the keys obviously do take up some space so your wallet.dat and backups will be larger but in todays age of TB sized drives the increased space in minimal.
Even with a keypool of 3,600 keys and months worth of tx data (involving thousands of txs) our company wallet.dat is ~8MB.
sr. member
Activity: 476
Merit: 250
Tangible Cryptography LLC
September 01, 2012, 09:33:48 AM
#25
So if I backup my wallet everytime I revived BTC to a new andress I'm good?

Maybe not.  You also use new keys every time you SEND coins to a new address.  You also use a new key everytime you click NEW ADDRESS even if you never use it.
Now you don't need to backup after every tx (although it won't hurt).  The wallet has a "keypool" which by default has the next 100 addresses you will use.

So hypothetically you could:
make a backup
send our 20 tx (20 new addresses used for change)
receive 500 tx TO existing addresses (0 new addresses used)
click the [New Address] button 30 times for no reason (30 new addresses used)
send out another 30 tx (30 new addresses used for change)

and your backup would still be good for the next 20 new addresses.

Now it is unlikely and probably not important to keep track of every address you use.  If you on average use 50 new addresses a month and make a new backup every week you probably are fine.
If on the other hand you are running a business and generate 3,000 new addresses a week you probably should make the keypool larger and make backups once a day.

A useful feature would be for the wallet/client to record the last address backed up and warn the user when they are down to say less than 10 new addresses remaining in the last backup.


when do we know that we have ran out of keys?

You never run out of keys.  If your keypool is 100 keys (default) then your wallet will always contain the next 100 keys.  However your backup will become out of date after 101 tx involving a new key.
You should backup your wallet regularly to ensure that doesn't happen.

So, sending coins burns keys always? or only when sending to different addresses??

Technically not "always".   Bitcoin uses a concept of change.  If you have an unspent output worth 10 BTC and want to tx 1 BTC, Bitcoin can't just send 1 BTC (the reason why is probably beyond the scope of this thread so for right now just accept it can't).  Your client will SPEND 10 BTC.  The tx will have 2 outputs.  1 BTC to the person you are sending coins to and 9 BTC as CHANGE to a NEW UNUSED address from your keypool.  Hypothetically if you wanted to spend 10 BTC and had an input that would exactly 10 BTC there is no change.  It doesn't matter if it is the first time you are sending to/from a particular address or not.  A change address will almost always be used.

It probably is simpler to just assume all SENDS use 1 key (even if technically not correct).  At worst you are just slightly too conservative.  

Since the wallet provides no mechanism to easily determine how many keys in the keypool are in the last backup really you should use this as a rule of thumb.

If you look at your tx volume and in one week have
a) generated 5 new addresses
b) SENT 15 outgoing tx
c) remember incoming tx don't use new addresses unless they involve "a".

then you have used ~20 new keys per week.  Your backup will be good for ~5 weeks.  To be conservative I would back it up at least twice a month (or weekly).  With that kind of tx volume daily or hourly backups are probably overkill.

On the other hand our company cold wallet generates a new address for EVERY tx.  In one week we have about 500 incoming tx and about 50 outgong tx.  A keypool of 100 is insufficient and would leave us at risk of losing coins.  We use a keypool of 3,000 (warning very large keypools can take a long time to generate the first time) which means the backup is probably good for ~7 to 10 days and then combine that with daily automated backups.

full member
Activity: 136
Merit: 100
September 01, 2012, 09:16:41 AM
#24
I consider myself a little more experienced bitcoin user, so I backup my wallets regularly and I also have securely stored a lot of private keys for addresses.   Cool
legendary
Activity: 916
Merit: 1003
September 01, 2012, 07:40:06 AM
#23
donator
Activity: 2772
Merit: 1019
September 01, 2012, 07:34:58 AM
#22
when do we know that we have ran out of keys?


too lazy to google, I asked on irc:

Quote from: #bitcoin-dev
Is there a way to check how many unused keys are in the keypool?
molecular, from my understanding you should always have keypoolsize unused keys
unless your wallet is locked
in which case it wont generate more keys until it's unlocked
bitcoind getinfo has "keypoolsize" and "keypoololdest"
freewil, allright, thanks for the info
you're welcome

makes sense. I guess this clears up many questions here.

donator
Activity: 2772
Merit: 1019
September 01, 2012, 06:38:57 AM
#21
i'm surprised the client itself doesn't ask you to backup your wallet when it first runs.

It stupid how they oversimplified to a point where the product is IMO defective (how many new computer semi literate people can be bothered to unhide their files and backup that wallet?)

What? There's a menu item to back up your wallet (File -> Backup Wallet)
donator
Activity: 2772
Merit: 1019
September 01, 2012, 06:37:54 AM
#20
You need to backup it before you put money into it. And then backup it when you create new address in it.

addresses are pre-generated (default 100?)
legendary
Activity: 1232
Merit: 1001
September 01, 2012, 06:32:56 AM
#19
So if I backup my wallet everytime I revived BTC to a new andress I'm good?
sr. member
Activity: 389
Merit: 250
September 01, 2012, 06:24:13 AM
#18
when do we know that we have ran out of keys?
newbie
Activity: 25
Merit: 0
September 01, 2012, 06:03:37 AM
#17
Nice thread, great for the learning process of this newbie
Quote
So, sending coins burns keys always? or only when sending to different addresses??
I can't answer theoretical, but I did some wild transfer testing between different wallets. Sometimes it was send with new addresses and sometimes it was send with the same address the bitcoins arrived at in the first place. It is very difficult to follow what happens in the client, because you (at least I am) not able to see the addresses which are used in the client for sending. I needed to use blockchain.info to figure out which sending adresses happened to be mine.

During the testing (12h ago) I created a wallet (I call it the mystery wallet) with one address (I call it the mystery address) and send some btc's to it (I call it the mystery transaction). The whole blockchain is already downloaded, but no coins  did arrive. If I look in blockchain.info the mystery transaction is plain visible as I made it. I send another testcoin which promptly arrives in the mystery adress in my mystery wallet. Can anybody shine some light on this mystery ?
newbie
Activity: 45
Merit: 0
September 01, 2012, 03:27:16 AM
#16
...

There is no difference.  The backup is a copy of the wallet.dat

In your example no second backup is necessary.  The satoshi client wallet file uses a concept of a "keypool".  By default the wallet keypool is 100 private keys.  So a backup contains all the used keys PLUS the next 100 keys.

Receiving coins to an existing address uses no keys.
Sending coins uses 1 new address/key for each send (change address).
Getting a new address from the wallet uses 1 new address/key (clicking new address button).

If your keypool is 100 then you are good for the next 100 new addresses/keys.  The tx involving the 101st address/key will be lost forever.

You can make the keypool as large as you want although anything over 1,000 addresses can take a while to generate.  IMHO the default keypool should likely be increased to 300 or 500.

So, sending coins burns keys always? or only when sending to different addresses??
hero member
Activity: 616
Merit: 500
August 31, 2012, 11:01:49 PM
#15
What is the relationship between a "regular" wallet and a "backup" file of the wallet?

for example.. I backup a wallet on 8/31 with 1btc in it. On 9/1 I receive 10btc (same addresses as the original wallet had) and on 9/5 the original file is lost but the backup is ok.

Would I still have the 11btc, or would I need to backup again after receiving that 10btc for it to be safe?

There is no difference.  The backup is a copy of the wallet.dat

In your example no second backup is necessary.  The satoshi client wallet file uses a concept of a "keypool".  By default the wallet keypool is 100 private keys.  So a backup contains all the used keys PLUS the next 100 keys.

Receiving coins to an existing address uses no keys.
Sending coins uses 1 new address/key for each send (change address).
Getting a new address from the wallet uses 1 new address/key (clicking new address button).

If your keypool is 100 then you are good for the next 100 new addresses/keys.  The tx involving the 101st address/key will be lost forever.

You can make the keypool as large as you want although anything over 1,000 addresses can take a while to generate.  IMHO the default keypool should likely be increased to 300 or 500.

Thanks for the great explanation!
Pages:
Jump to: