<p>Bitcoin Core does not support querying an address balance.</p>

<p>What you can do is import the address as watch-only into your wallet (using the <code>importaddress</code> RPC), and completing a rescan of the blockchain. When you're finished, the wallet will treat that address as one of its own, and track payments to it, and include it in its balance. Of course, you won't be able to spend it without private key.</p>

CC BY-SA 3.0
2018-03-09T00:29:43.430Z
The feature seems pretty basic to me, but I'm sure the core devs have good reason for it. Thank you for the suggestion I will try this out.
Corbin
CC BY-SA 3.0
2018-03-09T00:42:36.240Z
For normal operation an address index is not necessary, plus it is expensive to maintain, and there exists other software that is more appropriate for it.
Pieter Wuille
CC BY-SA 3.0
2018-03-10T18:40:11.517Z
Pieter thank you. May I ask what other software that is?
Corbin
CC BY-SA 3.0
2018-03-08T22:28:49.127Z
2018-03-08T22:28:49.127Z
Pieter Wuille
<p>I'm trying to use getrawtransaction to get transaction details (for any address) from my local blockchain. What I have is an address in readable format, "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa" but the input to getrawtransaction is a hexadecimal string. I found the following solution that does not change the string at all.</p>

<pre><code>let address='1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa';
address=address.toString('hex')
console.log(address);
client.getRawTransaction(address, function(error, o) { console.log(o); });
</code></pre>

<p>Any ideas?</p>

<bitcoin-core><json-rpc><node.js>
Calculate Any Address Balance Using Bitcoinn RPC getrawtransaction
Corbin
# Calculate Any Address Balance Using Bitcoinn RPC getrawtransaction

(Asked by: username_0 on 2018-03-08)

I'm trying to use getrawtransaction to get transaction details (for any address) from my local blockchain. What I have is an address in readable format, "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa" but the input to getrawtransaction is a hexadecimal string. I found the following solution that does not change the string at all.

```
let address='1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa';
address=address.toString('hex')
console.log(address);
client.getRawTransaction(address, function(error, o) { console.log(o); });

```

Any ideas?

**Tags:** bitcoin-core, json-rpc, node.js


---

## 1 answers

### Answer by username_1 on 2018-03-08. Score: 1 | Accepted answer

Bitcoin Core does not support querying an address balance.

What you can do is import the address as watch-only into your wallet (using the `importaddress` RPC), and completing a rescan of the blockchain. When you're finished, the wallet will treat that address as one of its own, and track payments to it, and include it in its balance. Of course, you won't be able to spend it without private key.

> **Comments:**
> **username_0**: The feature seems pretty basic to me, but I'm sure the core devs have good reason for it. Thank you for the suggestion I will try this out.  
> **username_1**: For normal operation an address index is not necessary, plus it is expensive to maintain, and there exists other software that is more appropriate for it.  
> **username_0**: username_1 thank you. May I ask what other software that is?  

---

