Bitcoin Forum
February 01, 2023, 11:30:08 PM *
News: Latest Bitcoin Core release: 24.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Import Multi privkey in bitcoin core ?  (Read 2343 times)
Monopoly (OP)
Hero Member
*****
Offline Offline

Activity: 546
Merit: 500



View Profile
April 04, 2015, 01:33:18 PM
Last edit: August 10, 2015, 10:36:59 PM by Monopoly
 #1

How to Import Multi privkey into bitcoin core at same time ( once ) , not separately ?
1675294208
Hero Member
*
Offline Offline

Posts: 1675294208

View Profile Personal Message (Offline)

Ignore
1675294208
Reply with quote  #2

1675294208
Report to moderator
1675294208
Hero Member
*
Offline Offline

Posts: 1675294208

View Profile Personal Message (Offline)

Ignore
1675294208
Reply with quote  #2

1675294208
Report to moderator
There are several different types of Bitcoin clients. The most secure are full nodes like Bitcoin Core, which will follow the rules of the network no matter what miners do. Even if every miner decided to create 1000 bitcoins per block, full nodes would stick to the rules and reject those blocks.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1675294208
Hero Member
*
Offline Offline

Posts: 1675294208

View Profile Personal Message (Offline)

Ignore
1675294208
Reply with quote  #2

1675294208
Report to moderator
Amph
Legendary
*
Offline Offline

Activity: 3094
Merit: 1057



View Profile
April 04, 2015, 03:14:33 PM
 #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
grue
Legendary
*
Offline Offline

Activity: 2058
Merit: 1324



View Profile
April 05, 2015, 04:36:19 AM
 #3

by using a script that calls importprivkey repeately?

It is pitch black. You are likely to be eaten by a grue.

Adblock for annoying signature ads | Enhanced Merit UI
coinableS
Legendary
*
Offline Offline

Activity: 1442
Merit: 1158



View Profile WWW
April 05, 2015, 05: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

InceptionCoin
Member
**
Offline Offline

Activity: 108
Merit: 10


View Profile
April 05, 2015, 07: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?

Skilled C++ and Python programmer. Looking around to create solid longterm coin by myself. Do you have any ideas? Feel free to PM me.
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1453


No I dont escrow anymore.


View Profile WWW
April 05, 2015, 07: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.

Im not really here, its just your imagination.
S4VV4S
Hero Member
*****
Offline Offline

Activity: 1582
Merit: 502


View Profile
April 05, 2015, 08:25:43 AM
 #7

This will answer your question: https://bitcointalk.org/index.php?topic=342872.0
emrebey
Sr. Member
****
Offline Offline

Activity: 476
Merit: 250


View Profile
April 05, 2015, 10: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.
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 503

a.k.a. gurnec on GitHub


View Profile WWW
April 05, 2015, 05: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://bitcointalk.org/index.php?topic=712047.msg8051822#msg8051822
Monopoly (OP)
Hero Member
*****
Offline Offline

Activity: 546
Merit: 500



View Profile
August 10, 2015, 10: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://bitcointalk.org/index.php?topic=712047.msg8051822#msg8051822

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" .
Monopoly (OP)
Hero Member
*****
Offline Offline

Activity: 546
Merit: 500



View Profile
August 10, 2015, 10: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 ?
tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1073


I may write code in exchange for bitcoins.


View Profile
August 11, 2015, 06: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://bitcointalk.org/index.php?topic=712047.msg8051822#msg8051822

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 <privatekey> "" 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.
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1453


No I dont escrow anymore.


View Profile WWW
August 11, 2015, 05: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
...

Im not really here, its just your imagination.
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!