<p>A hardware wallet only has responsibility for handling private keys. This includes generating addresses (when receiving), and signing transactions (when sending). It needs some sort of communication with the outside world to do this. There's multiple hardware wallets on the market, and they don't all operate the same way. However, the principles are the same. </p>

<p>1) <strong>How is the transaction broadcast?</strong> After the transaction is signed, the hardware wallet can export this in raw format. Anyone connected to the Bitcoin P2P network can then broadcast this raw transaction. One way of doing this is through <code>bitcoin-cli sendrawtransaction</code>. Another one is through a web wallet interface. This is typically provided by hardware wallet manufacturers. </p>

<p>2) <strong>How does a hardware wallet query the blockchain? It</strong> doesn't. It has to have an external source of information about this. This could either be a full node like <code>bitcoind</code>, or a lightweight SPV wallet like Electrum. </p>

<p>Common for both of these are that the hardware wallet needs to communicate with something externally. Trezor and Ledger does this by USB connected to your phone or computer (some Ledger models also have bluetooth), Coldcard uses micro SD cards. </p>

CC BY-SA 4.0
2019-12-16T14:49:20.817Z
Thanks for reply :) you mean that hardware wallet should have another software to process operation like query in the bitcoin network. in other word, the manufacturer simplified bitcoind by removing store the blocks locally and keep up p2p communication.
Hyunsoo
CC BY-SA 4.0
2019-12-16T15:47:45.460Z
A hardware wallet is a bad name. It isn't a wallet at all, it's an offline signing device. When you use it, your (software, online) wallet prepares an unsigned transaction based on the payment you want to perform, and then gives it to the hardware wallet to sign. It gets back a fully signed transaction, which can be broadcast.
Pieter Wuille
CC BY-SA 4.0
2019-12-16T09:49:42.673Z
2019-12-16T09:49:42.673Z
torkel
<blockquote>
  <p>Hardware wallet has more security than software wallet because they
  store private key in offline hardware, which online attackers cannot access. Thus, they sign
  in the hardware and then send the transaction with signature out to Bitcoin network.</p>
</blockquote>

<p>At this points, I'm wondering some stuff:</p>

<ol>
<li><strong>If user make a payment, who broadcasts the transaction into the Bitcoin network?</strong> I know that hardware wallets has no Bitcoin node software that can communicate with peers. So who is responsible for this work?</li>
<li><code>bitcoin-cli</code> is a program for querying a <code>bitcoind</code> node, but hardware wallets has no blockchain similar database thus, <strong>it can't query any information locally. How does hardware wallets check their transaction state?</strong> </li>
</ol>

<transactions><hardware-wallet>
How do hardware wallets communicate with the outside world?
Hyunsoo
# How do hardware wallets communicate with the outside world?

(Asked by: username_0 on 2019-12-16)

> Hardware wallet has more security than software wallet because they
> store private key in offline hardware, which online attackers cannot access. Thus, they sign
> in the hardware and then send the transaction with signature out to Bitcoin network.

At this points, I'm wondering some stuff:

1. **If user make a payment, who broadcasts the transaction into the Bitcoin network?** I know that hardware wallets has no Bitcoin node software that can communicate with peers. So who is responsible for this work?
2. `bitcoin-cli` is a program for querying a `bitcoind` node, but hardware wallets has no blockchain similar database thus, **it can't query any information locally. How does hardware wallets check their transaction state?**

**Tags:** transactions, hardware-wallet


---

## 1 answers

### Answer by username_1 on 2019-12-16. Score: 6 | Accepted answer

A hardware wallet only has responsibility for handling private keys. This includes generating addresses (when receiving), and signing transactions (when sending). It needs some sort of communication with the outside world to do this. There's multiple hardware wallets on the market, and they don't all operate the same way. However, the principles are the same.

1) **How is the transaction broadcast?** After the transaction is signed, the hardware wallet can export this in raw format. Anyone connected to the Bitcoin P2P network can then broadcast this raw transaction. One way of doing this is through `bitcoin-cli sendrawtransaction`. Another one is through a web wallet interface. This is typically provided by hardware wallet manufacturers.

2) **How does a hardware wallet query the blockchain? It** doesn't. It has to have an external source of information about this. This could either be a full node like `bitcoind`, or a lightweight SPV wallet like Electrum.

Common for both of these are that the hardware wallet needs to communicate with something externally. Trezor and Ledger does this by USB connected to your phone or computer (some Ledger models also have bluetooth), Coldcard uses micro SD cards.

> **Comments:**
> **username_0**: Thanks for reply :) you mean that hardware wallet should have another software to process operation like query in the bitcoin network. in other word, the manufacturer simplified bitcoind by removing store the blocks locally and keep up p2p communication.  
> **username_2**: A hardware wallet is a bad name. It isn't a wallet at all, it's an offline signing device. When you use it, your (software, online) wallet prepares an unsigned transaction based on the payment you want to perform, and then gives it to the hardware wallet to sign. It gets back a fully signed transaction, which can be broadcast.  

---

