<p>Here's a basic example of how you can use <code>importmulti</code>:</p>
<pre class="lang-bash prettyprint-override"><code>bitcoin-cli importmulti '[{&quot;scriptPubKey&quot;: {&quot;address&quot;: &quot;13LJXzFwARH5N2bR1AV38Nf9qDVw53PjiB&quot;}, &quot;timestamp&quot;:0}]'
</code></pre>
<p>In this example, we are importing a single address. You can extend this to include all your addresses. However, keep in mind that using <code>importmulti</code> with private keys directly in the command line is not secure, as it may expose your private keys to other users on your system.</p>
<p>Here is an example with multiple addresses and their corresponding private keys:</p>
<pre class="lang-bash prettyprint-override"><code>bitcoin-cli importmulti '[{&quot;scriptPubKey&quot;: {&quot;address&quot;: &quot;13LJXzFwARH5N2bR1AV38Nf9qDVw53PjiB&quot;}, &quot;timestamp&quot;:0},{&quot;scriptPubKey&quot;: {&quot;address&quot;: &quot;1BcBMuEJJzEY36PmKWTFmYRxEF3YaSEiKN&quot;}, &quot;timestamp&quot;:0},{&quot;scriptPubKey&quot;: {&quot;address&quot;: &quot;1NeZCnuSW9NG8F147VNf8JSLKWGcVexZ32&quot;}, &quot;timestamp&quot;:0}]' '[{&quot;keys&quot;: [&quot;private_key_1&quot;, &quot;private_key_2&quot;, &quot;private_key_3&quot;], &quot;timestamp&quot;:0}]' '{&quot;rescan&quot;: false}'
</code></pre>
<p>Make sure to replace <code>&quot;private_key_1&quot;</code>, etc., with your actual private keys.</p>
<p>it's crucial to handle private keys securely. Storing them in plaintext in commands or scripts is not recommended.</p>

CC BY-SA 4.0
2023-10-18T09:58:09.570Z
2023-10-18T09:58:09.570Z
Mani T
<p>I have some keys obtained from walletdump,</p>
<pre><code>13LJXzFwARH5N2bR1AV38Nf9qDVw53PjiB
1BcBMuEJJzEY36PmKWTFmYRxEF3YaSEiKN
1NeZCnuSW9NG8F147VNf8JSLKWGcVexZ32


8e576cbf85a8f529b8b1704deecd122ec8e542761c81928866af3af5825ec016
be9cf54f7d6aba2ab730f8cb4c61b9ff3587b887f12bb6cbfd0eeb158364ce44
3922ccf671581b81201d18c9258d6e0cd1d2a5ea42f20323692f90bb7ac4e45c
e8ba7c776506a8e774db816d65a90f6cb6c1861bb10edc077bbdace058a8bcad
276f7c05b7a3d92281ee4c6ea1240beb41fda59db1c2ca16cf42a1509ffd9e36
b8b42b10f67c7cc83dd736f183f7a919e6f7a1a73513ad31aabc10fb77866e60

0033598d96cf61c76369f9f3bff2cae0bc54d0375b8fe57d475859d6b8bac3b8
002c15a780f0ce0e0407f75b2afb1d6108e66d528098c5568ada47222b58edac
00d9ba3daf22a3a9febbf25b62c1468c48b85389be52838b5133d3155683d28d

# also private keys
</code></pre>
<p>How can I properly use importmulti and put all my keys there?</p>
<p>Any answer would be appreciated.</p>

<bitcoin-core><import><importmulti>
How to use bitcoin core importmulti
user123
# How to use bitcoin core importmulti

(Asked by: username_0 on 2023-10-16)

I have some keys obtained from walletdump,

```
13LJXzFwARH5N2bR1AV38Nf9qDVw53PjiB
1BcBMuEJJzEY36PmKWTFmYRxEF3YaSEiKN
1NeZCnuSW9NG8F147VNf8JSLKWGcVexZ32

8e576cbf85a8f529b8b1704deecd122ec8e542761c81928866af3af5825ec016
be9cf54f7d6aba2ab730f8cb4c61b9ff3587b887f12bb6cbfd0eeb158364ce44
3922ccf671581b81201d18c9258d6e0cd1d2a5ea42f20323692f90bb7ac4e45c
e8ba7c776506a8e774db816d65a90f6cb6c1861bb10edc077bbdace058a8bcad
276f7c05b7a3d92281ee4c6ea1240beb41fda59db1c2ca16cf42a1509ffd9e36
b8b42b10f67c7cc83dd736f183f7a919e6f7a1a73513ad31aabc10fb77866e60

0033598d96cf61c76369f9f3bff2cae0bc54d0375b8fe57d475859d6b8bac3b8
002c15a780f0ce0e0407f75b2afb1d6108e66d528098c5568ada47222b58edac
00d9ba3daf22a3a9febbf25b62c1468c48b85389be52838b5133d3155683d28d

# also private keys

```

How can I properly use importmulti and put all my keys there?

Any answer would be appreciated.

**Tags:** bitcoin-core, import, importmulti


---

## 1 answers

### Answer by username_1 on 2023-10-18. Score: 1

Here's a basic example of how you can use `importmulti`:

```bash
bitcoin-cli importmulti '[{"scriptPubKey": {"address": "13LJXzFwARH5N2bR1AV38Nf9qDVw53PjiB"}, "timestamp":0}]'

```

In this example, we are importing a single address. You can extend this to include all your addresses. However, keep in mind that using `importmulti` with private keys directly in the command line is not secure, as it may expose your private keys to other users on your system.

Here is an example with multiple addresses and their corresponding private keys:

```bash
bitcoin-cli importmulti '[{"scriptPubKey": {"address": "13LJXzFwARH5N2bR1AV38Nf9qDVw53PjiB"}, "timestamp":0},{"scriptPubKey": {"address": "1BcBMuEJJzEY36PmKWTFmYRxEF3YaSEiKN"}, "timestamp":0},{"scriptPubKey": {"address": "1NeZCnuSW9NG8F147VNf8JSLKWGcVexZ32"}, "timestamp":0}]' '[{"keys": ["private_key_1", "private_key_2", "private_key_3"], "timestamp":0}]' '{"rescan": false}'

```

Make sure to replace `"private_key_1"`, etc., with your actual private keys.

it's crucial to handle private keys securely. Storing them in plaintext in commands or scripts is not recommended.


---

