Bitcoin Forum
November 11, 2024, 10:52:05 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 3 »  All
  Print  
Author Topic: Wallets : backup, security and change  (Read 2507 times)
mad68 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
March 19, 2013, 02:11:18 PM
Last edit: March 20, 2013, 06:05:15 PM by mad68
 #1

Hi everyone !
I'm new in all bitcoin thing and I have a few questions.
I've first read about here and there but there are still a few things I'm not sure to understand correctly.
First thing is about backup:
1. From what I understood, if I make a backup of my wallet (wallet.dat) and later make some transactions, then I restore my backup, my wallet can be corrupted ? Since there are bitcoins that should not be there right ?
2. So the right thing to be done should be : restore backup before making any transaction, then backup again right ?
3. Can I make a paper backup of my wallet at blockchain.info, delete the address from blockchain.info, then restore my paper backup later, and everything will be as it was at the moment of the backup ?
Now about security :
4. Is online wallet blockchain.info safe ?
I actually like blockchain.info since it provides good API and iphone app, and of course, I can check my wallet from everywhere and not only my computer.
5. To add more security to blockchain.info, could I do this : If I have "a lot" of bitcoins on blockchain.info, I do the paper wallet thing from 3., is that good or useless or do you have something better ?
6. How can I make a paper wallet from my current address I have on my computer wallet ?

I guess that's it ^^ Thank you people for your help !
RodeoX
Legendary
*
Offline Offline

Activity: 3066
Merit: 1147


The revolution will be monetized!


View Profile
March 19, 2013, 02:19:50 PM
 #2

I recommend:

Downloading the newest client and transfer the bulk of your bit-wealth to it. If it is a lot, make several copies of the wallet.dat file and save them to USB sticks. Bury one in your backyard, keep one in your safety deposit box, etc. You might want to rename and encrypt a copy of the file then hide it online somewhere.
I would also transfer a smallish amount to an online wallet. Perhaps at an exchange like MtGox. This can be your easy to spend money.

The gospel according to Satoshi - https://bitcoin.org/bitcoin.pdf
Free bitcoin in ? - Stay tuned for this years Bitcoin hunt!
mad68 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
March 19, 2013, 02:54:28 PM
 #3

Ok, but let's take an example :
I make several copies, and put one into a safety box at the bank.
I will not go to the bank after every transaction I do right, same for the one buried in my backyard.
So now, If my backups from bank and backyard are 2 weeks old and I've made new transactions since, and if I lose all my other backups, how can I use my 2 weeks old backup ? Because there are not up to date, so what will happen if I restore one of them ? Will I be able to use my BTC ? Will I see the correct balance ? Or what's going on ?
Largo
Member
**
Offline Offline

Activity: 112
Merit: 10



View Profile
March 19, 2013, 03:37:34 PM
 #4

By default (Bitcoin-Qt client) your Backups will be valid for 100 outgoing transactions or for 100 x clicking new address button.
Or 50 outgoing transactions AND 50 x clicking new address button.
Since both of them will use one of the 100 pre generated addresses in your wallet.dat

You can increase this by using the following commandline:
bitcoin-qt.exe -keypool=1000
This will set the pool of pre generated keys to 1000, so your backup will last longer.

Just use some other wallet for daily transactions so you dont run out of pre generated addresses on your savings wallet.dat


Gabi
Legendary
*
Offline Offline

Activity: 1148
Merit: 1008


If you want to walk on water, get out of the boat


View Profile
March 19, 2013, 03:45:04 PM
 #5

1)
Quote
Since there are bitcoins that should not be there right ?
The wallet contains private keys, not "bitcoins". So no it doesn't get corrupted. It will show the updated value.
3)Yeah

4)Yes if you make backups of your blockchain.info wallet and if you use their browser extension so you don't get a hacked javascript
5)What about the paperwallet has another address? Like, you make a paperwallet with a new address and send the coins there from blockchain.info, so blockchain.info never saw that key
6)there are some softwares somewhere in the forum

Note: if you spend some of your bitcoins most clients will send the "change" (bitcoins not spent) to a NEW address. As Largo said, by default wallet.dat file has 100 hidden keys, so usually it is not a problem (unless you make for example 110 transactions and then you restore your old wallet.dat... surprise)
But if you make a paperwallet, then you spend some of the bitcoins on that address, most clients will send the change to another address. But the paperwallet, well, it of course is only 1 key

mad68 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
March 19, 2013, 04:40:49 PM
Last edit: March 19, 2013, 09:02:50 PM by mad68
 #6

Note: if you spend some of your bitcoins most clients will send the "change" (bitcoins not spent) to a NEW address. As Largo said, by default wallet.dat file has 100 hidden keys, so usually it is not a problem (unless you make for example 110 transactions and then you restore your old wallet.dat... surprise)
But if you make a paperwallet, then you spend some of the bitcoins on that address, most clients will send the change to another address. But the paperwallet, well, it of course is only 1 key

I'm a bit confused :S
From what you said, If I backup my wallet on a usb stick, then I spend some BTC, if I restore my backup, spent BTC will not be there (as it should be) since a digital backup is a backup of the entire wallet, not only one address.
But If I paper backup my wallet (so only one address), then I spend some BTC, if I restore my paper backup, spent BTC will still be there, is that what you are saying ?

But the paperwallet is just basically a private key right ? So that would mean the private key changes after every transaction I make, every BTC I spend ?
I made a try : on blockchain.info, I checked the private key of one of my addresses, I spent 0.001 BTC, then checked again the private key and it is still the same, so If I backup my private key before spending BTC, then delete the address and restore the private key (which is still the same), why would the amount of BTC different ? I don't get this point sorry :S

Or maybe why I don't understand is because of this most clients will send the change to another address, what change ?
Does that mean if you send for example 1.5 BTC from an address where there are 2 BTC, it actually sends 2BTC, then you receive .5 BTC back ? But not necessarily to the address you sent from ? I'm really confused ^^
mad68 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
March 19, 2013, 08:30:33 PM
Last edit: March 19, 2013, 09:00:37 PM by mad68
 #7

up for my last message Roll Eyes
And other questions:

7. I have trouble to understand the differences (if there are) between wallet (as wallet.dat) and addresses.
Because for example, I can take one of my adresses from blockchain.info with its private key, and add it to my armory wallet, then my address is inside of two wallets ?

8. Why wallet files differ from bitcoin client ? For example Armory wallet file will be .wallet, and Bitcoin client wallet file will be .dat, so I can not export from Armory and Import into Bitcoin.

Thank you guys for all your help !
Gabi
Legendary
*
Offline Offline

Activity: 1148
Merit: 1008


If you want to walk on water, get out of the boat


View Profile
March 19, 2013, 09:06:38 PM
 #8

Quote
But If I paper backup my wallet (so only one address), then I spend some BTC, if I restore my paper backup, spent BTC will still be there, is that what you are saying ?
No!
I am saying the opposite. You have 1 address, you receive some BTC. You spend some of these BTC to buy something. Most client will put the BTC you didn't spend on a NEW address, for anonimity purpose.

Quote
But the paperwallet is just basically a private key right ?
Yes

"change" in bitcoin world is the btc you don't spend when sending some.

I don't know about blockchain.info

Quote
7. I have trouble to understand the differences (if there are) between wallet (as wallet.dat) and addresses.
wallet.dat contain private keys. Each private key correspond to an address.

Quote
8. Why wallet files differ from bitcoin client ?
Easier for the different client's developers  Cheesy

mad68 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
March 19, 2013, 11:42:45 PM
 #9

I am saying the opposite. You have 1 address, you receive some BTC. You spend some of these BTC to buy something. Most client will put the BTC you didn't spend on a NEW address, for anonimity purpose.

Ok, so the change will be sent to a new address, but how the system knows that the new address has to belong to me and is automatically added to my wallet ?
And why is it recommended to don't keep BTC on an address that has been used to spend BTCs ? Why an address would not be safe anymore once you've spend BTC with oO ?
dimaz
Newbie
*
Offline Offline

Activity: 37
Merit: 0



View Profile
March 20, 2013, 02:07:03 AM
 #10

I cannot restore wallet, block index.dat corrupt
In the 0.7.2 and in 0.8.1
unknown45682
Newbie
*
Offline Offline

Activity: 15
Merit: 0


View Profile
March 20, 2013, 02:11:10 AM
 #11

I cannot restore wallet, block index.dat corrupt
In the 0.7.2 and in 0.8.1

Just delete the blkindex.dat file in the AppData folder or delete all the blockchain files and redownload the blockchain and it should be fine.
whitenight639
Full Member
***
Offline Offline

Activity: 154
Merit: 100



View Profile
March 20, 2013, 02:39:19 AM
 #12

I am saying the opposite. You have 1 address, you receive some BTC. You spend some of these BTC to buy something. Most client will put the BTC you didn't spend on a NEW address, for anonimity purpose.

Ok, so the change will be sent to a new address, but how the system knows that the new address has to belong to me and is automatically added to my wallet ?
And why is it recommended to don't keep BTC on an address that has been used to spend BTCs ? Why an address would not be safe anymore once you've spend BTC with oO ?

Think of it like this:

The blockchain is why when you restore back-ups you are "known to the system" because the wallet.dat will contain your public address and private keys, the public address will be matched up to one on the blockchain that has X balance and previous transactions. The blockchain is made of magic dust and is all around us, it is distrubuted on many computers / nodes and can be read by anyone.

I think the advice about not keeping money in a Bitcoin address you have previously used is for privacy reasons only.



Your wallet(.dat) can consist of many addresses, If you print out a bitcoin note then you are printing the private key to just one of those addresses (unless you print more notes).

The balance of that "printed" address (pub key / private key pair) is redeemed in full when you enter that private key into a clients or online wallet, you do not get the option of spending some of it until it has been redeemed because that private key is matched to a public key / address on the blockchain which indicated the balance of that address, this balance will be the same balance that funded that address before you printed it on paper. once it is redeemed into a client or online wallet you can then spend whatever fractions you like.


Does that make sense?

I might not be correct about the technical details but I think the effects are correct.




 

125uWc197UW5kM659m4uwEakxoNHzMKzwz
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4832



View Profile
March 20, 2013, 01:23:10 PM
 #13

- snip -
7. I have trouble to understand the differences (if there are) between wallet (as wallet.dat) and addresses.
Because for example, I can take one of my adresses from blockchain.info with its private key, and add it to my armory wallet, then my address is inside of two wallets ?

8. Why wallet files differ from bitcoin client ? For example Armory wallet file will be .wallet, and Bitcoin client wallet file will be .dat, so I can not export from Armory and Import into Bitcoin.
- snip -

Part of your confusion seems to be coming from the fact that you appear to be expecting all the wallets/clients to work the same way.  Each of the wallet programs (clients) works a bit differently, this is why there are multiple popular wallets.  Different people have different preferences.  So you either need to start by choosing one wallet to try and understand (and disregard the behaviors of the others), or you need to start by understanding what the differences are between the wallets before you try to understand how backing up and recovering works (since it is a bit different for each wallet).

mad68 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
March 20, 2013, 03:33:34 PM
 #14

Think of it like this:

The blockchain is why when you restore back-ups you are "known to the system" because the wallet.dat will contain your public address and private keys, the public address will be matched up to one on the blockchain that has X balance and previous transactions. The blockchain is made of magic dust and is all around us, it is distrubuted on many computers / nodes and can be read by anyone.

I think the advice about not keeping money in a Bitcoin address you have previously used is for privacy reasons only.

Your wallet(.dat) can consist of many addresses, If you print out a bitcoin note then you are printing the private key to just one of those addresses (unless you print more notes).

The balance of that "printed" address (pub key / private key pair) is redeemed in full when you enter that private key into a clients or online wallet, you do not get the option of spending some of it until it has been redeemed because that private key is matched to a public key / address on the blockchain which indicated the balance of that address, this balance will be the same balance that funded that address before you printed it on paper. once it is redeemed into a client or online wallet you can then spend whatever fractions you like.

Does that make sense?

Yes I understand !

Part of your confusion seems to be coming from the fact that you appear to be expecting all the wallets/clients to work the same way.  Each of the wallet programs (clients) works a bit differently, this is why there are multiple popular wallets.  Different people have different preferences.  So you either need to start by choosing one wallet to try and understand (and disregard the behaviors of the others), or you need to start by understanding what the differences are between the wallets before you try to understand how backing up and recovering works (since it is a bit different for each wallet).

Ok it's good now.

So basically, wallet does not keep BTC, only addresses do, and wallets are just containers for multiple addresses with total of all addresses's BTC.

And last thing I think is weird is about the change, when I spend some BTC from my address to another one, why can't it just send the exact amount of BTC ? Why does it have to send some more and send me back the change, on the same address or on a new one?
kerstone
Newbie
*
Offline Offline

Activity: 40
Merit: 0


View Profile
March 20, 2013, 05:02:40 PM
 #15

This supplied some good info. The change and the validity of backups was very helpful.
Thanx!
mad68 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
March 21, 2013, 03:00:34 PM
 #16

And last thing I think is weird is about the change, when I spend some BTC from my address to another one, why can't it just send the exact amount of BTC ? Why does it have to send some more and send me back the change, on the same address or on a new one?

I may have figured it out where comes the change from ! Tell me if i'm right :
1 address contains BTCs, but these BTCs come from many previous incoming transactions. And when you want to send BTCs to someone, you must pick BTCs from that previous transactions, but you can't take only a part of 1 previous transaction, you must take the entire BTCs from the previous transaction. So if it is more than what you need you will receive the change back.
Here is an example, let's say I made these previous transactions :
Incoming :
0.001 BTC
0.00025 BTC
0.00257243 BTC
0.01887694 BTC

And now I want to send 0.022 BTCs, so it will take these 4 previous transaction to reach the 0.022 I want to send, but the total of the 4 transactions is 0.02269937. Now you take that amount (0.02269937), you substrat 0.022 I want to send plus 0.0005 for the fees and the change is 0.00019937 which comes back to my wallet, on the same address or a different one according to the wallet I use. Tadaaa ?
sloper
Newbie
*
Offline Offline

Activity: 27
Merit: 0


View Profile
March 21, 2013, 03:11:09 PM
 #17

Is there any downside from using electrum as my only client?
mad68 (OP)
Newbie
*
Offline Offline

Activity: 33
Merit: 0


View Profile
March 21, 2013, 04:15:14 PM
 #18

Is there any downside from using electrum as my only client?

I'm using only Armory, I haven't tried any other except Bitcoin.org client. I like in Armory that you can get/add private key, which you can not with Bitcoin.org client (or I don't know how)
Gabi
Legendary
*
Offline Offline

Activity: 1148
Merit: 1008


If you want to walk on water, get out of the boat


View Profile
March 21, 2013, 04:59:23 PM
 #19

If you have 5 btc in an address and you buy something that cost 1btc, you only send 1btc. The client by default will then send the other 4btc to a new address, for anonimity reason. Note that this behaviour is not part of the bitcoin rules, is just a thing that some clients do. Other clients don't.

This is important to know because 1)almost no one know 2)if you put all your btc on the address of a paperwallet and then you spend a part of them, that paperwallet will become empty. And then if you later try to use that paperwallet... surprise!


DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4832



View Profile
March 21, 2013, 05:22:45 PM
 #20

- snip -
And now I want to send 0.022 BTCs, so it will take these 4 previous transaction to reach the 0.022 I want to send, but the total of the 4 transactions is 0.02269937. Now you take that amount (0.02269937), you substrat 0.022 I want to send plus 0.0005 for the fees and the change is 0.00019937 which comes back to my wallet, on the same address or a different one according to the wallet I use. Tadaaa ?

You got it!  Well explained.

Bitcoin doesn't actually store any "coins" anywhere.  The blockchain that every full node has a copy of has a list of every confirmed transaction that has ever occurred.  Each transaction is a reference to one or more "outputs" from previous transactions that are being used as "inputs" and one or more values that are being assigned to addresses as new "outputs".  There is no way to indicate a fraction of a previous output.  The transaction simply references the previous output, and anyone/everyone running the correct protocol recognizes this reference as being an indication that the entire output is being "spent".

The protocol checks to make sure that the total of the inputs is greater than or equal to the outputs (so you can't send more than you have). If the total of the outputs is less than the total of the inputs, that difference is what the miners take as fees when the transaction is added to a block.  So if you don't want all that extra value to all be taken by a miner as fees, then you need to send some of it back to yourself as a new output (either to a new address or an existing one).

Using a new address for the change every time increases both anonymity and security a bit.

Improved security:
There is currently no known way to determine someone's private key if you know their public key, but there is no guarantee that a weakness won't be discovered in the ECDSA algorithm at some time in the future.  When you receive bitcoins, you don't receive them at a public key, you receive them at a hash of a hash of the public key. The public key is first hashed with SHA-256, and that result is hashed with RIPEMD-160 to create a bitcoin address.  Since there is currently no known way to "reverse" either of those hashes, there is no way to determine what the public key is from a bitcoin address.  This means that serious weaknesses would have to be discovered almost simultaneously in ECDSA, SHA-256, and RIPEMD-160 for someone to be able to determine your private key from the bitcoin address that is publicly used in the output of a transaction and permanently stored in the blockchain.

When you send bitcoins, your wallet has to provide a signature for each of the previous outputs that are referenced as inputs.  This signature is intended to prove that you know the private key associated with the address that the previous output was set to, and that you therefor have the right to re-assign that value to some other address. If that was all that was provided, then nobody could verify the signature since they don't know the public key.  Therefore, as part of the requirements of the signature script in the bitcoin protocol, along with the signature your wallet also includes the public key associated with each address that inputs are associated with.  This means that the first time that you send bitcoins that were received at an address, that address becomes slightly less secure.  Since the public key is then permanently stored in the public blockchain, any other transactions that are received at that address are no longer protected by the SHA-256 and RIPEMD-160 hash.  It would only require a weakness to be discovered in ECDSA to steal your bitcoins.  If every output always goes to an address that has never previous been used, then you will never have bitcoins at an address that is not protected by SHA-256 and RIPEMD-160.  This is why it is recommended to use a new address for every output you receive (regardless of whether it is "change" or otherwise).

Improved anonymity:
Lets say Alfred sends me 10 bitcoins, and Bob sends me 20.  If I used a new address for each of those transactions, then Alfred knows I have at least 10 BTC (since he sent them), and Bob knows I have at least 20 (send he sent them), but neither Alfred nor Bob can tell that I have 30 BTC no matter how hard they look at the blockchain.

Now lets say I'm going to send 13 bitcoins to someone.

If my wallet creates a transaction that spends those 30 BTC and sends the 17 BTC of "change" back to one of the two existing addresses, then depending on which address the wallet uses, either Alfred or Bob can tell that I now have 17 BTC, and they can tell what address I just sent 13 BTC to.

If my wallet creates a transaction that spends those 30 BTC and sends the 17 BTC of "change" to a brand new address, then it is impossible to tell if I have 13 BTC sent as change, or 17 BTC sent as change, or no change at all because the full amount was used to send BTC to two other people.
Pages: [1] 2 3 »  All
  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!