If I use a service such as Coinbase to buy Bitcoin, Coinbase generates
a BC address for me and that's recorded in the blockchain.
No, it's not recorded in the blockchain, but in their own systems, basically they associate that address to your coinbase account
If I convert to fiat (i.e., USD) all BC at the address and send that
USD to my bank account, Coinbase records that in my account. Since my
account with Coinbase is private, only I know I have cashed out.
But how is that "cash out" and transfer to my bank account recorded in the blockchain
Does the blockchain show it is a cash out from Coinbase?
the address(es) coinbase create for you, are just used to know, in case you deposit funds on your account, where you can send that money to, but it's not used for anything else
Basically they associate in their own system that :
- your account A is associated to
AddressX
- when you want to deposit funds to coinbase, you have to send BTC to that
AddressX
Coinbase then have software that monitor addresses they owns, like AddressX (because not your key, not your money, so technically AddressX is coinbase address,not your)
When they see that a deposit has been done on your AddressX, they update their system (aka their (R)DBMS where they store their users data) and add the received BTC to your Account balance, then very likely they move funds from AddressX to a cold storage wallet (but this may vary) because BTC rarely are left on the deposited address but moved somewhere safer
When you then want to convert, they have just to send FIAT to your bank account and update your account balance, without moving any funds at all (even if I think they move funds not associated to users somewhere else, but this is just a guess and anyway it's an implementation detail)
Basically your AddressX can just be considered like a door to enter in their system, nothing more, and the balance that you see listed on that AddressX is not guaranteed to be the value you have in your coinbase account.
--
A proof that a strict relation between AddressX and your Coinbase account balance
doesn't exists is easily verifiable by looking a transaction when you WITHDRAW from coinbase to some other BTC wallet, in that case you'll see that the INPUTS used to generate the transaction to move funds, aren't related to AddressX