<p>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.</p>
<blockquote>
<p>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.</p>
</blockquote>
<p>You will copy your <em>bitcoin address</em> 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.</p>
<p>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, <a href="https://bitcoin.stackexchange.com/questions/103211/why-does-my-withdrawal-fee-not-match-the-transaction-fee-im-seeing-on-a-block-e/103214#103214">Coinbase will likely just present you with a fee</a>, which could include both a network transaction fee portion, and a Coinbase service fee portion).</p>
<blockquote>
<p>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.</p>
</blockquote>
<p>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 '<a href="https://bitcoin.stackexchange.com/questions/96822/why-is-there-change-in-bitcoins/96832#96832">unspent transaction output</a>' (UTXO), that is locked to an address that is derived from a private key, which your wallet holds.</p>
<blockquote>
<p>I can repeat this process as many times as I like, continuing to accumulate more BTC in exchange for USD via Coinbase.</p>
</blockquote>
<p>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 <a href="https://bitcoin.stackexchange.com/questions/1195/how-to-calculate-transaction-size-before-sending-legacy-non-segwit-p2pkh-p2sh">this question for info on fee calculations</a>, and <a href="https://bitcoin.stackexchange.com/questions/67680/segwit-transaction-fee-byte/67682#67682">this one for fee info related to segwit transactions</a>.</p>
<blockquote>
<p>I can do this by using Ledger Live as described on the ledger website here. Is this still &quot;offline&quot;? even when I &quot;unlock and connect&quot; my ledger device?</p>
</blockquote>
<p>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.</p>
<blockquote>
<p>I use ledger live to send BTC to my Coinbase &quot;hosted wallet&quot; public key. When the transaction is processed I can sell my BTC on Coinbase market at the market value.</p>
</blockquote>
<p>Again, you'll send to a <em>bitcoin address</em>, 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).</p>
<blockquote>
<p>how is my private key being used when I send BTC using ledger live? I think it is used to &quot;sign&quot; the transaction? So in some way is my private key vulnerable to nano ledger programming or software when sending?</p>
</blockquote>
<p>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.</p>
<p>Hope that helps!</p>

CC BY-SA 4.0
2021-03-05T18:19:22.913Z
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
CC BY-SA 4.0
2021-03-05T19:12:40.510Z
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
CC BY-SA 4.0
2021-03-05T19:13:46.167Z
Then what do people mean “not your keys, not your coins”? Which keys are they referring to
Prince M
CC BY-SA 4.0
2021-03-05T19:17:09.067Z
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
CC BY-SA 4.0
2021-03-05T06:26:37.633Z
2021-03-05T06:26:37.633Z
chytrik
<p>2 thoughts on your understandings,</p>
<ul>
<li>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).</li>
<li>there are multiple public address types (P2PKH, P2SH, and bech32 - see invoice address link below), and not all exchanges support all types.</li>
</ul>
<p><a href="https://en.bitcoin.it/wiki/Invoice_address" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Invoice_address</a></p>

CC BY-SA 4.0
2021-03-05T18:16:59.600Z
Thanks for your answer!
Prince M
CC BY-SA 4.0
2021-03-05T08:11:50.807Z
2021-03-05T08:11:50.807Z
watermelon
<p>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).</p>
<p>I have been investigating Coinbase and hardware wallets like Nano Ledger S.</p>
<p>My understanding is that Coinbase is an exchange or market place where BTC can be bought and sold, but also offers wallet services.</p>
<p>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)</p>
<p>If my understanding above is correct, I would like to now understand the way transactions take place between the two concepts listed above.</p>
<ol>
<li>I purchase X BTC on coinbase and it goes to my &quot;hosted wallet&quot; on Coinbase (X used as a variable representing the amount of BTC)</li>
<li>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.</li>
<li>Coinbase broadcasts the transaction in the P2P network, sent around through full nodes in the network.</li>
<li>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.</li>
</ol>
<p>I can repeat this process as many times as I like, continuing to accumulate more BTC in exchange for USD via Coinbase.</p>
<ol start="5">
<li>Eventually, maybe I want to liquidate some BTC in exchange for USD.</li>
<li>I can do this by using Ledger Live as described on the
ledger website <a href="https://support.ledger.com/hc/en-us/articles/360000617934-Send-crypto-assets" rel="nofollow noreferrer">here</a>. Is this still &quot;offline&quot;? even when I &quot;unlock and connect&quot; my ledger device?</li>
<li>I use ledger live to send BTC to my Coinbase &quot;hosted wallet&quot; public key. When the transaction is processed I can sell my BTC on Coinbase market at the market value.</li>
</ol>
<p>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 &quot;sign&quot; the transaction? So in some way is my private key vulnerable to nano ledger programming or software when sending?</p>
<p>I understand this is <em>very</em> 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.</p>

<transactions><coinbase.com><sending><hardware-wallet><ledger-hardware-wallet>
Coinbase & Hardware wallet relationship
Prince M
# Coinbase & Hardware wallet relationship

(Asked by: username_0 on 2021-03-05)

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.

5. Eventually, maybe I want to liquidate some BTC in exchange for USD.
6. I can do this by using Ledger Live as described on the
   ledger website [here](https://support.ledger.com/hc/en-us/articles/360000617934-Send-crypto-assets). Is this still "offline"? even when I "unlock and connect" my ledger device?
7. 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.

**Tags:** transactions, coinbase.com, sending, hardware-wallet, ledger-hardware-wallet


---

## 2 answers

### Answer by username_1 on 2021-03-05. Score: 2 | Accepted answer

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](https://bitcoin.stackexchange.com/questions/103211/why-does-my-withdrawal-fee-not-match-the-transaction-fee-im-seeing-on-a-block-e/103214#103214), 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](https://bitcoin.stackexchange.com/questions/96822/why-is-there-change-in-bitcoins/96832#96832)' (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](https://bitcoin.stackexchange.com/questions/1195/how-to-calculate-transaction-size-before-sending-legacy-non-segwit-p2pkh-p2sh), and [this one for fee info related to segwit transactions](https://bitcoin.stackexchange.com/questions/67680/segwit-transaction-fee-byte/67682#67682).

> 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!

> **Comments:**
> **username_0**: 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?  
> **username_1**: 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.  
> **username_0**: Then what do people mean “not your keys, not your coins”? Which keys are they referring to  
> **username_1**: 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.  

---

### Answer by username_2 on 2021-03-05. Score: 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>

> **Comments:**
> **username_0**: Thanks for your answer!  

---

