Private key and public key are an integral part of blockchain networks. They, in turn, are part of an even larger field of cryptography. It is called “Public Key Cryptography” (PKC), or asymmetric encryption.

Such a cryptosystem provides the user with the ability to send and receive encrypted data without revealing it to others.

In this case, encrypted data should be understood as a cryptocurrency, since we have already said earlier ( “I bought a crypto. What next?” ) that it does not have a physical form and exists only in the digital world. Thus, such a system allows you to ensure the security of the transaction, since it cannot be faked.

So, a public key cryptosystem includes a public key and a private key. The first can be compared to a mailbox locked with a key. You can put a letter in it. While the second is the owner’s key. He lets him pick up the package and see what’s inside.

Public key cryptosystem

This system is based on a one-way function with a secret entrance (loophole functions). This kind of function is easy to solve, but to reverse the solution, for example in our case to steal someone’s funds, it would take computers a huge amount of time (thousands of years) to come up with the correct answer.

Loopback functions make it impossible to forge cryptographic signatures (private keys).

How public and private keys work

Thus, the overall goal of a public key cryptosystem is to secure communication using digital signatures between users on a public blockchain, where there may also be attackers and fraudsters. That is, when we talk about cryptocurrency, the goal is to provide proof that the transfer was made by the true owner of the funds.

As noted in the article “I bought a crypt. What’s next?” , you own the private key, and it gives you access to the use of the cryptocurrency associated with it. Since it gives access to the user’s assets, it should only be known to the user who owns those assets.

In addition to the private key, there is also a public key. There is a connection between them, but knowing the public key, it is impossible to find out the private one. The principle of operation is similar to the principle of operation of e-mail services, where the public key is the mail address, and the private key is the password.

It is possible to create several public keys using one private one, which will be the password to the user’s assets. Using public keys, other network users can transfer, for example, bitcoin to them, but only the owner of the private key will have access to bitcoin.

How are transactions carried out?

So, let’s see how a transaction is carried out in the blockchain using an example. Ivan wants to send 1 BTC to Svetlana. To do this, he will need Svetlana’s public key, which is a kind of departure address. Ivan uses his private key to encrypt the message so that no one but Svetlana can open it. Of course, in order to send 1 BTC, Ivan must have 1 BTC in his own account. Further, the transaction enters the blockchain, and after approval, Svetlana receives 1 BTC using her private key.

Since the principle of operation of the blockchain is based on the Proof-of-Work consensus algorithm, it is almost impossible to fake a transaction.