Reading the questions and answers on this StackExchange, i've learned that into Exchanges there's no transactions over public blockchains being performed, the funds are exchanged among accounts into the Exchange and a database seems to register and tracking the credited and debited funds of any internal transactions occurred. But, when one wants to withdraw his funds, move them to another exchange or move to a properly wallet, whether it being BTC or any other Altcoin, how does all that information are registered on Blockchain as a lot of other ones were done only internally on an Exchange?
From the point of view of the blockchain there are just 2 transactions: one going into an exchange address the other is going out of an exchange address.
- You sent 0.1 btc to an exchange [recorded on blockchain]
- Some other people send other amounts to that exchange (exchange controls all these addresses) [recorded on blockchain]
- You make 0.05 btc on a trade (that means somebody else lost that 0.05 btc) [NOT recorded on blockchain]
- You withdraw 0.15 btc minus any trading fees
- Exchange sends yours 0.1 btc + somebody else's 0.05 btc to you (they might use a couple of addresses that they sent from, or they might use a cold storage address) [recorded on blockchain]
The only transactions that are recorded on the blockchain are 0.1 btc from you, other deposits from other people, and you withdrawal of 0.15 btc as per example above. Any trades that are happening on the exchange are happening in their own database.
Also exchanges might consolidate balances into hot or cold address. So you might notice that after you sent 0.1 btc to an address that an exchange provided to you, that 0.1 immediately left that address to an address that has a large balance, but your funds are still displaying on your exchanges's account. That is because it is now handled by their internal database.
The information that ends up on the blockchain is the balance of all the payments between us.
Imagine I commit to up to $200 going to you, and you do the same to me. That's the opening transaction on the blockchain. If I send you $100, and you send me $80, that's just between you and me. All the blockchain cares about is what happened to the final $20: in the closing transaction on the blockchain, that $20 is seen being sent from me to you.
Very simplified :-)