Bitcoin Forum
November 01, 2024, 11:54:46 AM *
News: Bitcoin Pumpkin Carving Contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to check the balance of the list of 1 million Bitcoin Addresses?  (Read 323 times)
Btceon (OP)
Newbie
*
Offline Offline

Activity: 11
Merit: 3


View Profile
June 10, 2019, 11:54:11 AM
 #1

How to check the balance of the list of 1 million Bitcoin Addresses? Is there such a program?
NeuroticFish
Legendary
*
Offline Offline

Activity: 3850
Merit: 6583


Looking for campaign manager? Contact icopress!


View Profile
June 10, 2019, 12:44:50 PM
 #2

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.

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
aplistir
Full Member
***
Offline Offline

Activity: 378
Merit: 197



View Profile
June 10, 2019, 05:44:41 PM
Merited by odolvlobo (1), starmyc (1)
 #3

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

My Address: 121f7zb2U4g9iM4MiJTDhEzqeZGHzq5wLh
seoincorporation
Legendary
*
Offline Offline

Activity: 3332
Merit: 3115



View Profile
June 11, 2019, 12:15:17 PM
 #4

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...

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
June 12, 2019, 07:37:26 AM
 #5

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.

starmyc
Full Member
***
Offline Offline

Activity: 198
Merit: 130

Some random software engineer


View Profile
June 17, 2019, 08:37:11 AM
Merited by Heisenberg_Hunter (1)
 #6

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.

Hi, I'm just some random software engineer.
You can check my projects: Bitcoin & altcoin balances/addresses listing dumps: https://balances.crypto-nerdz.org/
crofrihosl
Jr. Member
*
Offline Offline

Activity: 56
Merit: 3


View Profile
September 15, 2019, 11:44:29 PM
 #7

is there an alternative script for windows  Huh

Code:
some script > myAddyList.txt > balances-bitcoin > final.txt
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
September 16, 2019, 06:34:17 PM
 #8

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

crofrihosl
Jr. Member
*
Offline Offline

Activity: 56
Merit: 3


View Profile
September 16, 2019, 09:49:27 PM
 #9

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

bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
September 17, 2019, 05:01:54 PM
 #10

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.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!