<blockquote>
  <p>Is there any way, other than <code>importaddress</code>, to watch balances of specific addresses?</p>
</blockquote>

<p>You can import a wallet that was exported in the <code>dumpwallet</code> format using the <code>importwallet</code> command. You can also import addresses using <code>importmulti</code> and <code>importpubkey</code>. But, in general, no, there is no way to watch balances of specific addresses in Bitcoin Core without using an <code>import*</code> command.</p>

<p>With Bitcoin Core 0.17, you can use the <code>scantxoutset</code> command which will scan the UTXO set for the UTXOs pertaining to an output script (defined in various ways).</p>

<blockquote>
  <p>If not, how it is possible for wallets and explorers to give information (balance, transactions) about specific addresses even though importaddress takes some time? Because we have to rescan sooner or later. </p>
</blockquote>

<p>Wallets keep track of this information themselves. They do so in the same way that the <code>import*</code> command work. <code>import*</code> commands are wallet commands to tell a wallet to keep track of certain output scripts. They keep track of these in the same way: scan incoming blocks and transactions for outputs that match what they are looking for.</p>

<p>Blockchain explorers do not use Bitcoin Core nor do they use the wallet for this sort of stuff. They maintain their own databases that store the information for all transactions and their outputs. They do so in a similar way to wallets, but instead of looking for specific output scripts, they just store all output scripts.</p>

CC BY-SA 4.0
2018-09-11T08:09:53.407Z
how Wallets are keeping track of this information?
Zohaib Sohail
CC BY-SA 4.0
2018-09-11T08:10:16.137Z
any open Source block explorer you can refer?
Zohaib Sohail
CC BY-SA 4.0
2018-09-11T14:16:50.630Z
Wallets keep track of this information by receiving all transactions (both in blocks and not) and then scanning the outputs of those transactions for specific scripts that they are looking for. If the scripts match, the transaction is stored and whatever internal databases are updated. As for open source block explorers, have a look at insight: https://github.com/bitpay/insight
Ava Chow
CC BY-SA 4.0
2018-09-13T13:33:33.620Z
I dont know what but I m missing something. Could you please help me @Andrew ???
Lets say I made a wallet and have full synced node. A user with an address which also have some coins, comes to my wallet and sign-up. Now wallet will have to show balance of his address, but in my case I could not be able to show him without rescan - which takes some time. Then how do the already running wallets are doing it?
Zohaib Sohail
CC BY-SA 4.0
2018-09-13T14:14:12.347Z
Users typically don't already have an address with coins when they create an account with an online wallet service. Or if they do, they aren't bringing those with them to that online service. Many online services are already indexing the blockchain anyways for all addresses. So it is very quick for them to just search through that index instead of rescanning the blockchain if a user imports their own addresses.
Ava Chow
CC BY-SA 4.0
2018-09-11T00:55:11.400Z
2018-09-11T00:55:11.400Z
Ava Chow
<blockquote>
  <p><strong>Is there any way, other than importaddress, to watch balances of specific addresses?</strong></p>
</blockquote>

<p>No, creating a watch-only address is the way to do this using a wallet such as Bitcoin-core.</p>

<blockquote>
  <p><strong>how it is possible for wallets and explorers to give information ... even though importaddress takes some time?</strong></p>
</blockquote>

<p>Once the blockchain has been initially scanned for transactions involving an imported address, the wallet need only check new blocks for mentions of that address <em>as it receives the new blocks</em>, there should be no need to rescan the blockchain.</p>

<p>Blockchain explorers can maintain an index per address and continuously keep track of balances for all addresses. They don't need to recompute this from scratch for every new enquiry.</p>

CC BY-SA 4.0
2018-09-10T15:38:56.653Z
2018-09-10T15:38:56.653Z
RedGrittyBrick
<p>I have written  a program in Python3 that allows you to search for any address on bitcoin core, whether it belongs to your wallet or not.</p>
<p>Here is the github link:</p>
<p><a href="https://github.com/ORP967/Bitcoin_Core_RPC_par_address" rel="nofollow noreferrer">https://github.com/ORP967/Bitcoin_Core_RPC_par_address</a></p>
<p>Let me know what you think and any improvements you might have for it,</p>

CC BY-SA 4.0
2022-01-23T22:47:51.013Z
2022-01-23T22:47:51.013Z
ORP967
<p>Is there any way, other than <a href="https://bitcoin.org/en/developer-reference#importaddress" rel="nofollow noreferrer"><code>importaddress</code></a>, to watch balances of specific addresses?</p>

<p>If not, how it is possible for wallets and explorers to give information (balance, transactions) about specific addresses even though <code>importaddress</code> takes some time?  Because we have to rescan sooner or later. </p>

<bitcoin-core><client><bitcoin-core-development><blockexplorer><importaddress>
How to monitor balance for addresses other than by using importAddress?
Zohaib Sohail
# How to monitor balance for addresses other than by using importAddress?

(Asked by: username_0 on 2018-09-10)

Is there any way, other than [`importaddress`](https://bitcoin.org/en/developer-reference#importaddress), to watch balances of specific addresses?

If not, how it is possible for wallets and explorers to give information (balance, transactions) about specific addresses even though `importaddress` takes some time? Because we have to rescan sooner or later.

**Tags:** bitcoin-core, client, bitcoin-core-development, blockexplorer, importaddress


---

## 3 answers

### Answer by username_1 on 2018-09-11. Score: 0 | Accepted answer

> Is there any way, other than `importaddress`, to watch balances of specific addresses?

You can import a wallet that was exported in the `dumpwallet` format using the `importwallet` command. You can also import addresses using `importmulti` and `importpubkey`. But, in general, no, there is no way to watch balances of specific addresses in Bitcoin Core without using an `import*` command.

With Bitcoin Core 0.17, you can use the `scantxoutset` command which will scan the UTXO set for the UTXOs pertaining to an output script (defined in various ways).

> If not, how it is possible for wallets and explorers to give information (balance, transactions) about specific addresses even though importaddress takes some time? Because we have to rescan sooner or later.

Wallets keep track of this information themselves. They do so in the same way that the `import*` command work. `import*` commands are wallet commands to tell a wallet to keep track of certain output scripts. They keep track of these in the same way: scan incoming blocks and transactions for outputs that match what they are looking for.

Blockchain explorers do not use Bitcoin Core nor do they use the wallet for this sort of stuff. They maintain their own databases that store the information for all transactions and their outputs. They do so in a similar way to wallets, but instead of looking for specific output scripts, they just store all output scripts.

> **Comments:**
> **username_0**: how Wallets are keeping track of this information?  
> **username_0**: any open Source block explorer you can refer?  
> **username_1**: Wallets keep track of this information by receiving all transactions (both in blocks and not) and then scanning the outputs of those transactions for specific scripts that they are looking for. If the scripts match, the transaction is stored and whatever internal databases are updated. As for open source block explorers, have a look at insight: https://github.com/bitpay/insight  
> **username_0**: I dont know what but I m missing something. Could you please help me @Andrew ??? Lets say I made a wallet and have full synced node. A user with an address which also have some coins, comes to my wallet and sign-up. Now wallet will have to show balance of his address, but in my case I could not be able to show him without rescan - which takes some time. Then how do the already running wallets are doing it?  
> **username_1**: Users typically don't already have an address with coins when they create an account with an online wallet service. Or if they do, they aren't bringing those with them to that online service. Many online services are already indexing the blockchain anyways for all addresses. So it is very quick for them to just search through that index instead of rescanning the blockchain if a user imports their own addresses.  

---

### Answer by username_2 on 2018-09-10. Score: 1

> **Is there any way, other than importaddress, to watch balances of specific addresses?**

No, creating a watch-only address is the way to do this using a wallet such as Bitcoin-core.

> **how it is possible for wallets and explorers to give information ... even though importaddress takes some time?**

Once the blockchain has been initially scanned for transactions involving an imported address, the wallet need only check new blocks for mentions of that address *as it receives the new blocks*, there should be no need to rescan the blockchain.

Blockchain explorers can maintain an index per address and continuously keep track of balances for all addresses. They don't need to recompute this from scratch for every new enquiry.


---

### Answer by username_3 on 2022-01-23. Score: 0

I have written a program in Python3 that allows you to search for any address on bitcoin core, whether it belongs to your wallet or not.

Here is the github link:

<https://github.com/username_3/Bitcoin_Core_RPC_par_address>

Let me know what you think and any improvements you might have for it,


---

