Author

Topic: How to check the balance of the list of 1 million Bitcoin Addresses? (Read 314 times)

legendary
Activity: 1624
Merit: 2481
for a second i say WHAT in windows!!!

i put some addresses in myAddyList.txt dir: C:\Users\x

Code:
PS C:\Users\x> findstr.exe -f -F myAddyList.txt balances-bitcoin > final.txt
i get this error
Code:
FINDSTR: Cannot open balances-bitcoin


Does the textfile balances-bitcoin exist? Did you download it ?
Please read the thread from the beginning if you didn't download it yet.

Also, you need to adjust the syntax. Windows does not take parameters with a "-" but with a "/"
You can find a lot of explanations of findstr online, to properly adjust your syntax.
jr. member
Activity: 56
Merit: 3
for a second i say WHAT in windows!!!

i put some addresses in myAddyList.txt dir: C:\Users\x

Code:
PS C:\Users\x> findstr.exe -f -F myAddyList.txt balances-bitcoin > final.txt
i get this error
Code:
FINDSTR: Cannot open balances-bitcoin

legendary
Activity: 1624
Merit: 2481
is there an alternative script for windows  Huh

Code:
some script > myAddyList.txt > balances-bitcoin > final.txt


Sure, just take my example from above:

Code:
grep -f -F myAddyList.txt balances-bitcoin > final.txt

and make a Select-string[1] statement out of it for powershell.



[1] https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/select-string?view=powershell-6
jr. member
Activity: 56
Merit: 3
is there an alternative script for windows  Huh

Code:
some script > myAddyList.txt > balances-bitcoin > final.txt
full member
Activity: 198
Merit: 130
Some random software engineer
Hello,

I would rather personally use a 3rd party key/value database in order to manipulate small data set like this, like redis.
A way to do it would be:

First, import database (& go take a coffee, as it will take a few minutes):

Code:
$ awk -F ';'  '{print "SET " $1 " " $2 }' < balances-bitcoin-20190617-0000-foryjL2u  | redis-cli >/dev/null

Check database import by cheching number of keys:

Code:
$ wc -l ~mycroft/balances-bitcoin-20190617-0000-foryjL2u
25330187 /home/mycroft/balances-bitcoin-20190617-0000-foryjL2u

$ redis-cli dbsize
(integer) 25330187

Then, retrieve all wanted balances & build a k/v export set (where "randomset" is the list of addresses searched in database):

Code:
$ awk '{print "GET " $1 }' < randomset  | redis-cli | tr -d \" > randomset.balances

$ paste randomset randomset.balances
1FMbcnYvvccZ6hR324cFRpn1QX9TCkqtAe      800000001092
1C7u4Zqu6ZZRsiKsFMYVDvNLfCwsGrbeTq      800000001092
155fzsEBHy9Ri2bMQ8uuuR3tv1YzcDywd4      191404456773
1BzK87zuqidZn489Wb2oLSktrjKrX7TLKe      200000174647
16BBBjvAArL3zdb1Fh1isr2w2hX7K1K4Gm      800000001092

Not found value would show (nil), which would make easy to know they are not appearing in database.
legendary
Activity: 1624
Merit: 2481
Then a code llike:

Code:
for a in $(cat myAddyList.txt)
do
cat balances-bitcoin | grep $a >> final.txt
done

With this bash script you will generate a file with the addys and balance...


This is extremely inefficient and probably will take quite some time.

The fastest approach would be some sort of a perl script. But since the there aren't too many entries in bitcoin-balances, a simple grep would be 'ok', i think:

Code:
grep -f -F myAddyList.txt balances-bitcoin > final.txt


This already is way faster than your bash script, however it is still far away from being really efficient.
legendary
Activity: 3332
Merit: 3116
How to check the balance of the list of 1 million Bitcoin Addresses? Is there such a program?

In what format you have those Addresses? As aplistir say, you can download the file about addys with balance and then compare it with your addys list, You could make an script for this... Lets supose you have your addys on a text file, first you have to download this https://balances.syndevio.com/ ( balances-bitcoin-20190611-0000 (673317892 bytes, 2019-06-11T00:20:22+00:00 - sample) )

Then a code llike:

Code:
for a in $(cat myAddyList.txt)
do
cat balances-bitcoin | grep $a >> final.txt
done

With this bash script you will generate a file with the addys and balance...
full member
Activity: 378
Merit: 197
the fastest and easiest way to make unlimited searches without running a node, is to download the current list of all addresses with balances

And then do searches from that file.

filesize is only about 900MB.

The drawback is obviously that all the results you get are from the moment when the list was generated.
If you need to know the balances from this exact second then this is obviously not for you.

This thread has info on how to make or get a list of all addresses with balances.
https://bitcointalk.org/index.php?topic=267618.320
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
How to check the balance of the list of 1 million Bitcoin Addresses? Is there such a program?

You'll clearly need bitcoin core or at least it's chain data.

Option 1.
There are programs like this one (Google result) that parse the chain data and return more usable formats, from csv to proper database.
The one I've found returns the addresses with balance. You'll search the addresses there (and if not found then the balance is 0)

Option 2.
Play directly with bitcoin core with RPC calls.
ListUnspent will give you the list of unspent inputs for one or more addresses.
You'll have to compose from them the actual balance though.
newbie
Activity: 11
Merit: 3
How to check the balance of the list of 1 million Bitcoin Addresses? Is there such a program?
Jump to: