Author

Topic: Import Multi privkey in bitcoin core ? (Read 2382 times)

copper member
Activity: 1498
Merit: 1528
No I dont escrow anymore.
August 11, 2015, 12:56:06 PM
#13
if you have a text file including private keys, you can easily write a script to import them. rescan should be at the last importprivkey command.

No one write this script yet ? i am the first one that have this problem ?

I have a batch file from the spam keys, but I would not exactly call it a script since its just a modified textfile. I had a list of private keys so adding path\to\bitcoin\bitcoin-cli.exe importprivkey was easily done with search and replace. Just make sure the last file ends with true instead of false to trigger the rescan.

Code:
"C:\Program Files\Bitcoin\daemon\bitcoin-cli.exe" importprivkey Kx77AtZ3TZaLRHaRTVBtjdwSN9qn8phRqy3osFxShN6Qm7fH287T 000 false
"C:\Program Files\Bitcoin\daemon\bitcoin-cli.exe" importprivkey KwciCH5RRePGDzH85xU5iZb3oGPtRuanqHqJbgnRvF3DnWH6F17n 001 false
"C:\Program Files\Bitcoin\daemon\bitcoin-cli.exe" importprivkey Kz9EYSbrDVZACjUmgYNtP7sNT1DZDs3sB1xNXroj3vGz55xyPFfg 002 false
...
legendary
Activity: 1456
Merit: 1081
I may write code in exchange for bitcoins.
August 11, 2015, 01:16:23 AM
#12
How to Import Multi privkey into bitcoin core at same time , not separately ?

I don't think this has been answered yet; apologies if I missed it.

See here for details on the importwallet RPC command, which imports a bunch of privkeys from a single file at once, and does a single rescan for them at the end: https://bitcointalksearch.org/topic/m.8051822

Yes . My question has been answered yet even with your guiding .

I couldn't understand what is importwallet and where is the location of "fie name" and what's the format of "file name" and what is the content of "file name" .

For those following this thread, Monopoly seems to be following up about the post btchris linked him to:

For that number of addresses you really need a full-node client. (Armory or Core)

If you don't, then querying the lite-wallet servers will probably get you soft-banned from querying them (they'll view you as DOSing them)

I would use Core and write a script that will run the following RPC call for each private key
Code:
importprivkey  "" False
(The private keys should be in WIF format and without the <> or any "" around them...)

The [ "" False ] part is a must. only remove that false (or change it to True) on the LAST private key you import...

If you don't, it will rescan the blockchain after every import and take a REAAAAALLLY long time, if it doesn't crash.




Maybe Armory has a better solution, but afaik bitcoind would be the best way to go.

I'd tend to agree with using Bitcoin Core, even though it looks like that's what you were using when the problem occurred. Bitcoin Core uses Berkeley DB as its wallet.dat format. Berkeley DB is a bit bloated, but it's mature, very scalable, and has some reasonably decent recovery tools. I'm not aware of any other client that would be equally scalable (not that I'm an expert on alternative clients though...).

As much as I like Armory, I don't think it would scale as well (although it's wallet format is nice and simple and more error-resistant than any other wallet format I'm aware of).

For importing, as an alternative you could use the RPC command:
Code:
importwallet "filename"

The wallet import format is a bunch of lines like so:

Code:
Kx2GEDGhepMhkUnymSFtrU2Q59KMPY75oYjBVofYV9032p5L4a2b 2014-06-19T00:58:01Z change=1 reserve=1 label=label%20with%20spaces

The first two fields are required. If you don't have the address creation time, you can replace that field with something meaningless (e.g. "DATE-UNKNOWN") but something needs to be there. The last three fields are each optional. Only a single rescan is done at the end of the file import, and if you do have all of the creation times, the rescan will intelligently start at the right time instead of starting at the genesis block.

So, Monopoly, "filename" is the name and path to the file which contains a list of private keys  in WIF format.  The contents of the file are what's shown in the second code block.  Each line should have at least two fields:

PRIVKEY DATESTAMP

I hope this helps.
hero member
Activity: 546
Merit: 500
August 10, 2015, 05:32:45 PM
#11
if you have a text file including private keys, you can easily write a script to import them. rescan should be at the last importprivkey command.

No one write this script yet ? i am the first one that have this problem ?
hero member
Activity: 546
Merit: 500
August 10, 2015, 05:29:27 PM
#10
How to Import Multi privkey into bitcoin core at same time , not separately ?

I don't think this has been answered yet; apologies if I missed it.

See here for details on the importwallet RPC command, which imports a bunch of privkeys from a single file at once, and does a single rescan for them at the end: https://bitcointalksearch.org/topic/m.8051822

Yes . My question has been answered yet even with your guiding .

I couldn't understand what is importwallet and where is the location of "fie name" and what's the format of "file name" and what is the content of "file name" .
hero member
Activity: 672
Merit: 504
a.k.a. gurnec on GitHub
April 05, 2015, 12:00:39 PM
#9
How to Import Multi privkey into bitcoin core at same time , not separately ?

I don't think this has been answered yet; apologies if I missed it.

See here for details on the importwallet RPC command, which imports a bunch of privkeys from a single file at once, and does a single rescan for them at the end: https://bitcointalksearch.org/topic/m.8051822
sr. member
Activity: 476
Merit: 250
April 05, 2015, 05:35:00 AM
#8
if you have a text file including private keys, you can easily write a script to import them. rescan should be at the last importprivkey command.
hero member
Activity: 1582
Merit: 502
copper member
Activity: 1498
Merit: 1528
No I dont escrow anymore.
April 05, 2015, 02:35:50 AM
#6
Is the reason you want to do multiple at once instead of one at a time due to the rescan?

You can add a false parameter at the end to skip the rescanning process, just rescan on the last private key you import. Should help make the process a bit quicker.

Code:
importprivkey 5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "label" false
How should it work? What is 5xxxxxxxxxx? Is it privkey of one addr or somehow compressed set of privkeys?

5xx... is a placeholder for a single private key. You would have to write some sort of loop that iterates over a list of private keys and calls the above function on bitcoin.
member
Activity: 108
Merit: 10
April 05, 2015, 02:12:31 AM
#5
Is the reason you want to do multiple at once instead of one at a time due to the rescan?

You can add a false parameter at the end to skip the rescanning process, just rescan on the last private key you import. Should help make the process a bit quicker.

Code:
importprivkey 5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "label" false
How should it work? What is 5xxxxxxxxxx? Is it privkey of one addr or somehow compressed set of privkeys?
legendary
Activity: 1442
Merit: 1186
April 05, 2015, 12:33:36 AM
#4
Is the reason you want to do multiple at once instead of one at a time due to the rescan?

You can add a false parameter at the end to skip the rescanning process, just rescan on the last private key you import. Should help make the process a bit quicker.

Code:
importprivkey 5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "label" false
legendary
Activity: 2058
Merit: 1452
April 04, 2015, 11:36:19 PM
#3
by using a script that calls importprivkey repeately?
legendary
Activity: 3248
Merit: 1070
April 04, 2015, 10:14:33 AM
#2
it's better to use those private keys to sign raw transactions, than importing them, it's faster

https://en.bitcoin.it/wiki/Raw_Transactions


or you can do a script to do it for you, because i don't think it is possible via command-line
hero member
Activity: 546
Merit: 500
April 04, 2015, 08:33:18 AM
#1
How to Import Multi privkey into bitcoin core at same time ( once ) , not separately ?
Jump to: