What Are Public Keys & Private Keys In Cryptocurrencies



What are Public Private Keys in Cryptocurrencies - Cover

Last updated on March 3rd, 2023 at 01:03 pm

Ellipal Titan Mini

Introduction

Cryptocurrencies can’t work without public and private keys. These keys let you send and receive cryptocurrency without needing a third party to verify the transactions.

The framework for public-key cryptography (PKC) includes these keys. Using these keys, you can send your cryptocurrency to anyone, anywhere, at any time. The public key and the private key are key set. As the name suggests, to receive transactions, you can share your public keys, but you must keep your private keys secret.

If someone gets their hands on the private keys, they can also get their hands on the cryptocurrency that goes with them.

What are Public Keys & Private Keys?

What are Private Keys & Public Keys
What are Private Keys & Public Keys

A public key is a cryptographic key that is open to the public. Using a public key you can receive transactions in cryptocurrency.

It is a secret code that goes with a private key. Anyone can send transactions to the public key. And in order to confirm that transaction you need a Private Key that will “unlock” them and prove that you own the cryptocurrency sent in the transaction.

Most of the time, the public key that can receive transactions is an address, which is just a shorter version of your actual public key.

So, you don’t have to worry about giving out your public key. You may have seen online donation pages for content creators or charities that had the public keys for their crypto addresses. Anyone can give money, but you’d need the private key to unlock the money and use it.

A public key is like an address to your home, which anyone can visit from outside. And private key in this respect is the key to your door lock that only you possess to gain access to your home.

I hope this explains the basics of both the Public Key and Private Key to you.

What is encryption with a public key?

Encryption with Public Key
Encryption with Public Key

Using asymmetric encryption, public-key cryptography (PKC) is a method for ensuring that data is real. In the early days of computing, PKC was mostly used to encrypt and decrypt messages. This is now used to encrypt and decrypt transactions for cryptocurrencies. Without PKC, the technology that makes cryptocurrencies possible would almost certainly not exist.

“Trapdoor functions” are the key to PKC. These one-way math functions are easy to solve in one direction but almost impossible to crack in the other. Even if possible, it would probably take a supercomputer and a lot of time to figure out how these functions work.

How Does a Private Key Work?

One important thing to remember is that you should never give anyone your private key. With a private key, you can show that you own something or spend the money tied to your public address. There are many ways a private key can look:

  • The binary code is 256 characters long.
  • 64 digit hexadecimal code
  • QR code
  • Phrase to remember

No matter what shape it takes, a private key is a huge number and big for a good reason. You can use a private key to make a public key, but the one-way “trapdoor” function makes it nearly impossible to do the opposite. You can connect as many public keys as you want to relative to a private key.

What does it mean for a transaction to be “digitally signed”?

What does Digitally Signing mean
What does Digitally Signing mean

A transaction on the blockchain needs to be signed for it to be complete. For someone to send you a transaction, they need to do the following:

  1. A public key is used to encrypt a transaction. The transaction can only be unlocked with the private key that goes with it.
  2. Next, you sign the transaction with your private key. This shows that the transaction hasn’t been changed. The digital signature is made when the private key and the data being sent in the transaction are put together.
  3. Lastly, the transaction can be confirmed as real by using the public key that goes with it.

You put your digital signature on a transaction to show that you own the money.

Transactions are checked and confirmed by nodes on their own. The network turns down any transactions that aren’t authenticated. A real, mined transaction on the blockchain cannot be taken back.

Where do I keep my “private keys”?

How to keep your Private Key Safe
How to keep your Private Key Safe

Your private keys are stored in a cryptocurrency wallet, which is usually a piece of software for your phone or computer or a piece of hardware made just for that purpose.

Your private keys are not on the network of cryptocurrencies that use the blockchain. If you keep your cryptocurrency on an exchange, the exchange is in charge of your private keys, just like a bank’s vault is in charge of your gold.

If you move your cryptocurrency from an exchange to a wallet that doesn’t hold your keys, you will control your keys. Because cryptocurrency wallets are set up and how they work, you’ll probably never have to touch the private keys directly.

Wallets usually take care of them for you automatically. As a backup, you are usually given a “seed phrase” that encodes your private keys.

It is important to mention here that Hardware Wallets are the safest wallets to keep your Private Keys safe. A few of the most famous hardware wallets are:

  1. Ledger
  2. Trezor
  3. Ellipal Titan
  4. Keepkey

Keeping track of your crypto-keys perspective

How public and private keys work together is fundamental to understanding how cryptocurrency transactions function. When you say you have cryptocurrency, what you really mean is that you have a private key that proves you own it. Since it’s on the blockchain, anyone can use your public key to prove that you own it.

Whether you should “hold your own keys” or trust a custodian depends on your philosophy, how comfortable you are with risk, and several other things. If you hold your own private keys, consider modern HD wallets, which can manage your private keys, and remember never to share them.

If you choose a custodial solution like an exchange, make sure you choose a trusted, reputable company that emphasizes security and rules.

How does a typical transaction takes place using keys?

Process of Transacting with Key Pairs
Process of Transacting with Key Pairs

Jennifer’s private key is her digital signature, which she can use to prove that she is the person who spent money or sent a message.

For example, if Jennifer wants to send a message to Bob over a public channel that Charlie can listen to, she can encrypt the message with her private key and send it to Bob.

Jennifer also sends Bob’s public key and her message called a “hash output.” This is a special value that Jennifer makes. Bob can read the message if he has the message, the hash output, and his private key.

Charlie can’t read the message because all he has is Jennifer’s public keys. This shows how smart trapdoor functions can be. Because it is built with a “trapdoor” function, Charlie can’t figure out what Jennifer’s message or private key is.

The exchange of crypto

Since you have understood how a message is encrypted and decrypted using Private and Public keys, we can now implement the same on Cryptocurrencies say Bitcoin for example.

In Bitcoin, users send and receive bitcoins to and from each other’s public addresses as inputs and outputs in the UTXO transaction model.

Jennifer can put her public key on the Internet, and people can send bitcoins to that address, knowing that Jennifer has the private key to those funds.

In Bitcoin, people who run the Bitcoin software, called “nodes,” automatically check and approve all transactions in the network to make sure none of them are faked.

They do this by using basic consensus rules and cryptographic proofs (Proof of work in this case) that the public/private key pairs are valid.

Since mathematical proofs protect PKC transactions, it is almost impossible to fake transactions in cryptocurrencies like Bitcoin that use it.

Asymmetric Cryptography

Messages can be encrypted and decrypted using the two keys together. If you use a person’s public key to encrypt a message, the message can only be read by the person who has the matching private key.

So, only the person who is supposed to get the message can read it. One of the benefits of asymmetric encryption is that it can make sure the sender is who they say they are.

For instance, Jennifer wants to tell Peter something. First, she would use Peter’s public key to encrypt the message. Then, she would use her private key to sign the message. Then, Peter would use his private key to decipher it.

In this case, the public key is like the email address, while the private key is like the password. Anyone can send your email address, but only you can read it because you know the password. Just like an email password, you should keep your private key to yourself, but you can share your public key.

Conclusion

It is fairly easy to understand the concepts of Public & Private Keys if we relate them to an email address and its password. A public key is similar to your email address that is known to everyone you want to share it with and a Private key is a password to the email address that is known just to you.

Private keys need to be secured as the possessor can claim to be the owner of the asset even if they aren’t. The safest way to store your private key is in a hardware wallet like:

People also write their private keys on a piece of paper but it certainly is a risky way to store your key as the paper can get damaged, lost, mixed up quite easily.

Leave a Comment



Do you want to
Learn Bitcoin
& Crypto?

Guides



Scroll to Top