<p>After doing some RPC function call tests with ImportMulti and ImportAddress, I feel confident answering my own question. </p>

<p>By way of example, suppose I want to import a watch-only address "1CxZZZREDACTEDYYYYREDACTEDxyzabcD1":</p>

<p><strong>Using "ImportAddress":</strong></p>

<pre><code>bitcoin-cli importaddress  1CxZZZREDACTEDYYYYREDACTEDxyzabcD1 "Account XYZ" true
</code></pre>

<p><strong>Using "ImportMulti":</strong></p>

<pre><code>bitcoin-cli importmulti '
  [
    {
      "scriptPubKey" : { "address": "1CxZZZREDACTEDYYYYREDACTEDxyzabcD1" },
      "timestamp" : 1510387200,
      "label" : "Account XYZ"
    }        
  ]' '{ "rescan": true }'
</code></pre>

<p><strong>Lessons Learned:</strong></p>

<p><em>Label vs Account</em>: 
The "account" parameter in ImportAddress has the same effect as the "label" property in ImportMulti.  They both just label the bitcoin address with friendly text (in my case, "Account XYZ").  </p>

<p><em>Rescan and timestamp</em>:
If you set "rescan" to true in ImportAddress, then it will rescan the entire blockchain from the beginning.  However, if you set "rescan" to true using ImportMulti, then it will only rescan as far back as the earliest "timestamp" value in your list of JSON-encoded address objects. Note that I used the following Linux command to generate my timestamp value of 1510387200: </p>

<pre><code>$ date -d "Nov 11 2017" +%s
$ 1510387200
</code></pre>

<p><strong>Summary:</strong></p>

<p>You can use ImportMulti to perform the same operation as ImportAddress, knowing that in ImportMulti, the "label" property of each Import object means the same thing as the "account" parameter in ImportAddress. Further, ImportMulti is more powerful because you can specify each address's creation timestamp, which results in a much faster "rescan".  </p>

<p>If anything I wrote here is wrong, please correct me. </p>

CC BY-SA 3.0
2017-11-19T19:04:35.590Z
Looks all correct to me.
Pieter Wuille
CC BY-SA 3.0
2017-11-19T12:42:22.437Z
2017-11-19T12:42:22.437Z
dimsumcode
<p>If you are using the getTime() method in Date objects in Javascript, this generates a timestamp that is the number of <strong>MILLISECONDS</strong> not <strong>SECONDS</strong> from the Unix Epoch. So for importmulti call to work, strip the last 3 numbers of the timestamp generated in Javascript, otherwise bitcoind will think is a future date and it will replace this timestamp with "now" which will only rescan 10 to 13 blocks from the current best blockchain height.</p>

CC BY-SA 4.0
2018-07-10T15:21:27.630Z
2018-07-10T15:21:27.630Z
vvaldomon
<p>My question is: I want to use ImportMulti to import a long list of watch-only addresses.  However, unlike ImportAddress, I don't see any way to place these addresses into specific "accounts".  Is this even possible?</p>

<p>UPDATE: After more research, it seems to me that the concept of "label" is basically the same thing as "account".  Is this correct? Seems kind of confusing to me. If this is the case, then ImportMulti can work as I want, by using the "label" property.</p>

<watch-only>
How to make ImportMulti function like ImportAddress for watch-only addresses placed into Accounts?
dimsumcode
# How to make ImportMulti function like ImportAddress for watch-only addresses placed into Accounts?

(Asked by: username_0 on 2017-11-18)

My question is: I want to use ImportMulti to import a long list of watch-only addresses. However, unlike ImportAddress, I don't see any way to place these addresses into specific "accounts". Is this even possible?

UPDATE: After more research, it seems to me that the concept of "label" is basically the same thing as "account". Is this correct? Seems kind of confusing to me. If this is the case, then ImportMulti can work as I want, by using the "label" property.

**Tags:** watch-only


---

## 2 answers

### Answer by username_0 on 2017-11-19. Score: 4

After doing some RPC function call tests with ImportMulti and ImportAddress, I feel confident answering my own question.

By way of example, suppose I want to import a watch-only address "1CxZZZREDACTEDYYYYREDACTEDxyzabcD1":

**Using "ImportAddress":**

```
bitcoin-cli importaddress  1CxZZZREDACTEDYYYYREDACTEDxyzabcD1 "Account XYZ" true

```

**Using "ImportMulti":**

```
bitcoin-cli importmulti '
  [
    {
      "scriptPubKey" : { "address": "1CxZZZREDACTEDYYYYREDACTEDxyzabcD1" },
      "timestamp" : 1510387200,
      "label" : "Account XYZ"
    }        
  ]' '{ "rescan": true }'

```

**Lessons Learned:**

*Label vs Account*:
The "account" parameter in ImportAddress has the same effect as the "label" property in ImportMulti. They both just label the bitcoin address with friendly text (in my case, "Account XYZ").

*Rescan and timestamp*:
If you set "rescan" to true in ImportAddress, then it will rescan the entire blockchain from the beginning. However, if you set "rescan" to true using ImportMulti, then it will only rescan as far back as the earliest "timestamp" value in your list of JSON-encoded address objects. Note that I used the following Linux command to generate my timestamp value of 1510387200:

```
$ date -d "Nov 11 2017" +%s
$ 1510387200

```

**Summary:**

You can use ImportMulti to perform the same operation as ImportAddress, knowing that in ImportMulti, the "label" property of each Import object means the same thing as the "account" parameter in ImportAddress. Further, ImportMulti is more powerful because you can specify each address's creation timestamp, which results in a much faster "rescan".

If anything I wrote here is wrong, please correct me.

> **Comments:**
> **username_1**: Looks all correct to me.  

---

### Answer by username_2 on 2018-07-10. Score: 0

If you are using the getTime() method in Date objects in Javascript, this generates a timestamp that is the number of **MILLISECONDS** not **SECONDS** from the Unix Epoch. So for importmulti call to work, strip the last 3 numbers of the timestamp generated in Javascript, otherwise bitcoind will think is a future date and it will replace this timestamp with "now" which will only rescan 10 to 13 blocks from the current best blockchain height.


---

