<ol>
<li><p>Based on the address the binance gave you, after they sweep the funds into their hotwallet, you can run common-input heuristic on this deposit address (assuming it was swept in with other inputs). The more addresses and sweeps, the better the accuracy and amount of addresses in the final (result) set. 
<a href="https://en.bitcoin.it/wiki/Privacy#Common-input-ownership_heuristic" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Privacy#Common-input-ownership_heuristic</a></p></li>
<li><p>Based on the binance hotwallet you can also assume that all addresses that inputs into this hotwallet are deposit addresses.</p></li>
</ol>

<p>Having set of all (assumed) addresses of binance you can run basic script to see balances in/out.</p>

CC BY-SA 4.0
2020-05-19T19:28:09.117Z
Thanks! This was helpful. Updated the OP, included some code. If you know how to do this exactly (ie what script to run), that would be great.
zabop
CC BY-SA 4.0
2020-05-19T18:31:24.397Z
2020-05-19T18:31:24.397Z
Tony Sanak
<p>I find this page <a href="https://bitinfocharts.com/bitcoin/wallet/Binance-wallet" rel="nofollow noreferrer">here</a>, which tells me how much BTC is deposited to Binance. How does this (or a similar) page work?</p>

<p>When I deposit BTC to Binance, I am given an address, which I am fairly sure it's unique (since it doesn't ask other information to be supplied, so if it is not unique, I wouldn't be able to be identified).</p>

<p>How can I check that bitinfocharts is right? I know that on <a href="https://www.blockchain.com/btc/address/1BF8SHKnT8ZysYNrj5toeu6DsuGE5XDcCR" rel="nofollow noreferrer">blockchain.com</a> I can check the balance of an address, but what balance should I use if I am interested in Binance's balance?</p>

<hr>

<p><strong>Update</strong></p>

<p>A function which takes a given block, and computes the net flow of BTC to each address:</p>

<pre><code>import requests

def netbtcflow(blocknum):

    r = requests.get('https://blockchain.info/block-height/'+str(blocknum)+'?format=json')
    data = r.json()



    transactions = [{} for x in range(len(data['blocks'][0]['tx']))]
    for transactionindex, eachtransaction in enumerate(data['blocks'][0]['tx']):
            address=[]
            amount=[]
            for eachrecipient in eachtransaction['out']:
                try:
                    address.append(eachrecipient['addr'])
                except KeyError:
                    address.append('KEYERROR')
                amount.append(eachrecipient['value']/100000000)

            try:
                transactions[transactionindex]['from']=eachtransaction['inputs'][0]['prev_out']['addr']
            except KeyError:
                transactions[transactionindex]['from']='KEYERROR'
            transactions[transactionindex]['to']=[address, amount]

    netflowdict=[{} for x in range(len(transactions))]
    for txindex, eachtx in enumerate(transactions):
        #if eachtx['from']!='KEYERROR':
        if True:
            for recipaddress, recipamount in zip(*eachtx['to']):
                if eachtx['from']!=recipaddress:
                    netflowdict[txindex]=[recipaddress, recipamount]

    netflowdict=[each for each in netflowdict if bool(each)]

    netflowdictunique=dict((each[0],0) for each in netflowdict)
    for each in netflowdict:
        netflowdictunique[each[0]]+=each[1]

    netflowdict=netflowdictunique

    return transactions, netflowdict
</code></pre>

<p>There are problems with this, for example <a href="https://stackoverflow.com/questions/61880129/why-does-blockchain-com-api-only-return-recipient-base58-addresses-and-omits-bec">this one</a>. Would be interested in how to do the method outlined in <a href="https://bitcoin.stackexchange.com/a/96029/106152">this answer</a> exactly (ie I would need the Ptyhon script). The above code might be helpful, will update the post if I get it to work.</p>

<transactions><python><binance><deposit>
How can bitinfocharts.com know the changes in BTC deposited to Binance?
zabop
# How can bitinfocharts.com know the changes in BTC deposited to Binance?

(Asked by: username_0 on 2020-05-19)

I find this page [here](https://bitinfocharts.com/bitcoin/wallet/Binance-wallet), which tells me how much BTC is deposited to Binance. How does this (or a similar) page work?

When I deposit BTC to Binance, I am given an address, which I am fairly sure it's unique (since it doesn't ask other information to be supplied, so if it is not unique, I wouldn't be able to be identified).

How can I check that bitinfocharts is right? I know that on [blockchain.com](https://www.blockchain.com/btc/address/1BF8SHKnT8ZysYNrj5toeu6DsuGE5XDcCR) I can check the balance of an address, but what balance should I use if I am interested in Binance's balance?

---

**Update**

A function which takes a given block, and computes the net flow of BTC to each address:

```
import requests

def netbtcflow(blocknum):

    r = requests.get('https://blockchain.info/block-height/'+str(blocknum)+'?format=json')
    data = r.json()

    transactions = [{} for x in range(len(data['blocks'][0]['tx']))]
    for transactionindex, eachtransaction in enumerate(data['blocks'][0]['tx']):
            address=[]
            amount=[]
            for eachrecipient in eachtransaction['out']:
                try:
                    address.append(eachrecipient['addr'])
                except KeyError:
                    address.append('KEYERROR')
                amount.append(eachrecipient['value']/100000000)

            try:
                transactions[transactionindex]['from']=eachtransaction['inputs'][0]['prev_out']['addr']
            except KeyError:
                transactions[transactionindex]['from']='KEYERROR'
            transactions[transactionindex]['to']=[address, amount]

    netflowdict=[{} for x in range(len(transactions))]
    for txindex, eachtx in enumerate(transactions):
        #if eachtx['from']!='KEYERROR':
        if True:
            for recipaddress, recipamount in zip(*eachtx['to']):
                if eachtx['from']!=recipaddress:
                    netflowdict[txindex]=[recipaddress, recipamount]

    netflowdict=[each for each in netflowdict if bool(each)]

    netflowdictunique=dict((each[0],0) for each in netflowdict)
    for each in netflowdict:
        netflowdictunique[each[0]]+=each[1]

    netflowdict=netflowdictunique

    return transactions, netflowdict

```

There are problems with this, for example [this one](https://stackoverflow.com/questions/61880129/why-does-blockchain-com-api-only-return-recipient-base58-addresses-and-omits-bec). Would be interested in how to do the method outlined in [this answer](https://bitcoin.stackexchange.com/a/96029/106152) exactly (ie I would need the Ptyhon script). The above code might be helpful, will update the post if I get it to work.

**Tags:** transactions, python, binance, deposit


---

## 1 answers

### Answer by username_1 on 2020-05-19. Score: 2

1. Based on the address the binance gave you, after they sweep the funds into their hotwallet, you can run common-input heuristic on this deposit address (assuming it was swept in with other inputs). The more addresses and sweeps, the better the accuracy and amount of addresses in the final (result) set.
   <https://en.bitcoin.it/wiki/Privacy#Common-input-ownership_heuristic>
2. Based on the binance hotwallet you can also assume that all addresses that inputs into this hotwallet are deposit addresses.

Having set of all (assumed) addresses of binance you can run basic script to see balances in/out.

> **Comments:**
> **username_0**: Thanks! This was helpful. Updated the OP, included some code. If you know how to do this exactly (ie what script to run), that would be great.  

---

