What Is a Private Key?
A private key is a sophisticated form of cryptography that allows a user to access his or her cryptocurrency. A private key is an integral aspect of bitcoin and altcoins, and its security make up helps to protect a user from theft and unauthorized access to funds.
Understanding Private Key
When dealing with cryptocurrency, a user is usually given a public address and a private key to send and receive coins or tokens. The public address is where the funds are deposited and received. But even though a user has tokens deposited into his address, he won’t be able to withdraw them without the unique private key. The public key is created from the private key through a complicated mathematical algorithm. However, it is near impossible to reverse the process by generating a private key from a public key.
The private key can take a few different forms, usually depicted as a series of alphanumeric characters, which makes it hard for a hacker to crack. Most users represent their wallet keys in wallet import format, which has 51 characters. Think of a public address as a mailbox, and the private key as the key to the box. The mailman, and anyone really, can insert letters and small packages through the opening in the mailbox. However, the only person that can retrieve the contents of the mailbox is the one that has the unique key. It is, therefore, important to keep the key safe because if it is stolen or gotten without authorization, the mailbox can be compromised.
A digital wallet stores the private key of a user. When a transaction is initiated, the wallet software creates a digital signature by processing the transaction with the private key. This upholds a secure system since the only way to generate a valid signature for any given transaction is to use the private key. The signature is used to confirm that a transaction has come from a particular user, and ensures that the transaction cannot be changed once broadcasted. If the transaction gets altered, even slightly, the signature will change as well.
If a user loses his/her private key, s/he can no longer access the wallet to spend, withdraw, or transfer coins. It is, therefore, imperative to save the private key in a secure location. There are a number of ways that a digital wallet that contains a private key can be stored. Private keys can be stored on paper wallets which are documents that have been printed with the private key and QR code on them so that it can easily be scanned when a transaction needs to be signed.
The private keys can also be stored using a hardware wallet which uses smartcards or USB devices to generate and secure private keys offline. An offline software wallet could also be used to store private keys. This wallet has an offline partition for private keys and an online division which has the public keys stored. With an offline software wallet, a new transaction is moved offline to be signed digitally and then moved back online to be broadcasted to the cryptocurrency network.
These types of storage mentioned above are called cold storage, as private keys are stored offline. The other type of wallet, the hot wallet, stores private keys on devices or systems that are connected to the internet. Examples of these wallets include desktop wallets (e.g., Electrum), mobile wallets (e.g., Breadwallet), and web-based wallets (e.g., Coinbase).
How to keep your private key safe
Thankfully, keeping your private key safe need not be a hassle. It is also possible to establish several back-ups just to be cautious – but it is important that these are kept secure. If anyone lays their hands on it without your authorization or knowledge, they will be able to claim the crypto for themselves without any scrutiny. Here are three top tips for staying protected.
1. Use a hardware wallet
For those nervous about keeping their crypto assets anywhere near an internet connection, a hardware wallet can be a blessing. These physical devices have the sole objective of keeping your coins and tokens safe. This is known as a form of “cold storage”, and manufacturers of this equipment claim they reduce the chance of malware attacks. Some models generate their own private keys, and offer a way of recovering the crypto they hold in the event that the device is lost or stolen. Whereas some hardware wallets are focused solely on Bitcoin, others accept a plethora of cryptocurrencies. It’s always worth performing detailed research before deciding to invest in one of these products – although they have a good track record of keeping crypto safe, it’s crucial to make sure that the manufacturer has a good reputation. A more lo-tech alternative involves storing your crypto private key on a USB stick.
2. Paper wallet
In theory, it is possible for you to write out your private key longhand on a piece of paper, lock it in a safe, and access it when you need it. However, this process is fraught with risks. Given how many characters make up a private key, the slightest error during transcription could mean you’re unable to access your coins. That said, there are nifty tools out there that enable you to print out your public address and private key on a piece of paper, complete with a QR code for easy access.
3. Be cautious with exchanges
Many consumers who can’t get their head around the process of how to get crypto keys often rely on a centralized exchange that does it for them. This can have its perks, but as you would with hardware wallets, due diligence is vital to make sure that the company can be trusted with your funds. As well as having robust security measures to fend off hack attacks – which sadly remain a frequent occurrence to the tune of hundreds of millions of dollars – they require cold storage arrangements that are prepared for every eventuality.
What Is a Public Key?
A public key is a cryptographic code that allows users to receive cryptocurrencies into their accounts. The public key and the private key are the tools required to ensure the security of the crypto economy.
How a Public Key Works
When a user initiates his or her first transaction with bitcoin or altcoins, a unique pair of a public key and a private key is created. Each of the keys consists of a long string of alphanumeric characters that help to keep a user’s holdings secure in the digital ecosystem.
The private key is known to the user alone and serves as the user’s digital ID. The private key authorizes the user to spend, withdraw, transfer, or carry out any other transaction from his or her account. A sophisticated algorithm is applied to the private key to generate the public key, and both keys are stored in a digital wallet.
When a transaction is initiated by a user to send, say bitcoins, to another person, the transaction has to be broadcast to the network where distributed nodes confirm the validity of the transaction before finalizing it and recording it on the blockchain.
Before the transaction is broadcast, it is digitally signed using the private key. The signature proves ownership of the private key, although it does not divulge the details of the private key to anyone. Since a public key is fashioned from the private key, the user’s public key is used to prove that the digital signature came from his private key. Once the transaction has been verified as valid, the funds are sent to the recipient’s public address.
The public address is a hashed version of the public key. Because the public key is made up of an extremely long string of numbers, it is compressed and shortened to form the public address. In effect, the private key generates the public key, which, in turn, generates the public address.
When two people enter into an agreement where one sends the other tokens or coins, they reveal their public addresses to each other. The public address is like a bank account number. The sender needs the number to be able to send the funds to the recipient who will then be able to spend or withdraw it with his private key. The recipient can also verify the sender’s batch of coins using the sender’s public address that will be displayed on his or her screen.
Although the public key and address are worked out from the private key, the reverse case is nearly impossible.
The cryptocurrency network stays secure by using complicated mathematical functions to ensure that a private key is not able to be worked out from the public key, especially since the public key and its hash version are seen by everyone on the network.
Since it’s impossible to regenerate the private key from public key or address, if a user loses his private key, any bitcoin or altcoin located at his public address will be inaccessible forever. On the other hand, a user who loses his public key can have it recreated with the private key.