<p>Though the terminiology is unclear, in code "label" and "account" are the same thing:</p>

<p><code>importprivkey</code> function (<a href="https://github.com/bitcoin/bitcoin/blob/738835d7b8ab80bd0812805f197471c54c72d7f9/src/rpcdump.cpp#L60"><code>src/rpcdump.cpp</code></a>):</p>

<pre><code>pwalletMain-&gt;SetAddressBookName(vchAddress, strLabel);
</code></pre>

<p>from <code>getnewaddress</code> function (<a href="https://github.com/bitcoin/bitcoin/blob/ad525e9c8fa2b15f1afe6b7284de638a090e891a/src/rpcwallet.cpp#L112"><code>src/rpcwallet.cpp</code></a>):</p>

<pre><code>pwalletMain-&gt;SetAddressBookName(keyID, strAccount);
</code></pre>

CC BY-SA 3.0
2012-12-12T11:42:11.657Z
2012-12-12T11:42:11.657Z
aland
<p>The "<a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list">importprivkey</a>" API call allows one to import a private key and save it with a label. Is the "label" in the API call synonymous with an account used in the wallet?</p>

<wallet><bitcoind><json-rpc><api><bitcoin-core-accounts>
Importprivkey's "label" - is it the same as an account?
ThePiachu
# Importprivkey's "label" - is it the same as an account?

(Asked by: username_0 on 2012-07-08)

The "[importprivkey](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list)" API call allows one to import a private key and save it with a label. Is the "label" in the API call synonymous with an account used in the wallet?

**Tags:** wallet, bitcoind, json-rpc, api, bitcoin-core-accounts


---

## 1 answers

### Answer by username_1 on 2012-12-12. Score: 7 | Accepted answer

Though the terminiology is unclear, in code "label" and "account" are the same thing:

`importprivkey` function ([`src/rpcdump.cpp`](https://github.com/bitcoin/bitcoin/blob/738835d7b8ab80bd0812805f197471c54c72d7f9/src/rpcdump.cpp#L60)):

```
pwalletMain->SetAddressBookName(vchAddress, strLabel);

```

from `getnewaddress` function ([`src/rpcwallet.cpp`](https://github.com/bitcoin/bitcoin/blob/ad525e9c8fa2b15f1afe6b7284de638a090e891a/src/rpcwallet.cpp#L112)):

```
pwalletMain->SetAddressBookName(keyID, strAccount);

```


---

