Let me sum it up how Bitcoin's security works in easy to understand language. In my previous article I was talking about the HD wallet's vulnerabilities, that's that, but I saw that many people in the comments still didn't understood how Bitcoin's security works. So let me explain it to you in simple terms how it works.
I've known about this for at least 2 years, this was the first thing I was interested in: security of my money, I can't believe most people don't educate themselves about this, because this should be the first thing to do when you are investing in something.
The security of a cryptographic system is called Entropy, it measures how much information there is in a system, in other words how complex something is. When we are talking about passwords and private keys, the complexity matters very much since the more complex something is, the harder it is to crack. The measurement unit is called
In Bitcoin you have 2 layers of separation between your money and a thief. If these 2 layers were weak, then the thief could easily steal your money. You have 3 items:
- Private Key = The actual secret key that spends the money on your address, it grants full access to the money on that address.
- Public Key = Derived from the private key, it is used in the signing operations.
- Bitcoin Address = Derived from the public key, it is used to transfer money.
So the public key adds 1 layer of protection of 128 bits, and the address adds another layer of protection of total 160 bits. The ECDSA generates the public key from the private key, and the ripemd160 generates the address from the public key. Roughly it works like this, if you want a more detailed explanation you can check out the Bitcoin Wiki.
A security of 128 bits is impossible to crack with normal computers, so normally a public key is enough distance from your money and the thief, however it is not quantum computer resistant. Quantum computers don't exist yet, but when they will, it will be able to crack a public key and reverse engineer the private key from it.
Therefore ECDSA is not enough to protect you against a quantum hacker, that is why the Bitcoin address adds another layer of security to your money. It adds 32 more bits of security and key stretching to that it will become quantum resistant.
The maximum security you can have is 160 bits, which is enough to protect your money against a quantum computer, and all other computer cracking.
How to Maintain the Security
You can lose the 160 bit security easily if the public key gets revealed, which can happen in the following ways:
- You create an outgoing transaction from an address
- You sign your address with the signing mechanism implemented in various wallets
- You give out your public key voluntarily
This is why I emphasized that Bitcoin addresses should not be reused. If you have a big stack of Bitcoins, send it to an address of yours that was not used before, and whenever you spend money from it, you should send back the remaining change to a new address of yours. Or just use Electrum Wallet, that does this automatically when you spend.
If you expose the
public key in any way, your coins are only 128-bit secure, which is secure for now, but it won't be once quantum computers will be invented. Of course all this security falls apart if you generated your private key in an insecure way, so before all this, make sure of the following:
- You don't have malware/virus on your computer: Why bother cracking the public key, when a hacker can just put a trojan virus on your PC and steal the private key itself? So make sure you are protected.
- You have generated the private key in a secure way:
- A good random number generator
- In offline mode. Generating keys online in a web-browser is very very bad.