1

Aside from learning about all of bitcoin just for fun (mathematician with spare time), I currently own some bitcoin IOU's via Robinhood, but I would like to actually own my bitcoin (my keys, my coins! As they say).

I have been investigating Coinbase and hardware wallets like Nano Ledger S.

My understanding is that Coinbase is an exchange or market place where BTC can be bought and sold, but also offers wallet services.

My understanding of a hardware wallet like Nano Ledger S is that it is a very secure hardware device (cold storage, meaning completely offline) that will store the public and private key to my BTC wallet - and the private key to my wallet is synonymous with the bitcoin I hold. It has a 20 word mnemonic so if I hypothetically lost the device, I could buy a new one and access my wallet using the 20 word mnemonic. (I would also like to understand how buying a new Nano Ledger S and entering my mnemonic allows it to essentially restore to my old wallet, it seems like this would require the information to be stored somewhere. But I'll save that for a different question later on)

If my understanding above is correct, I would like to now understand the way transactions take place between the two concepts listed above.

  1. I purchase X BTC on coinbase and it goes to my "hosted wallet" on Coinbase (X used as a variable representing the amount of BTC)
  2. I can send the X BTC I purchased to my hardware wallet by giving the public key to my hardware wallet and specifying perhaps .99X BTC go to that wallet and the remaining .01 BTC is left as the transaction fee.
  3. Coinbase broadcasts the transaction in the P2P network, sent around through full nodes in the network.
  4. When this transaction gets grouped into a block and is mined, my wallet now contains .99X BTC meaning my public key shows up somewhere on the blockchain ledger that I have .99X unspent BTC associated to my public key.

I can repeat this process as many times as I like, continuing to accumulate more BTC in exchange for USD via Coinbase.

  1. Eventually, maybe I want to liquidate some BTC in exchange for USD.
  2. I can do this by using Ledger Live as described on the ledger website here. Is this still "offline"? even when I "unlock and connect" my ledger device?
  3. I use ledger live to send BTC to my Coinbase "hosted wallet" public key. When the transaction is processed I can sell my BTC on Coinbase market at the market value.

Is my understanding correct? And if so, how is my private key being used when I send BTC using ledger live? I think it is used to "sign" the transaction? So in some way is my private key vulnerable to nano ledger programming or software when sending?

I understand this is very amateur material, I have tried hard to learn on my own without asking here, but the quality of answers on this site, so far, have proven better than anything I have found on my own.

2

Your understanding is largely correct. I'll nitpick a few points for clarity, but overall I would say you have a decent grasp of whats going on here.

I can send the X BTC I purchased to my hardware wallet by giving the public key to my hardware wallet and specifying perhaps .99X BTC go to that wallet and the remaining .01 BTC is left as the transaction fee.

You will copy your bitcoin address to coinbase, not your public key. (In most cases, they 'pay-to-public-key-hash' (P2PKH) address is, as the name suggests, a hash of the public key). Your wallet will display bitcoin addresses, not public keys, so this is just a matter of terminology.

I am not familiar with Coinbase's interface, but there should be some sort of 'withdraw all' function. You will likely not need to specify a fee (in reality, Coinbase will likely just present you with a fee, which could include both a network transaction fee portion, and a Coinbase service fee portion).

When this transaction gets grouped into a block and is mined, my wallet now contains .99X BTC meaning my public key shows up somewhere on the blockchain ledger that I have .99X unspent BTC associated to my public key.

Wallets do not contain BTC. Wallets contain private keys, which can be used to sign transactions that spend coins which are locked to their associated bitcoin address. Once the transaction confirms, nodes on the network will be aware of an 'unspent transaction output' (UTXO), that is locked to an address that is derived from a private key, which your wallet holds.

I can repeat this process as many times as I like, continuing to accumulate more BTC in exchange for USD via Coinbase.

Yes, though when you eventually want to spend the coins, remember that it is more expensive to create a transaction which includes many small inputs, rather than just one or two larger inputs. See this question for info on fee calculations, and this one for fee info related to segwit transactions.

I can do this by using Ledger Live as described on the ledger website here. Is this still "offline"? even when I "unlock and connect" my ledger device?

The device connects to your computer via USB, and has a very restricted protocol for talking over the USB cable. Your private keys exist on the Ledger, and never leave the Ledger, so this is a more safe way of transacting, then just keeping the private keys on a device which is connected to the internet itself. The transaction can be created using software on your computer, and then that transaction is transmitted to the Ledger, signed, and the signed transaction is then transmitted back to your computer. Some other hardware wallets use different methods of communicating this data back and forth (eg SD card, QR codes, etc), but the general workflow will be the same.

I use ledger live to send BTC to my Coinbase "hosted wallet" public key. When the transaction is processed I can sell my BTC on Coinbase market at the market value.

Again, you'll send to a bitcoin address, but otherwise, this is correct. Note that when sending to coinbase, you will have more control over the transaction fee (and there will be no service fee, like there may be when you withdraw from an exchange).

how is my private key being used when I send BTC using ledger live? I think it is used to "sign" the transaction? So in some way is my private key vulnerable to nano ledger programming or software when sending?

Your private key will remain on the Ledger device, so you need to confirm the transaction looks correct, via the prompts on the device's screen. You should follow the hardware wallet manufacturer's instructions to ensure that you have received an authentic device from a legitimate retailer, and that it is running legitimate and up to date firmware.

Hope that helps!

5
  • Thanks, I was hoping someone would nitpick my explanations. I didn't know about the fee for many inputs vs few inputs. Lastly, would it be correct to say my "wallet" is synonymous with the ECDSA public/private key pair, but all of my "bitcoin" is also associated to private keys?
    – Prince M
    Mar 5 at 18:19
  • A wallet will contain many keypairs, but I would not call the two ‘synonymous’. I think that saying your bitcoin is ‘associated to your private keys’ is maybe a little strange, but not incorrect. Note that only you will be aware of this association though, of course. The rest of the network could perhaps be said to associate your coins with the addresses they are locked to.
    – chytrik
    Mar 5 at 19:12
  • Then what do people mean “not your keys, not your coins”? Which keys are they referring to
    – Prince M
    Mar 5 at 19:13
  • That does refer to private keys. If you aren’t holding your private keys, then you are depending on someone else to spend your coins for you, when you want to spend them. I mentioned that saying the coins are ‘associated’ with a private key is a little strange, just because only you should be aware of that association, and that private key. So from the viewpoint of an unrelated third party, they would not have any knowledge of which private key a certain coin (output) might be associated with.
    – chytrik
    Mar 5 at 19:17
  • Ok, got it! Thanks for your help
    – Prince M
    Mar 5 at 19:18
1

2 thoughts on your understandings,

  • custodial sites such as Coinbase use a pre-configured transaction fee, when using the Ledger it will probably give you a few options to choose from (i've never used a Ledger).
  • there are multiple public address types (P2PKH, P2SH, and bech32 - see invoice address link below), and not all exchanges support all types.

https://en.bitcoin.it/wiki/Invoice_address

1
  • Thanks for your answer!
    – Prince M
    Mar 5 at 18:16

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.