<p>You really should use the newer <code>importmulti</code> RPC.</p>

<p>It lets you import multiple private keys at once (and since 0.18, also supports BIP32 derivation etc), and will do the rescan (if desired) once for all keys simultaneously.</p>

<p>If you have accurate birthday information for your keys (a lower bound on the time when the corresponding addresses might be first used on the network), <code>importmulti</code> will even only rescan the relevant part of the chain.</p>

CC BY-SA 4.0
2019-04-27T22:11:59.513Z
thanks for your fast answer. a rescan with many loaded wallets / a update of all wallets with just one rescan is not possible or? before i did it with import key and rescan=false and the last import i did with rescan=true.. this was working for one wallet, but i still have 20 wallets to update per day.. that would mean 20x one and a half hour..
Jack
CC BY-SA 4.0
2019-04-28T01:52:40.143Z
@Jack Yes, that works too for now, but importmulti is preferable for other reasons over importprivkey in any case.
Pieter Wuille
CC BY-SA 4.0
2020-09-10T22:28:50.107Z
Is there a script that will generate the JSON given a list of private keys?
user5652
CC BY-SA 4.0
2019-04-27T18:36:25.250Z
2019-04-27T18:36:25.250Z
Pieter Wuille
<p>I was wondering if someone already has this thoughts or problems:</p>

<p>I generate bitcoin addresses and private keys by a script - to not depend on the bitcoin daemon and manage them in a database. By generating the bitcoin addresses, I generate one address and also select a wallet name by some criterias.</p>

<p>BITCOIN ADDRESS | PRIVATE KEY | WALLETNAME </p>

<p>After a specific time i want to import the private keys to the given wallets ("WALLET NAMES") (to the wallets defined in the database before.)</p>

<p>I do this import with <code>importprivkey</code> without a rescan. I was wondering if it's possible to import the private keys to the wallets and to rescan one time and update all wallets with this one rescan to avoid for every wallet a explicit rescans each one and a half hour time.</p>

<p>Is it possible to import the private keys <code>rescan=false</code> and after this to run bitcoind with all wallets loaded and do the rescan which should be affecting all the wallets and update all of them in one rescan?</p>

<p>Has anyone thought about this before and has a solution for this?</p>

<bitcoin-core><bitcoind><bitcoin-core-development>
bitcoind bulk import private keys to different wallets and update with one rescan
Jack
# bitcoind bulk import private keys to different wallets and update with one rescan

(Asked by: username_0 on 2019-04-27)

I was wondering if someone already has this thoughts or problems:

I generate bitcoin addresses and private keys by a script - to not depend on the bitcoin daemon and manage them in a database. By generating the bitcoin addresses, I generate one address and also select a wallet name by some criterias.

BITCOIN ADDRESS | PRIVATE KEY | WALLETNAME

After a specific time i want to import the private keys to the given wallets ("WALLET NAMES") (to the wallets defined in the database before.)

I do this import with `importprivkey` without a rescan. I was wondering if it's possible to import the private keys to the wallets and to rescan one time and update all wallets with this one rescan to avoid for every wallet a explicit rescans each one and a half hour time.

Is it possible to import the private keys `rescan=false` and after this to run bitcoind with all wallets loaded and do the rescan which should be affecting all the wallets and update all of them in one rescan?

Has anyone thought about this before and has a solution for this?

**Tags:** bitcoin-core, bitcoind, bitcoin-core-development


---

## 1 answers

### Answer by username_1 on 2019-04-27. Score: 2

You really should use the newer `importmulti` RPC.

It lets you import multiple private keys at once (and since 0.18, also supports BIP32 derivation etc), and will do the rescan (if desired) once for all keys simultaneously.

If you have accurate birthday information for your keys (a lower bound on the time when the corresponding addresses might be first used on the network), `importmulti` will even only rescan the relevant part of the chain.

> **Comments:**
> **username_0**: thanks for your fast answer. a rescan with many loaded wallets / a update of all wallets with just one rescan is not possible or? before i did it with import key and rescan=false and the last import i did with rescan=true.. this was working for one wallet, but i still have 20 wallets to update per day.. that would mean 20x one and a half hour..  
> **username_1**: @username_0 Yes, that works too for now, but importmulti is preferable for other reasons over importprivkey in any case.  
> **username_2**: Is there a script that will generate the JSON given a list of private keys?  

---

