Table of Contents
ToggleIntroduction
Public-key cryptography (PKC) is a technique that allows users to send and receive data and/or crypto assets over a blockchain network without the need for a third party or trusted intermediary to verify these transactions. Public and private keys are an essential part of the whole idea of decentralization and the world of crypto, and it is widely used today by nearly all crypto projects in the market.
Users can use these keys to send and receive crypto to anyone and anywhere at any point in time, in a completely decentralized manner which also happens to be extremely secure. These public and private keys cryptographically fit together as a key pair that can be used to access crypto funds. A private key is one that is kept with the user and not shared with anybody else, while a public key is one that is shared to receive funds from another user of the network. The private key thus becomes extremely important as it is the key to accessing your crypto funds and if anyone else has access to it they will also have access to your funds and you could potentially lose all of it.
It is essentially like a safety deposit box or a bank locker which requires two sets of keys to be unlocked and its contents accessed. While a bank locker uses this concept in a more physical way, this is the cryptographical version of the same concept that uses a complex encoding system to ensure that it cannot be discerned by bad actors.
Read More: What are Crypto Bridges?
So, what Is a Public Key?
A public key is what allows a user to receive crypto transactions from another person on the network. It is a cryptographic code that is paired, or linked to a private key, as mentioned earlier. While the public key can be used to send funds to anyone on the network, to access it you require the corresponding private key.
Thus the public key is the one that can be shared without any worry. Sharing one’s public key doesn’t pose any threat to one’s funds whatsoever as it is mathematically coded and completely secure.
What Is a Private Key?
As mentioned earlier, the private key is the second part of the larger code that is used to access your crypto assets. It is that part of the key that should solely remain with the owner of the crypto assets and should not be shared with anybody whatsoever. Thus, it is crucial that it shouldn’t be shared with anyone as it gives the owner the ability to actually prove their ownership and spend the funds associated with your public address. A private key can take several different forms, ranging from a 256-character binary code, a 64-digit hexadecimal code, a QR code, or a mnemonic phrase too.
Regardless of the form, it generally happens to be a very large number, and for a good reason too. To ensure improved security, a private key consists of a “trapdoor” function which basically means that a private key can be used to generate the public key but it is impossible to do the same the other way around. Thus you can have various public keys connected to one private key.
Private Key |
Public Key |
A private key is one that effectively controls one’s crypto assets. |
A public key is one that is used to share and receive funds from other users. |
A private key cannot be shared with anybody else. |
A public key is meant to be shared with others on the network. |
A private key is one that is encrypted and secured so that only the owner can access their funds. |
A public key simply acts as an address for the user who is trying to transfer funds. |
How do public and private keys work together?
Let us take an example to understand how public and private keys work together. If person A wants to send funds to person B over a blockchain network, person A would need person B’s public key to transfer the funds. Now, say person A has it and sends the funds across, but how will person B receive those?
This is where a concept called “digital signing” comes in. For a transaction on the blockchain to be completed, it needs to be signed. Here’s how it works:
- The sending transaction is encrypted using a public key. This transaction can only be decrypted by the accompanying private key.
- Next, the transaction is “signed” using the private key which proves that the transaction hasn’t been modified. This “digital signature” is generated through the combination of the private key with the data being sent in the transaction.
- At the end, the transaction can be verified as authentic using the accompanying public key.
Thus, this “digital signature” is important in a transaction over the blockchain to prove one is the owner of the funds. Nodes on a blockchain network check and authenticate transactions automatically, and any unauthenticated transactions get rejected by the network. And since all of this is happening on a distributed immutable ledger, an authentic, mined transaction on the blockchain is totally irreversible.
Additional Read: What is Blockchain Sharding?
So, where are your private keys?
Private keys are generally assigned to the custodian of the crypto assets under consideration. Hence, if you have a crypto wallet – the private key is linked directly to that crypto wallet and does not exist anywhere else on the blockchain network. However, if you have bought and stored crypto assets on a crypto exchange, especially if it is a centralized exchange, then the private keys and thus your crypto assets are in the custody of the exchange and not actually in your custody. It is akin to trusting your precious stuff like gold or other important documents in a bank by keeping those stuff in a bank locker or vault.
Alternatively, what can also be done is transfer your crypto assets from the exchange wallet to a non-custodial crypto wallet then effectively you become the owner of the private keys and thus, your crypto assets.
Conclusion
Thus, being participants in the crypto ecosystem, which is run on the basis of code and devoid of human intervention, understanding the principles that govern this kind of ecosystem becomes extremely important. And the concept of public and private keys forms the basis for all cryptographic transactions occurring over the blockchain network, making it all the more important for a user to understand the concept to be able to properly safeguard their own funds.
FAQ
What is the difference between public key and private key?
The main difference between a private and a public key is in the name. While a private key is meant for private use and not to be shared with anyone else, the public key however is to be shared with others if you wish to receive crypto from them.
How does private key and public key work?
A public key is derived from a private key through a complicated mathematical process that results in the entire system being very secure and away from prying eyes.
Related posts
Hot Wallets vs Cold Wallets Explained: Choosing the Right Crypto Wallet
Explore the pros, cons, and use cases of hot and cold wallets to protect your crypto assets.
Read more
Top 6 Crypto Day Trading Strategies you Need to Know About!
Mastering day trading crypto to ride volatility & make profits.
Read more