1

Online wallets like Coinbase hold private keys for users. How does it work internally? Does Coinbase generate a private key/address for each of its millions of users and thus keep track of millions of private keys?

Or does it only store all funds in a few keys/addresses and store users' balances in a database? If this is the case, how come every user has a unique address?

1

You can create multiple public keys from one private key. Exchanges control the private key but you control the public key. Rember that a blockchain keeps a record of spent and unspent transactions - there is technically no coins "in your wallet" - your balance is the difference in these two numbers.

When ETH is transferred to your public address, it is tied to your account through the exchange's DB, and the fact thay the receiving private key can reproduce and transact for all public keys but not the other way around, you could never "tap into" the other users public keys that were created from the private key. The public address is visible on the blockchain, so the network can confirm the change in transactions for your specific address, but the coins are linked to the private key (exchange).

When you sign up for an exchange you accept a public wallet address that pulls from and sends to a private address which is held by the exchange. Your balance is available because the public keys also provide transaction data and that is what is linked to your account.

0
  • All funds are stored centrally in one account.
  • Every user has his/her own ethereum account for ethereum transactions.

Lets look at it in detail.

When one user wants to deposit ether to his account, he is asked to deposit into his ethereum address. Coinbase transfers those ethers to one central account and then logs in its database that the following user's balance has been updated.

  • The "one central account" is controlled by Coinbase and a user's account only exists off chain in Coinbase's database, right? Then where does "his ethereum address" come from, HD wallet? – sinoTrinity Mar 14 '18 at 7:06
  • All ethereum accounts exist on chain. User's account is more like a temporary account which is used to receive ether. User's ethereum address is dynamically generated at registration time. – Ayushya Mar 14 '18 at 7:33
  • After a user receives eth to his address, how does Coinbase transfer it to the central account? Does the transfer hit the blockchain? If yes, wouldn’t it be cumbersome? If not, how does it happen between two addresses? – sinoTrinity Mar 14 '18 at 14:50
0

Let me add some more information after @Ayushya's answer. This is of course speculation as I don't happen to run any major exchange myself, but there aren't very many options on how this can work really.

Exchanges do as much as possible with internal bookkeeping. Whatever buys & sells you do happen only inside their own centralized database and no actual cryptocurrency is transferred anywhere. This way they save on transaction costs and speed up the process.

When you want to transfer something to your exchange "wallet" you send it to a wallet which is generated by the exchange for you. So the exchange basically generates a private key and checks its corresponding public address. Whenever the exchange notices that the wallet receives assets it uses the wallet's private key to transfer the assets forward into its internal hot wallets for safekeeping. This transfer happens in the blockchain.

When you want to transfer assets out of the exchange the process is simpler - you just receive the assets from the how wallets.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.