Author

Topic: Mac OS X: Increase Bitcoin keypool (Read 2088 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
October 25, 2015, 01:43:58 PM
#20
It seems to go 1 over whenever it has to create new keys. I have noticed the same several times, but I dont know why. My assumption is that it expects a change address to be used with the next transaction and thus creates one more.
I'm pretty sure it is just bad counting. I think it fills the keypool until the specified index (number you entered) has a key. The problem is that it starts counting from 0, so when you get to say index 10000, the size is actually 10001.
copper member
Activity: 1498
Merit: 1528
No I dont escrow anymore.
October 25, 2015, 12:58:44 PM
#19
I ended up figuring this out by doing it within Bitcoin Core itself, instead of the OS X Terminal.

Just took a year Wink

These are the 3 steps I took:

1. I pulled down from the "Help" menu to "Debug Window", then clicked on the "Console" tab.

2. I typed in:
Code:
walletpassphrase "my password" 300
to unlock my wallet for 300 seconds.

3. I typed in:
Code:
keypoolrefill 10000
to increase the size of my keypool to 10000 addresses. It took a few minutes for it to complete the process.

Afterwards, to verify:
- I checked the size of my wallet.dat file in the OS X Finder, which had now increased to 4.4 MB.
- In Bitcoin Core's Debug Window, I typed in:
Code:
getwalletinfo
which confirmed my keypool size as 10001 addresses. (Where does it get that extra 1 address from, I wonder?)

Thanks for everyone's help! Smiley

It seems to go 1 over whenever it has to create new keys. I have noticed the same several times, but I dont know why. My assumption is that it expects a change address to be used with the next transaction and thus creates one more.
full member
Activity: 126
Merit: 100
October 25, 2015, 09:45:10 AM
#18
I ended up figuring this out by doing it within Bitcoin Core itself, instead of the OS X Terminal.

These are the 3 steps I took:

1. I pulled down from the "Help" menu to "Debug Window", then clicked on the "Console" tab.

2. I typed in:
Code:
walletpassphrase "my password" 300
to unlock my wallet for 300 seconds.

3. I typed in:
Code:
keypoolrefill 10000
to increase the size of my keypool to 10000 addresses. It took a few minutes for it to complete the process.

Afterwards, to verify:
- I checked the size of my wallet.dat file in the OS X Finder, which had now increased to 4.4 MB.
- In Bitcoin Core's Debug Window, I typed in:
Code:
getwalletinfo
which confirmed my keypool size as 10001 addresses. (Where does it get that extra 1 address from, I wonder?)

Thanks for everyone's help! Smiley
full member
Activity: 126
Merit: 100
October 22, 2014, 12:07:20 AM
#17
Oh wait, I just read this paragraph from https://en.bitcoin.it/wiki/Wallet_encryption

"When a wallet is encrypted, the passphrase is required to top up the keypool, thus, if the passphrase is rarely entered, it is possible that keypool might run out. In this case, the default key will be used as the target for payouts for mining, and calls to getnewaddress and getaccount address will return an error. In order to prevent such cases, the keypool is automatically refilled when walletpassphrase is called with a correct passphrase and when topupkeypool is called (while the wallet is unlocked). Note that the keypool continues to be topped up on various occasions when a new key from pool is used and the wallet is unlocked (or unencrypted)."

Okay, that seems like what is happening to me. My wallet is encrypted, but I rarely use my passphrase because I am just receiving Bitcoins at this point. So I suppose that I won't be able to really see what's going on until I enter my passphrase. I suppose that this is all the more reason to switch to a HD wallet!  Tongue
full member
Activity: 126
Merit: 100
October 22, 2014, 12:02:52 AM
#16
Bitcoin Core will tell you the size of the keypool through an RPC command, which you can also type in the debug->console window. Here you can see the result of me setting the default higher:


>getwalletinfo

{
"walletversion" : 60000,
"balance" : xx.xxxxxxxx,
"txcount" : xxx,
"keypoololdest" : 1308965703,
"keypoolsize" : 201
}



To have Bitcoin Core maintain a larger keypool size to future-proof wallet backups, you can increase the keypool size as an option in your Bitcoin configuration file. I have written a guide with an example configuration file which includes the keypool option - simply remove the comment "#" and change the setting from the default of 100. The "Bitcoin data directory" link there also takes you to documentation to locate your OS data directory.

If you want to use up the keypool, you can issue the "getrawchangeaddress" command as many times as you have addresses. Encrypting a wallet will also discard the keypool and generate a new one.

Thanks so much for your guidance. I ran the "getwalletinfo" command, and sure enough, my keypool size never increased yesterday when I ran the OS X Terminal command "bitcoin-qt -keypool=1000". No idea why it didn't work, but the "getwalletinfo" command confirmed to me that my keypoolsize was still at 101.

Then, I downloaded your sample configuration file -- thank you so much for creating this! I uncommented the keypool line and increased the number to 1000. I quit Bitcoin-QT, put the config file in the proper location (with the proper filename), and relaunched Bitcoin-QT. I created 4 new Receiving Addresses, then checked my keypoolsize with the "getwalletinfo" command, and it had not increased to 1000. Sad  Instead, it simply told me that my keypool size is 97, which was the number of new addresses deducted from the former keypool size of 101.

So I quit Bitcoin-QT, deleted the config file altogether, relaunched Bitcoin-QT, created 2 new receiving addresses, but now my keypool size number is down to 95. It's not refilling my keypool automatically! Isn't Bitcoin-QT always supposed to refill the keypool, and keep this number at 100 or 101? Now I'm losing my keypool altogether, and I don't think I did anything wrong. But now it seems like I don't have a keypool at all. Sad

Oh well, I'm clearly going to have to stop experimenting with all of this now. This is clearly waaay over my head, I can't figure it out, and I'm too nervous about making some change that is going to cause me to inadvertently lose my Bitcoins. It seems like I'm already on some path to destruction, because my keypool is no longer automatically refilling itself. So I'm going to stop now, and just make sure that I make backups every day. Now I don't have a auto-refilling keypool at all. Very sad. Sad  I wonder what will happen when it gets to 0?
legendary
Activity: 1512
Merit: 1036
October 21, 2014, 11:20:59 PM
#15
Bitcoin Core will tell you the size of the keypool through an RPC command, which you can also type in the debug->console window. Here you can see the result of me setting the default higher:


>getwalletinfo

{
"walletversion" : 60000,
"balance" : xx.xxxxxxxx,
"txcount" : xxx,
"keypoololdest" : 1308965703,
"keypoolsize" : 201
}



To have Bitcoin Core maintain a larger keypool size to future-proof wallet backups, you can increase the keypool size as an option in your Bitcoin configuration file. I have written a guide with an example configuration file which includes the keypool option - simply remove the comment "#" and change the setting from the default of 100. The "Bitcoin data directory" link there also takes you to documentation to locate your OS data directory.

If you want to use up the keypool, you can issue the "getrawchangeaddress" command as many times as you have addresses. Encrypting a wallet will also discard the keypool and generate a new one.
full member
Activity: 126
Merit: 100
October 21, 2014, 06:44:34 PM
#14
Thanks. Hmmm... I guess there's no way for me to tell what the size of my keypool is at the current moment. In the Finder, my wallet.dat file is the same size today that it was last week, so I'm assuming that my keypool never increased in size.  Sad
legendary
Activity: 4256
Merit: 1313
October 21, 2014, 11:26:42 AM
#13
I believe that pywallet should be able to do it with its "--dumpwallet" command.  That should dump the wallet.

If you do a

keypoolrefill 1000

and it returns blank, that indicates it was successful.  To me it should return a success message, perhaps with a count returned, but that is just me.

full member
Activity: 126
Merit: 100
October 20, 2014, 11:13:16 PM
#12
Actually, I should say that I THINK it worked. Is there any way for me to tell if I now have 1,000 addresses in my Bitcoin-QT keypool? Is there a different terminal command that I can run, which will list all the public addresses in my keypool??  Huh  If I see a list of 1,000 addresses, then I know for sure that it worked! Smiley
in the debug console:
keypoolrefill

it should list the size of the keypool

Thanks. Nope, typing that in just yielded an empty line as the result.
legendary
Activity: 2058
Merit: 1452
October 20, 2014, 10:22:51 PM
#11
Actually, I should say that I THINK it worked. Is there any way for me to tell if I now have 1,000 addresses in my Bitcoin-QT keypool? Is there a different terminal command that I can run, which will list all the public addresses in my keypool??  Huh  If I see a list of 1,000 addresses, then I know for sure that it worked! Smiley
in the debug console:
keypoolrefill

it should list the size of the keypool
legendary
Activity: 4522
Merit: 3426
October 20, 2014, 08:37:32 PM
#10
(LOL. And we wonder why "normal people" don't use Bitcoin yet. This is so many years away from being easy enough for the mainstream populace! Wink)

"normal people" don't need to change the size of the key pool or run their client from a command line.
full member
Activity: 126
Merit: 100
October 20, 2014, 07:33:47 PM
#9
Actually, I should say that I THINK it worked. Is there any way for me to tell if I now have 1,000 addresses in my Bitcoin-QT keypool? Is there a different terminal command that I can run, which will list all the public addresses in my keypool??  Huh  If I see a list of 1,000 addresses, then I know for sure that it worked! Smiley
full member
Activity: 126
Merit: 100
October 20, 2014, 07:29:39 PM
#8
Something like this in Terminal (I'll be by a Mac tomorrow but I think I got it):
Code:
./Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -keypool=1000

This is just the path to the applications folder and then to the binary runtime (the actual program) inside the application bundle.

This will launch Bitcoin, so you want to quit it prior to this command.


Ah, thanks so much!!! That worked, once I removed the period at the beginning of the path.

So, to summarize, I quit out of Bitcoin-Qt, then I launched OS X Terminal and typed:

/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -keypool=1000

And that did the trick!! Thank you so much!! Smiley Smiley Smiley
legendary
Activity: 4256
Merit: 1313
October 20, 2014, 07:22:19 PM
#7
This command:
bitcoin-qt -keypool=1000

Is if you are running Bitcoin from the command line (e.g. Terminal in OS x, or a shell in Linux).

You can edit the config file to increase it, see:
https://en.bitcoin.it/wiki/Running_Bitcoin

You can see the OS x directory and file you need to edit with the keypool=1000 command.

In the wiki the example shows:
#keypool=100

which means it is commented out. You can edit it to say:
keypool=1000

Thanks, I went into the OS X Terminal and typed in

bitcoin-qt -keypool=1000

but it returned the error message "command not found".

I don't feel comfortable creating & editing a config file. Would love to be able to just use the terminal command, but there seems to be no instructions anywhere on how to actually use these terminal commands.

(LOL. And we wonder why "normal people" don't use Bitcoin yet. This is so many years away from being easy enough for the mainstream populace! Wink)

I agree about ease of use issues.

Something like this in Terminal (I'll be by a Mac tomorrow but I think I got it):
Code:
./Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -keypool=1000


This is just the path to the applications folder and then to the binary runtime (the actual program) inside the application bundle.

This will launch Bitcoin, so you want to quit it prior to this command.

newbie
Activity: 7
Merit: 0
October 20, 2014, 07:17:53 PM
#6
This command:
bitcoin-qt -keypool=1000

Is if you are running Bitcoin from the command line (e.g. Terminal in OS x, or a shell in Linux).

You can edit the config file to increase it, see:
https://en.bitcoin.it/wiki/Running_Bitcoin

You can see the OS x directory and file you need to edit with the keypool=1000 command.

In the wiki the example shows:
#keypool=100

which means it is commented out. You can edit it to say:
keypool=1000

Thanks, I went into the OS X Terminal and typed in

bitcoin-qt -keypool=1000

but it returned the error message "command not found".

I don't feel comfortable creating & editing a config file. Would love to be able to just use the terminal command, but there seems to be no instructions anywhere on how to actually use these terminal commands.

(LOL. And we wonder why "normal people" don't use Bitcoin yet. This is so many years away from being easy enough for the mainstream populace! Wink)

You need to navigate to the directory bitcoin-qt is located in using the terminal before running the command.

More Complicated:
Otherwise for that command to work the moment you open the terminal, you need to edit your .bash_profile to include an EXPORT to the location where bitcoin-qt lives, that is if you want to be able to launch bitcoin-qt wherever you are in the terminal.

Just use 'cd' to get to where Bitcoin-qt lives then run the command
full member
Activity: 126
Merit: 100
October 20, 2014, 07:09:29 PM
#5
This command:
bitcoin-qt -keypool=1000

Is if you are running Bitcoin from the command line (e.g. Terminal in OS x, or a shell in Linux).

You can edit the config file to increase it, see:
https://en.bitcoin.it/wiki/Running_Bitcoin

You can see the OS x directory and file you need to edit with the keypool=1000 command.

In the wiki the example shows:
#keypool=100

which means it is commented out. You can edit it to say:
keypool=1000

Thanks, I went into the OS X Terminal and typed in

bitcoin-qt -keypool=1000

but it returned the error message "command not found".

I don't feel comfortable creating & editing a config file. Would love to be able to just use the terminal command, but there seems to be no instructions anywhere on how to actually use these terminal commands.

(LOL. And we wonder why "normal people" don't use Bitcoin yet. This is so many years away from being easy enough for the mainstream populace! Wink)
legendary
Activity: 4256
Merit: 1313
October 20, 2014, 07:03:52 PM
#4
This command:
bitcoin-qt -keypool=1000

Is if you are running Bitcoin from the command line (e.g. Terminal in OS x, or a shell in Linux).

You can edit the config file to increase it, see:
https://en.bitcoin.it/wiki/Running_Bitcoin

You can see the OS x directory and file you need to edit with the keypool=1000 command.

In the wiki the example shows:
#keypool=100

which means it is commented out. You can edit it to say:
keypool=1000
full member
Activity: 126
Merit: 100
October 20, 2014, 07:01:12 PM
#3
Is there a reason why you need to be using QT specifically? There are a number of other clients that do not "lose" your private keys after the keypool is "used up"

multibit and/or blockchain.info might be good alternatives if you want a larger keypool (the equivalent)

Thanks. I prefer the functionality of a desktop wallet, and prefer to stick to the original client because it is the most secure & stable & thoroughly tested. It is also fully open source, unlike the other wallets.

Regarding Multibit, I've read about the horror stories of the bugs in Multibit which have caused people to lose all of their Bitcoins, and the lame excuses from the developers as to how these bugs only affect a "small portion" of their users.
member
Activity: 76
Merit: 10
October 20, 2014, 06:27:19 PM
#2
Is there a reason why you need to be using QT specifically? There are a number of other clients that do not "lose" your private keys after the keypool is "used up"

multibit and/or blockchain.info might be good alternatives if you want a larger keypool (the equivalent)
full member
Activity: 126
Merit: 100
October 20, 2014, 04:50:37 PM
#1
Hi there,

I am a complete newbie to command line options, and I was wondering if somebody could help give me step-by-step instructions on how to do this?

I am on the Mac, running OS X 10.9.5, and I am also running Bitcoin-QT 0.9.2.1.

I am trying to increase my keypool size to 1000, but I can't seem to get it to work.

From within Bitcoin-QT, I've pulled down from the "Help'" menu to "Debug window", and then I clicked on the "Console" tab, and then I typed in:

bitcoin-qt -keypool=1000

But it returns an error message to me that says:

Method not found (code -32601)

Can somebody please give me step-by-step instructions on how to increase the keypool to 1000? I couldn't find instructions in the Bitcoin Wiki, either.

Thanks!!
Jump to: