Written by Shivashish Yadav on   -  3 min read

What is public key and private key in blockchain?

All bitcoin wallets have two things in common: the private key and the public key, also known as an address.

So what is the private key?

A private key, in relation to a bitcoin wallet, is a secret 256-bit alphanumeric number that is generated randomly using cryptographic math operations. Randomness used when generating a private key is so random, it has been described that atoms are more likely to create a unique public key than exist throughout the known universe, almost impossible.

A private key is the most important thing to keep safe as a bitcoin holder. Because your private key gives full control over any affiliate bitcoin. Using a private key, anyone can conduct an irreversible bitcoin transaction, which means they can send bitcoin to another person or place without being able to undo the transaction.

Now, the address of a public key is generated from the private key.

So what is Public Key?

Public keys are an alphanumeric number similar to private keys. However, it is derived directly from the corresponding private key using cryptographic math functions and the function operates in such a way that one public key or address can only be accessed from others. Used to get bitcoins. You cannot use a public key to send bitcoins–only receive. So you can post your public key on a public website and anyone who sees it.

So, putting it simply, private keys are for holding bitcoins and public keys are for sending or spending bitcoins.

Let us explore an analogy to understand this concept better. A traditional bank account gives you an own bank routing number and account number. Think of your online banking account username and password. Depending on how your bank operates, using your online bank account login credentials can access your account and transfer money from it. So, think of your online bank account username and password combination as your private key. If someone logs in as you, they can start a transfer of funds from your account. Simple enough, isn't it? So let's look.

On this public bitcoin ledger that we are talking about, that shows all the bitcoin transactions that have happened since its creation. There are many sources that show the bitcoin ledger to choose from,

These represent a mix of wallets on public address exchanges, software wallets, hardware wallets and all kinds of different wallets that people are using to transfer bitcoins. As you can see, this public ledger shows a lot of information about transactions without revealing the identities of the people who send and receive bitcoins.

However, bitcoin transactions are not completely anonymous, so if someone had some information about the amount of bitcoins transacted, the date and time and the public address involved, you could use the public ledger to trace the activity. Huh. As far as bitcoin wallets are concerned, I highly recommend investing in hardware wallets like Ledger Backup Pack or BC Vault to store and transfer bitcoins, as they are a safer form of cold storage.