"When spending part of the funds in a paper wallet, why do you risk losing your remaining balance?"
"What is the best way to avoid that?"
There are two considerations when you are spending from a paper wallet.
The first consideration is, if you built that paper wallet securely,
on an offline computer isolated from the internet, when you are spending part of the funds on that wallet,
most of the time that means you have either typed, scanned, or swept the key to an online wallet...
to create that transaction.
When you put the private key online, it is better to spending everything from that paper wallet.
In the worst case, you can simply make the payment and send the rest to a brand-new paper wallet..
that you have created offline.
But [your paper wallet is not as secure as before]; the private key has now been in an online system.
That is one concern. The other concern is, many wallets use change addresses in the background.
When you do a transaction spending from the paper wallet, the UTXO [controlled by] the private key...
will probably be a single UTXO (unspent transaction output).
When you spend from that, unless the amount is exactly what you want to spend, if you spend less,
then your wallet will generate change.
Where does that change go? Well, it won't go back to the private key on the paper wallet.
It goes to a different address in the wallet. Effectively, you have just moved the money from the paper wallet...
to the wallet you used to spend part of the amount.
If you didn't send the change on purpose to a new paper wallet, you have moved the [rest of] the money online,
to a key controlled by an online wallet.
You are no longer operating cold storage. You have turned it into a hot wallet.
So it is best to spend all of it and direct any change, explicitly and deliberately,
to another paper wallet if you want to keep it secure.
Only use a private key from a paper wallet once to move everything. But here is one final thought.
Because of these complexities and how difficult it is to create and manage paper wallet securely,
which we will talk about in another question...
Paper wallets are not as good as hardware wallets for the vast majority of users.
Someone who is very technically sophisticated, with a very good understanding of the security implications...
and Bitcoin technology, can create a very secure paper wallet.
In fact, a paper wallet can be more secure than a hardware wallet if generated correctly.
The problem is, the vast majority of users who are likely to [try], do not understand the technology well enough.
They do not have the necessary skills to implement [a paper wallet] securely and correctly.
They will end up doing something far less secure. It is very difficult to securely create a paper wallet...
offline, and to maintain that security.
The reason hardware wallets are more secure is because they offer ease-of-use.
The security can be achieved by someone who is not a technical expert.
"How can a paper wallet be generated offline?"
Well, paper wallets are basically just keys printed on paper, and the keys themselves are just numbers.
You create private keys by simply picking, or having your computer pick, a number at random.
You don't need to be online in order to produce keys.
No information is exchanged between you and the world in order to produce these random numbers.
As I have said before, you could flip a coin 256 times, write down the binary digits, and you have a private key!
That is a private key, a 256-bit random number.
You could then feed that number to a computer program, produce a public key and bitcoin address,
and now you have [a key] that has never been online.
One of the difficulties with generating paper wallets is, for them to be secure, you need to generate them...
on a computer that does not touch or has never touched the internet, an air-gapped machine.
Then you must [use a] printer that has no memory and has never touched the internet either.
This is an almost impossible task for the vast majority of users, to create this magical air-gapped computer...
and the magical disconnected memory-less printer,
which makes it very difficult to implement paper wallets in practice.
Almost like the instructions for creating a perpetual energy machine. Step one: obtain one kilogram of...
the substance 'unobtainium,' which is all you need -- but you can never obtain it!
How do you generate a paper wallet offline? Step one: obtain a computer that has never been online.
Okay, that is pretty hard. Then initialize that computer with the necessary [firmware and] software,
without connecting it to the internet.
Also, never connect it to memory storage devices that come from a computer which has been online.
That is pretty much impossible [for most people]. Now you will [encounter] all kinds of problems.
We know that USB keys can be infected.
Ideally, you would generate a read-only medium, such as a CD-ROM perhaps.
It becomes very complicated. You will be jumping through hoops to protect that one computer.
But you know what kind of computer has never been online and can generate private keys for you?
A hardware wallet. That is basically what a hardware wallet is.
The instructions for making a paper wallet [essentially] start with: "Build your own hardware wallet."
That is basically what it means when we say, "Create a computer that has never been online."
An air-gapped computer, or configure such a computer.
[That is like] asking people to build their own hardware wallet. I will turn [those intructions] into [fewer] steps.
Buy a hardware wallet. Write down the mnemonic seed that appears on the screen. That is your paper back-up.
That is all you need. It is much easier and actually achievable by most users.