Log In
CoinEx Academy

What Are Crypto Keys: Public Keys and Private Keys?

2022-09-02 14:02:00

As a cryptocurrency investor or enthusiast, understanding cryptocurrency keys is essential. Cryptocurrency keys give users access to their cryptocurrency wallet and allow users to send and receive cryptocurrency. The technology used to develop blockchain, the cryptocurrency framework, is called public-key cryptography. Public key cryptography uses a pair of keys called the public key and the private key. What are public and private keys? Why are cryptocurrency keys so essential in cryptocurrency and how do they work? We'll look into these.

Consider the public key a bank account number, and the private key a password a user can use to prove the account ownership. A cryptocurrency key for an account is totally independent of the blockchain protocol. It can be created and managed by the user's hardware or software cryptocurrency wallet without any reference to the blockchain or without Internet access for hardware wallets. Most blockchain properties that power cryptocurrency, such as decentralization, trust, transparency, security, and non-custodial, are facilitated by cryptocurrency keys.

Public Key Cryptography

Public Key Cryptography is a method of encrypting data using key pairs that are mathematically related but not identical. These key pairs are the private key, the signing key, and the public key. Data is encrypted with a public key and decrypted with a private key. This is a one-way function, meaning that while a public key can be calculated and generated from a private key using an algorithm, the reverse is not possible. This algorithm is known as the SHA256 algorithm, SHA256 is one of the most secure and trusted algorithms in cryptography, encrypted SHA256 data can never be decrypted without the private key. When the private key decrypts data, the decrypted data is known as signed data. 

Taking an instance, you text a string of data, “Hello”, and pass this data through a Public-Key cryptography account, the public key will encrypt the data to “chBy6UybnJ7cW” and only the private key in the cryptographic keypair can decrypt the encrypted data, thus decrypting “chBy6UybnJ7cW” back to “Hello”. Let’s take a deep dive into these key pairs.

1. The Public Key

A public key is a user's address for receiving cryptocurrency transactions. A public key is comparable to an account number associated with a bank account. A public key is a store of cryptocurrency, and it is paired with a private key, the private key is used to authenticate the received cryptocurrency. Anyone can send cryptocurrency to a public key, only the public key's owner can access the cryptocurrency received by signing into the public key with the private key to prove the user is the owner of the cryptocurrency received in the public key. Several cryptocurrency addresses can be generated from a public key, the purpose of the different addresses is to receive different cryptocurrency tokens from on a blockchain. This applies to blockchains that power cryptocurrency tokens other than their native cryptocurrency. 

2. The Private Key

A private key, like a password, is a generated sequence of bits used in cryptography to decrypt encrypted SHA256 data. Private keys are used in cryptocurrency to sign transactions and prove custody or ownership of a blockchain public key. A private key is not only used to prove ownership of a public key but to get access to the public key cryptocurrency wallet, spend received tokens, and approve transactions. Bitcoin private keys, in particular, have a 256-bit string, a combination of alphabets and numbers. Your bitcoin private key is saved in your crypto wallet, completely existing out of the blockchain, and not dependent on the internet. Bitcoin private keys allow you to access your Bitcoin whenever you want. 

Some may wonder, "What if I misplace my cryptocurrency private keys?" If you lose your private key, there is usually no way to recover it unless you have a backup. In other words, if you lose your private key, you will no longer be able to access your cryptocurrency.

Cryptocurrency Wallets

A cryptocurrency wallet is an application that functions as a digital wallet for your cryptocurrency, cryptocurrency wallets are used to store cryptocurrency. A cryptocurrency wallet is used to communicate with a blockchain network. As a cryptocurrency enthusiast and investor, cryptocurrency wallet security is a priority in keeping your cryptocurrency safe. The private key in a cryptocurrency wallet can be in a form of a length of strings of alphanumeric characters or in a form of a 12 or 24-seed phrase. These phrases or alpha-numeric characters are used to access your cryptocurrency wallet. Examples of cryptocurrency wallets are Trust Wallet, MetaMask, Ledger Nano X, Trezor One, Exodus, etc.

1. Custodial and Non-Custodial Wallets

A Custodial Wallet is a digital wallet in which a third party manages your cryptocurrency private keys. The third party has complete control of your cryptocurrency, while the user only needs to grant permission to send or receive cryptocurrencies. A centralized cryptocurrency exchange is an example of a custodial wallet (CEX). 

Non Custodial wallets are cryptocurrency wallets that give the owner complete control over their cryptocurrency assets. Non-custodial wallets are known to be fully decentralized. When a user creates a non-custodial wallet, a private key and public key are generated for them. The private key is the password to the non-custodial wallet, the security of the wallet depends on how securely users keep their private key. Read more about custodial and non-custodial wallets in the CoinEx Academy blog.

2. Private Key Risks and How to avoid loses

A cryptocurrency wallet comes with its risks as a user tends to lose all cryptocurrencies in their wallet when they lose access to their private key (seed phrase) or their private key is hacked. When users save their private keys (seed phrases) on google drive or iPhone clouds, hackers can hack their drives or iPhone cloud accounts and gain access to their private keys and hack their non-custodial wallets. If users save their private keys physically, they also tend to lose them to theft, misplacing, or loss due to natural disasters and other causes. Private key safety is one of the reasons users save their cryptocurrency in centralized exchanges wallets (custodial wallets) instead of decentralized cryptocurrency wallets (non-custodial wallets). Custodial and non-custodial wallets have their risks, they are exchanges that have been hacked and hackers got away with users' cryptocurrencies, big exchanges like Bitmart, Crypto.com, etc. 

Private keys can be saved on personal computers, flash drives, mobile phones, paper, or hardware wallets. The best type of private key storage depends on how frequently you intend to use your cryptocurrency and how careful you are. Hardware wallets are perceived as the safest way of storing your private keys. Hardware wallets, also known as Cold Wallets are physical non-custodial wallets that are used to store cryptocurrency. Users have complete control of this wallet using this physical device. Hardware wallets are not vulnerable to private key frauds on the internet, but users can lose access to their wallets if they lose the physical wallet drive. Examples of hardware wallets are Trezor Model, Ledger Nano S, Ledger Nano X, etc.


In summary, learning about cryptocurrency key pairs is essential to understanding the basics of cryptocurrency and how to keep your cryptocurrency safe. It’s important to learn that your private key is like the password to your cryptocurrency wallet; you will lose access to it if you lose your private key. Private key safety can never be over-emphasized, and the best type of private key storage depends on how frequently you intend to use your cryptocurrency and how careful you are. You can choose to use a custodial wallet where an exchange has control over your private key and keeps it safe for you or a non-custodial wallet where you take responsibility for your private key and have total control over your cryptocurrency. 

What Are Cryptocurrency Resources? How to Find?
A Charity Concert in Malaysia: CoinEx Charity Raises Funds for Health Charity!