Author

Topic: Question about shared wallet (Read 536 times)

member
Activity: 301
Merit: 74
November 25, 2017, 11:38:09 PM
#8
So these addresses would also be automatically added to the visible "receive addresses" list?

If so, on HD wallets I guess it would automatically refill the keypool with the same keys as in the main wallet, check for any transactions on these new keys, and repeat until there are no more. Sounds convenient.

legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
November 25, 2017, 05:46:00 PM
#7
Was it implied here that Core watches for transactions for all pre-generated keypool addresses, even addresses that haven't become visible yet in the GUI?
Yes, that is correct. I've actually tested this when I had my backup-wallet running on another laptop for a while.

Quote
A comment to the OP:
Note that even if the balance updates properly, still the labels of the receive addresses won't magically appear in the other wallet instance.
This is quite annoying indeed.
member
Activity: 301
Merit: 74
November 25, 2017, 05:23:56 PM
#6
Was it implied here that Core watches for transactions for all pre-generated keypool addresses, even addresses that haven't become visible yet in the GUI?

A comment to the OP:
Note that even if the balance updates properly, still the labels of the receive addresses won't magically appear in the other wallet instance.



legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
November 22, 2017, 12:55:31 PM
#5
The Bitcoin Core wallet (and most other wallets) have this thing called the keypool. The keypool is just several (Bitcoin Core defaults to 1000) keys and their addresses that are pregenerated.
As far as I know, the default used to be 100 addresses, not 1000.

https://en.bitcoin.it/wiki/Running_Bitcoin :
Code:
-keypool= Set key pool size to (default: 100)

My current Bitcoin Core 0.15.1:
Code:
  -keypool=
       Set key pool size to (default: 1000)

It seems recent versions use a larger default keypool, but it's something to keep in mind in case you're running an older version.


Is there any command that will give me the amount of used keys from the keypool? I don't know if i have passed 1000 yet or not.
Click Help > Debug window > Console > enter getwalletinfo

Mine says:
Code:
"keypoolsize": 998,
The keypool gets refilled up to 1000 every time you unlock the wallet with your passphrase. My 998 means I've used 2 addresses since the last time I unlocked it.

Quote
What happens when you pass 1000 then? can I keep using the same wallet.dat file because it will automatically create another keypool inside the same file so it generates batches of 1000 each time you use 1000? how many keypools can be generated? Its not clear to me how this works. I never updated to HD wallet so im using the same old wallet.dat for ages, im worried in case there is any problems if I pass 1000 addresses.
Let's take my wallet as an example. If I make a backup now, my backup holds the private keys to 998 unused addresses.
My wallet has no problem creating more addresses, suppose I receive payments to 1200 new unique addresses. That will work just fine, my keypool gets refilled up to 1000 each time I unlock my wallet. But, all payments I receive to the last 202 addresses, won't be included in my current backup!

For this reason it's important to make a new backup once in a while. I do it often enough to be absolutely sure I don't get close to using the entire 1000 addresses in my keypool. (in reality I do it more like every 10 addresses already, you can never have enough backups)

Note that changing or setting a password also flushes your keypool (for security reasons), and requires you to make a new backup.
hero member
Activity: 672
Merit: 503
November 22, 2017, 12:39:07 PM
#4
If I copy my wallet.dat to another computer and generate new address on old computer and then send to new generated address 1 BTC,
will the wallet.dat on another computer be updated with new address and btc?

If yes - why its possible ?
It depends, depending on your wallet, you may not see the new address or the Bitcoin.

The Bitcoin Core wallet (and most other wallets) have this thing called the keypool. The keypool is just several (Bitcoin Core defaults to 1000) keys and their addresses that are pregenerated. When you get a new address, you are given a key from the keypool and a new key is generated and placed into the keypool. This is useful for encrypted wallets where you can get addresses and public keys without needing to decrypt your wallet first.

So if your wallet has a full keypool, then yes, you would see the new address and the Bitcoin on your other computer as it would see the transaction for a key in your keypool.

However your keypool may not be full. You could have taken all the keys from the keypool. If your wallet is not an HD wallet (so Bitcoin Core wallets made prior to Bitcoin Core 0.13.0), then once you have retrieved the keys from the keypool, all keys after that will not be the same (aka any newly generated keys are not the same). This is because they are randomly generated.

If your wallet is an HD wallet (Bitcoin Core wallets make with Bitcoin Core 0.13.0 and later) then you will be able to get the same keys after the keypool is exhausted. This is because the wallet generates keys in a deterministic manner from a given seed that is stored in the wallet. So you will generate the same keys when the keypool is refreshed.

Is there any command that will give me the amount of used keys from the keypool? I don't know if i have passed 1000 yet or not.

What happens when you pass 1000 then? can I keep using the same wallet.dat file because it will automatically create another keypool inside the same file so it generates batches of 1000 each time you use 1000? how many keypools can be generated? Its not clear to me how this works. I never updated to HD wallet so im using the same old wallet.dat for ages, im worried in case there is any problems if I pass 1000 addresses.
jr. member
Activity: 115
Merit: 2
November 18, 2017, 02:49:39 PM
#3
If I copy my wallet.dat to another computer and generate new address on old computer and then send to new generated address 1 BTC,
will the wallet.dat on another computer be updated with new address and btc?

If yes - why its possible ?
It depends, depending on your wallet, you may not see the new address or the Bitcoin.

The Bitcoin Core wallet (and most other wallets) have this thing called the keypool. The keypool is just several (Bitcoin Core defaults to 1000) keys and their addresses that are pregenerated. When you get a new address, you are given a key from the keypool and a new key is generated and placed into the keypool. This is useful for encrypted wallets where you can get addresses and public keys without needing to decrypt your wallet first.

So if your wallet has a full keypool, then yes, you would see the new address and the Bitcoin on your other computer as it would see the transaction for a key in your keypool.

However your keypool may not be full. You could have taken all the keys from the keypool. If your wallet is not an HD wallet (so Bitcoin Core wallets made prior to Bitcoin Core 0.13.0), then once you have retrieved the keys from the keypool, all keys after that will not be the same (aka any newly generated keys are not the same). This is because they are randomly generated.

If your wallet is an HD wallet (Bitcoin Core wallets make with Bitcoin Core 0.13.0 and later) then you will be able to get the same keys after the keypool is exhausted. This is because the wallet generates keys in a deterministic manner from a given seed that is stored in the wallet. So you will generate the same keys when the keypool is refreshed.

Thanks for explanation, yes I have Bitcoin Core - now that's clear for me
staff
Activity: 3458
Merit: 6793
Just writing some code
November 18, 2017, 02:45:18 PM
#2
If I copy my wallet.dat to another computer and generate new address on old computer and then send to new generated address 1 BTC,
will the wallet.dat on another computer be updated with new address and btc?

If yes - why its possible ?
It depends, depending on your wallet, you may not see the new address or the Bitcoin.

The Bitcoin Core wallet (and most other wallets) have this thing called the keypool. The keypool is just several (Bitcoin Core defaults to 1000) keys and their addresses that are pregenerated. When you get a new address, you are given a key from the keypool and a new key is generated and placed into the keypool. This is useful for encrypted wallets where you can get addresses and public keys without needing to decrypt your wallet first.

So if your wallet has a full keypool, then yes, you would see the new address and the Bitcoin on your other computer as it would see the transaction for a key in your keypool.

However your keypool may not be full. You could have taken all the keys from the keypool. If your wallet is not an HD wallet (so Bitcoin Core wallets made prior to Bitcoin Core 0.13.0), then once you have retrieved the keys from the keypool, all keys after that will not be the same (aka any newly generated keys are not the same). This is because they are randomly generated.

If your wallet is an HD wallet (Bitcoin Core wallets make with Bitcoin Core 0.13.0 and later) then you will be able to get the same keys after the keypool is exhausted. This is because the wallet generates keys in a deterministic manner from a given seed that is stored in the wallet. So you will generate the same keys when the keypool is refreshed.
jr. member
Activity: 115
Merit: 2
November 18, 2017, 02:20:10 PM
#1
If I copy my wallet.dat to another computer and generate new address on old computer and then send to new generated address 1 BTC,
will the wallet.dat on another computer be updated with new address and btc?

If yes - why its possible ?
Jump to: