pull down to refresh

I know using Bitcoin offline is still a hurdle to jump over. Before I ask this likely stupid question, be aware that I have very little knowledge of programming, security, etc.
What's stopping a current or potential wallet from saving the current state of someone's balance while it is still online and then setting the correct protocol rules for offline use to ensure that a transaction is valid on the Bitcoin network? And then still deducting the amount paid/received from the balance via Bluetooth, NFC, etc while only then broadcasting the transactions at a later time?
Again, I'm very stupid.
the current state of someone's balance
The bitcoin protocol doesn't have a concept of a "balance". Bitcoin uses "UTXO"s. A wallet will show a sum of all unspent UTXOs for all bitcoin addresses for that wallet as the "balance", but underneath, it's all UTXOs.
So an offline computer or device can't know what UTXOs it can spend without seeing the blocks and the mempool. So what works instead is having two devices. On is a connected device that prepares a transaction to spend and then a second, offline device, to sign that transaction. Thus, to do this the "partially signed bitcoin transaction" (PSBT) was created.
So that way you can have something like an Electrum wallet app offline (airgapped), and then another Electrum wallet online, which is the "watch only wallet" without the keys. The watch only wallet creates the transaction needing to be signed, and that transaction is transferred to the airgapped Electrum (e.g., via thumb drive) for signing, and then the signed transaction is brought back to the watch-only wallet and broadcast from there.
Now there are also signing devices that are also offline and airgapped. A poorer term for them would be a "hardware wallet", but they are not actually wallets, they are signing devices.
Here's an article describing airgap security, which might help you with further information.
Does airgap make Bitcoin hardware wallets more secure? https://shiftcrypto.ch/blog/does-airgap-make-bitcoin-hardware-wallets-more-secure
reply
  1. Use always an open source wallet app software. That means, other people with coding knowledge could check the app code for possible leaks.
  2. I don't understand your question about "transacting offline". Bitcoin transaction need to be confirmed online (are many different ways to check that). If is an onchain tx or LN tx both will have to have at least a confirmation. The only real offline transaction could be using OpenDimes, physical devices where keys of a bitcoin address are stored and even those have a very good mechanism to check if the keys were used or not.
  3. Even if your wallet app is fishy, you can check any tx you've done on any block explorer. Are many, for example: https://mempool.space or https://blockstream.info and see if is validated or not.
All information required to know how to use a BTC/LN wallet is there.
reply