<p>You could create an index of all addresses and their balances by going over the whole block chain, f.e. using the RPC API.</p>

<p>I quickly wrote this script in Python. <em>Note that I did not verify it!</em> I only made it to give you an idea on how you can iterate over all transactions. Also, there is probably a more time-efficient way to do it by reading the block chain files yourself.</p>

<pre><code># setup bitcoind as RPC connection to your bitcoind client using JSON-RPC
block_hash = bitcoind.getblockhash(0)
while True:
    block = bitcoind.getblock(block_hash)
    for txid in block["tx"]:
        # you will need to run bitcoind with -txindex to be able to do this
        tx = bitcoind.gettransaction(txid)
        for det in tx["details"]:
            address = det["address"]
            amount = det["amount"]
            # do something with address and amount
            #  f.e. put them in a dictionary (this will take a lot of RAM)
            #  it is more advised to setup a db on disk
    if block.has_key("nextblockhash"):
        block_hash = block["nextblockhash"]
    else:
        break
</code></pre>

CC BY-SA 3.0
2013-05-13T08:26:50.090Z
2013-05-13T08:26:50.090Z
Steven Roose
<p>As of 12th May 2013 there have been just over 13 million distinct Bitcoin addresses which have been recipients of funds, and of those just over 1.6 million carry a positive balance.</p>

<p>However, please be aware that a single person's wallet is very likely to have multiple addresses in it, so the above numbers should not be extrapolated to assume anything about the number of <em>users</em> of Bitcoin.</p>

CC BY-SA 3.0
2013-05-13T15:01:22.530Z
2013-05-13T15:01:22.530Z
jgm
<p>I was wondering where I could see how many unique addresses currently exist in the blockchain, and especially how many of those have a positive balance. Is that data available somewhere?</p>

<blockchain>
How many Bitcoin addresses are there?
Maestro
# How many Bitcoin addresses are there?

(Asked by: username_0 on 2013-05-13)

I was wondering where I could see how many unique addresses currently exist in the blockchain, and especially how many of those have a positive balance. Is that data available somewhere?

**Tags:** blockchain


---

## 2 answers

### Answer by username_2 on 2013-05-13. Score: 6 | Accepted answer

As of 12th May 2013 there have been just over 13 million distinct Bitcoin addresses which have been recipients of funds, and of those just over 1.6 million carry a positive balance.

However, please be aware that a single person's wallet is very likely to have multiple addresses in it, so the above numbers should not be extrapolated to assume anything about the number of *users* of Bitcoin.


---

### Answer by username_1 on 2013-05-13. Score: 6

You could create an index of all addresses and their balances by going over the whole block chain, f.e. using the RPC API.

I quickly wrote this script in Python. *Note that I did not verify it!* I only made it to give you an idea on how you can iterate over all transactions. Also, there is probably a more time-efficient way to do it by reading the block chain files yourself.

```
# setup bitcoind as RPC connection to your bitcoind client using JSON-RPC
block_hash = bitcoind.getblockhash(0)
while True:
    block = bitcoind.getblock(block_hash)
    for txid in block["tx"]:
        # you will need to run bitcoind with -txindex to be able to do this
        tx = bitcoind.gettransaction(txid)
        for det in tx["details"]:
            address = det["address"]
            amount = det["amount"]
            # do something with address and amount
            #  f.e. put them in a dictionary (this will take a lot of RAM)
            #  it is more advised to setup a db on disk
    if block.has_key("nextblockhash"):
        block_hash = block["nextblockhash"]
    else:
        break

```


---

