Bankless Times
HomeInvesting in CryptocurrencyWhat Are Public and Private Keys?

What Are Public and Private Keys?

Staff Writer
Staff Writer
February 16th, 2023
Why trust us
Advertiser Disclosure

The public and private key pairing systems underpin the secure transfer and storage of cryptocurrencies. Using asymmetric encryption, public-key technology allows token holders to prove ownership, prevents forged transactions, and helps transactions arrive at the correct destination securely.

Introducing Public and Private Key Pairing

Public and private keys refer to two sets of alphanumerical characters that only work when used together: these mathematically paired keys function as a public address (public key) to which users can accept cryptocurrencies, and private passwords allow the user to access and use their funds. One simple analogy likens the public key to an email address and the private key to the password for the address.

But public-key cryptography does more than that. It constitutes a way of encrypting and decrypting transactions, allowing blockchain-based information sharing to be secure and transparent simultaneously.

Deciphering Public and Private Keys

Public-key cryptography consists of three main components, public keys, private key, and the digital stamp which helps key pairs work in harmony to ensure security and confidentiality.

Private Key

Obligatory disclaimer: private key is non-sharable. They work similarly to a password and represent ownership of cryptocurrency. Users can only access their funds, and transfer or withdraw cryptocurrencies, using their private key. It is a fairly long code that can be in the form of a mnemonic phrase, QR code, 64-digit hexadecimal code, or a 256-character long binary code.

Through a one-way mathematical function, public keys are generated from private key. This ensures that while it's possible to get public key from private key, it’s virtually impossible to get private key from public keys unless the agent has a quantum computer (there are two current solutions to that end, Quantum Resistant Ledger and Bitcoin Post Quantum).

Public Keys

As said before, the public key represent an address that can accept cryptocurrency transactions. Crypto addresses are only shorter versions of a public key, which is normally quite long. Much like the account and router number associated with a bank account, public key are freely sharable.

A public key, or public address, is usually 34 digits long, and also looks like a random string of letters and numbers.

But why is it called a public key? The reason it is called Public-Key is that each person will share one of their keys widely. The public key can use anyone. Then they will keep the other key private ("private key") so that only they can use it.

A public key can be given to any person with whom an individual wants to communicate, whereas a private key belongs to the individual it was created for and isn't shared. The public key is typically stored on a public key infrastructure server and is used to encrypt data securely before it is sent over the internet.

The public key also functions to encrypt transactions. When person A sends a transaction to person B using their public key, the transaction is encrypted to be decrypted using person B’s private key.

NOTE: The wallet address and public key are not the same, as the wallet address is the final part of the public key. However, it is important to note that Bitcoin and Ethereum are not anonymous, but pseudonymous.

Digital Signing

So, person A has sent some funds to person B. For this transaction to be completed and recorded on the blockchain, it needs to be digitally stamped.

Digital stamping has two functions: authenticating and securing.

For a blockchain transaction to be confirmed, it needs to be verified by a participant of the network (node), which in turn should be confirmed by the majority of the network. To help nodes verify transactions, each transaction is stamped using the private key. The digital signature includes the transaction data (person A sent $50 to person B) and the private key, in a way that does not disclose the private key. Person A’s public key is used to decrypt their digital signature, which authenticates the transaction — ensuring that it was person A who sent the transaction.

In addition to this, when person A sends a transaction to the recipient person B, the transaction is encrypted using person B’s public key, which can only be decrypted using person B’s private key. This way, keys allow the transaction to arrive at the correct destination securely.

Storing and Using Public and Private Keys

When users sign up for a wallet, it generates a pair of private and public key for traders to use while making transactions. There are custodial and non-custodial ways of storing the keys.

The custodial way of holding the keys refers to simply signing up for a cryptocurrency exchange like Coinbase. These exchanges are centralized, meaning that traders’ private key and funds are safeguarded by the developing company.

Traders who opt for non-custodial ways of holding the keys typically use decentralized exchanges and are responsible for keeping their private key safe and secure — as losing it means losing all access to cryptocurrency funds. Crypto wallets are necessary to interact with decentralized exchanges (DEX).

How Do Crypto Wallets Work?

Traders sign up for a crypto wallet simply by creating a password, which then generates a pair of private and public keys for the user. Wallets offer a variety of ways to store private keys.

  • Paper wallets are printed documents of private keys and QR codes, which can be scanned easily when a trader wishes to perform a transaction,

  • Cold wallets store private keys offline using smartcards or USB devices. These wallets support an offline partition for storing the private key and an online section that has the public key,

  • Hot wallets store both private and public keys online and include desktop wallets, mobile wallets, and web-based wallets.

Public-key Cryptography: To the Stars and Beyond

Public-key cryptography has been an integral part of the functioning of blockchains so far and still is. It helps networks to remain decentralized, secure, confidential, and traceable all at once. However, the current systems are not wholly protected against advances in quantum computing.

While it's still far from reality, it is possible that quantum computing can reverse engineer private keys and threaten the whole mechanism. While currently deployed systems come across as weak against attacks from quantum computers, the concept of public-key cryptography is not. To that end, post-quantum cryptography is expected to be shaping the future of encryption.

FAQs

Where is my private key?
Where are my cryptocurrencies stored?
Should you trust a custodial wallet?
What is meant by public key?
What is an example of public key?
What is the advantage of public key?

Contributors