Take the 2-minute tour ×
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

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.

share|improve this answer
add comment

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.