Bitcoin Forum
May 09, 2024, 04:07:22 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin Wallet. Taking it from one place to another.  (Read 5036 times)
RyanRed (OP)
Full Member
***
Offline Offline

Activity: 126
Merit: 100



View Profile
October 04, 2012, 07:46:35 PM
 #1

Hello Smiley

I just had a quick question on how the wallet operates. I'm about to take a trip for a week, and will be taking my wallet with me. My question is how exactly does a wallet operate? For intense: I backup my wallet as I normally do. I take my trip. During my trip I add a few funds to it. I come home, and restore the updated wallet.

But what happens if I don't restore the wallet? In other words, I load up my week old wallet, and try to receive or send some coin? I don't fully understand how this all works. Say I had 5 bitcoins to start with. Take my trip. Send those 5 coins away. Come home and load up the older copy still on my main PC. Will those 5 coins still show up in the older wallet? What happens if I try to send them? What happens if I add coins to the old wallet even after sending the coins away from the newer copy?

One last question (thanks for baring with me). What would happen if I had 2 instances of the wallet open at the same time in 2 different locations, and someone sends me 1 bitcoin. Would both wallets on the network receive the coin?

While I have no plans to keep both open, or to NOT restore my wallet when I get home. I just want to further my knowledge, and try to understand how different copies of the same wallet work.

Thanks for taking the time to read this!

-Ryan
1715227642
Hero Member
*
Offline Offline

Posts: 1715227642

View Profile Personal Message (Offline)

Ignore
1715227642
Reply with quote  #2

1715227642
Report to moderator
Activity + Trust + Earned Merit == The Most Recognized Users on Bitcointalk
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715227642
Hero Member
*
Offline Offline

Posts: 1715227642

View Profile Personal Message (Offline)

Ignore
1715227642
Reply with quote  #2

1715227642
Report to moderator
1715227642
Hero Member
*
Offline Offline

Posts: 1715227642

View Profile Personal Message (Offline)

Ignore
1715227642
Reply with quote  #2

1715227642
Report to moderator
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
October 04, 2012, 08:14:41 PM
 #2

Your wallet doesn't actually store any coins.  What is stored is identification numbers (addresses) that allow the wallet program to look in the blockchain to find out what value is associated with those addresses.  All the records of how much value is associated with each address is actually stored in the publicly shared blockchain.

So to answer some of your questions:

What would happen if I had 2 instances of the wallet open at the same time in 2 different locations, and someone sends me 1 bitcoin. Would both wallets on the network receive the coin?
Yes, both instances of the wallet would look at the blockchain and see the transaction there, so they would both show the additional coin.


I just had a quick question on how the wallet operates. I'm about to take a trip for a week, and will be taking my wallet with me. My question is how exactly does a wallet operate? For intense: I backup my wallet as I normally do. I take my trip. During my trip I add a few funds to it. I come home, and restore the updated wallet.
But what happens if I don't restore the wallet? In other words, I load up my week old wallet, and try to receive or send some coin?
This depends on how many new addresses were generated by your wallet prior to loading up the old copy.  By default the client pre-generates 100 addresses that it keeps hidden from you.  When it needs a new address it grabs one from this pre-generated list and generates a new one to add to the list.

So if you use less than 100 new addresses, then all the addresses you used will still be available in the old copy of the wallet.  All the coins will be seen there and accessible.

If you use more than 100 addresses, then any coins that were sent to addresses after the first 100 will not be visible in the old wallet since it won't have the private keys to look them up in the blockchain and they will therefore not be accessible.

I don't fully understand how this all works. Say I had 5 bitcoins to start with. Take my trip. Send those 5 coins away. Come home and load up the older copy still on my main PC. Will those 5 coins still show up in the older wallet?
No.  The older copy will use the addresses to look in the blockchain and see that those coins are gone.

What happens if I try to send them?
It will be seen as a double-spend attempt and the peers will not forward the transaction and the miners won't include it in any blocks.

What happens if I add coins to the old wallet even after sending the coins away from the newer copy?
Coins aren't added to wallets, they are added to addresses.  As long as the new wallet has the same addresses as the old one, any coins sent to addresses in the old wallet will be visible in the new wallet as well.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
October 04, 2012, 08:19:11 PM
 #3

The wallet is mostly just keys.  It keeps track of transactions and calculates your balance, but the money isn't in there.

If you expect less than 100 transactions while you are gone, this is pretty easy.  Stop your main client, copy the wallet.dat to the travel computer, edit your bitcoin.conf (on the travel computer) to set the keypoolsize=0, start the laptop (or whatever) and let it sync up.  Take your trip, when you get home, everything should already be shown on your home computer.  You should then be able to just delete the travel wallet.

Why this works is that your home computer has already generated 100 spare keys, and when you edit the keypoolsize on your laptop, you are telling it to NOT make any new keys, so every key it has available is still on your home computer (because you copied them over).  Each time you ask the client for a new key, or send a transaction, one key is used.  As long as you don't run out, you are fine.

It would be safer to save a copy of the travel wallet when you get home, by the way, just in case.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
BC12345
Newbie
*
Offline Offline

Activity: 57
Merit: 0


View Profile
October 04, 2012, 08:20:58 PM
Last edit: October 04, 2012, 08:39:23 PM by BC12345
 #4

This might be also good to know:

DO NOT encrypt your wallet AFTER you made your backups (if you do this you should update your backups and delete all old backups)! If you do this you risk losing some/all of your coins if you send a transaction with your encrypted wallet, should you ever need your backups.

Edit:
If you do it the way "kjj" suggested (set keypoolsize=0), I think you could encrypt your wallet after you made your backups.
Richy_T
Legendary
*
Offline Offline

Activity: 2436
Merit: 2121


1RichyTrEwPYjZSeAYxeiFBNnKC9UjC5k


View Profile
October 04, 2012, 08:29:14 PM
 #5

Also consider having multiple wallets. Just transfer funds between as needed.

1RichyTrEwPYjZSeAYxeiFBNnKC9UjC5k
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
October 04, 2012, 08:38:20 PM
 #6

This might be also good to know:

DO NOT encrypt your wallet AFTER you made your backups (if you do this you should update your backups and delete all old backups)! If you do this you risk losing some/all of your coins if you send a transaction with your encrypted wallet.

Edit:
If you do it the way "kjj" suggested (set keypoolsize=0), I think you could encrypt your wallet after you made your backups.

No, if you set the keypoolsize to zero, and then encrypt, you'll have NO available keys in the pool.  I'm not entirely sure where things go when that happens.  It probably re-uses keys then, but just don't do it, there is no need to.

The correct sequence is:

1) Encrypt
2) Backup (copy)
3) set keypoolsize

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
BC12345
Newbie
*
Offline Offline

Activity: 57
Merit: 0


View Profile
October 04, 2012, 08:54:47 PM
 #7

Also consider having multiple wallets. Just transfer funds between as needed.

I would do it this way.
franky1
Legendary
*
Offline Offline

Activity: 4214
Merit: 4475



View Profile
October 04, 2012, 09:12:06 PM
 #8

maybe wallet should actually be renamed addressbook or "safety deposit key". as thats a more accurate real world represesentation of the wallet.dat file

I DO NOT TRADE OR ACT AS ESCROW ON THIS FORUM EVER.
Please do your own research & respect what is written here as both opinion & information gleaned from experience. many people replying with insults but no on-topic content substance, automatically are 'facepalmed' and yawned at
RyanRed (OP)
Full Member
***
Offline Offline

Activity: 126
Merit: 100



View Profile
October 04, 2012, 09:37:09 PM
 #9

Thanks everyone! Everyone's reply was very helpful. While I knew the coins didn't actually get stored inside the .dat file, I was still very unware of how the mechanics worked. Thank for answering all my questions there! Smiley

The wallet is fairly new. Its only been on my main computer since I started it. I've encrypted it, and have a great system in place to reference my pass-phrase.

As for the idea of using different wallets per PC/Laptop, I like that idea, but I can also see it causing confusion later down the road. Maybe in 6 months or so. Get my .dat files mixed up or something. It would be easy to just uses different media sources per backup, but it still could cause simple user error in the long haul. Though, I think when dealing with something like this I would be extra careful, but I still can't always fore see simple user error in the future. For now. Keeping it as simple, and as linear as possible is a plus too me Smiley.  I will just keep my 1 wallet, and lock that baby down Smiley Keep a daily backup, and a weekly one that never leaves my house.

Again, thank you all for the very helpful information! Very appreciated!!

-Ryan
SistaS0uljah
Newbie
*
Offline Offline

Activity: 43
Merit: 0



View Profile
October 09, 2012, 09:00:21 PM
 #10

Thanks everyone! Everyone's reply was very helpful. While I knew the coins didn't actually get stored inside the .dat file, I was still very unware of how the mechanics worked. Thank for answering all my questions there! Smiley

The wallet is fairly new. Its only been on my main computer since I started it. I've encrypted it, and have a great system in place to reference my pass-phrase.

As for the idea of using different wallets per PC/Laptop, I like that idea, but I can also see it causing confusion later down the road. Maybe in 6 months or so. Get my .dat files mixed up or something. It would be easy to just uses different media sources per backup, but it still could cause simple user error in the long haul. Though, I think when dealing with something like this I would be extra careful, but I still can't always fore see simple user error in the future. For now. Keeping it as simple, and as linear as possible is a plus too me Smiley.  I will just keep my 1 wallet, and lock that baby down Smiley Keep a daily backup, and a weekly one that never leaves my house.

Again, thank you all for the very helpful information! Very appreciated!!

-Ryan
I install the bitcoin client on every computer I use (except for my work machines, which don't belong to me), and routinely transfer funds between them.  That way, I distribute my risk around multiple points of failure, so I can never lose my BTC.  And I always backup the wallets on each machine to both an external storage device and cloud storage, so if one or more machines die for any reason, I can restore the wallet to a different client.  Of course, all wallets are encrypted, so if any copy is stolen, the thief will find it worthless.
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
October 09, 2012, 10:57:07 PM
 #11

The wallet is fairly new. Its only been on my main computer since I started it. I've encrypted it, and have a great system in place to reference my pass-phrase.

As for the idea of using different wallets per PC/Laptop, I like that idea, but I can also see it causing confusion later down the road. Maybe in 6 months or so. Get my .dat files mixed up or something. It would be easy to just uses different media sources per backup, but it still could cause simple user error in the long haul. Though, I think when dealing with something like this I would be extra careful, but I still can't always fore see simple user error in the future. For now. Keeping it as simple, and as linear as possible is a plus too me Smiley.  I will just keep my 1 wallet, and lock that baby down Smiley Keep a daily backup, and a weekly one that never leaves my house.

I was thinking about a feature to import a wallet.dat that would merge keys from the imported wallet into the existing wallet.  That way, you could just copy your wallet, use it as usual on your laptop for a week or whatever, and when you get back, just merge it back in, sucking in any new keys that were created along the way.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
justusranvier
Legendary
*
Offline Offline

Activity: 1400
Merit: 1009



View Profile
October 09, 2012, 11:02:31 PM
 #12

https://bitcointalk.org/index.php?topic=81677.0
driver
Member
**
Offline Offline

Activity: 60
Merit: 10


View Profile
December 17, 2013, 01:05:20 AM
 #13

So an old thread but applies to what I need to know so I am reviving it .
 All this wallet stuff really confuses me and after trying several wallet clients i.e. multibit & bitcoin I still am not sure my coins will be safe from ME .
  Okay then I make a wallet in multibit on my online PC - 3 questions
  1. Is this wallet safe from hackers ?
  2. Can I simply copy/paste the 3 files for the wallet to my USB stick and then use this stick on my laptop to spend coins when I am not home i.e. at work ? ( the reason for this would be I want to be able to buy/sell coins while I am working so I do not miss out on the price swings that always happen when I am gone .
  3. If I copy to USB stick and delete the wallet.dat file on my main PC will I still have my coins ?

thanks in advance for your answers
GCInc.
Hero Member
*****
Offline Offline

Activity: 566
Merit: 500


View Profile WWW
December 17, 2013, 06:52:59 AM
 #14

If you use more than 100 addresses, then any coins that were sent to addresses after the first 100 will not be visible in the old wallet since it won't have the private keys to look them up in the blockchain and they will therefore not be accessible.

How to specify in bitcoin.conf (CentOs) how many addresses to store? Is there a performance drawback if you store, for instance 3000 addresses?

Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
December 18, 2013, 02:34:26 PM
 #15

I install the bitcoin client on every computer I use (except for my work machines, which don't belong to me), and routinely transfer funds between them.  That way, I distribute my risk around multiple points of failure, so I can never lose my BTC.  And I always backup the wallets on each machine to both an external storage device and cloud storage, so if one or more machines die for any reason, I can restore the wallet to a different client.  Of course, all wallets are encrypted, so if any copy is stolen, the thief will find it worthless.

Are they all encrypted with the same password Wink ?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
December 18, 2013, 08:29:19 PM
 #16

If you use more than 100 addresses, then any coins that were sent to addresses after the first 100 will not be visible in the old wallet since it won't have the private keys to look them up in the blockchain and they will therefore not be accessible.

How to specify in bitcoin.conf (CentOs) how many addresses to store? Is there a performance drawback if you store, for instance 3000 addresses?

A Google search:

http://lmgtfy.com/?q=bitcoin.conf+keypool+%22performance+issues%22+site%3Abitcointalk.org

Turns up this:

https://bitcointalk.org/index.php?topic=193586.msg2008037#msg2008037
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4653



View Profile
December 18, 2013, 08:33:43 PM
 #17

So an old thread but applies to what I need to know so I am reviving it .
 All this wallet stuff really confuses me and after trying several wallet clients i.e. multibit & bitcoin I still am not sure my coins will be safe from ME .
  Okay then I make a wallet in multibit on my online PC - 3 questions
  1. Is this wallet safe from hackers ?

That depends on how secure your "online PC" is, and how sure you are that you don't have any malware running on your "online PC".

  2. Can I simply copy/paste the 3 files for the wallet to my USB stick and then use this stick on my laptop to spend coins when I am not home i.e. at work ? ( the reason for this would be I want to be able to buy/sell coins while I am working so I do not miss out on the price swings that always happen when I am gone .

Which 3 files are you planning on copying?  If you copy the wrong files, then the answer is: No.

  3. If I copy to USB stick and delete the wallet.dat file on my main PC will I still have my coins ?

I don't think MultiBit has a file named wallet.dat.  Are you sure you know what you are asking?
driver
Member
**
Offline Offline

Activity: 60
Merit: 10


View Profile
December 18, 2013, 11:35:12 PM
 #18

sorry I meant if I deleted the file untitled .wallet off of my main PC would it still be working on my usb stick ? I am guessing yes since it is a backup copy .
 I just want the wallet only on usb and not on my pc for security reasons . Without having to put linux or something on my usb and boot from it as most instructions i have found tell to do

The wallet.dat was in another program . Multibit would be the untitled.wallet ....info ....data . In whatever other program I was using you just copied these to a USB stick but in Multibit I think I must create a new wallet on the usb stick and then export the keys to the new wallet . Is this correct ? 
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!