The private key is one of the cryptographic parts that are generated during the key generation procedure of the asymmetric cryptographic system.
A private key or private key is a secret key generated during the process of asymmetric cryptography. This key is what allows full ownership and management of our cryptocurrency wallets.
In Bitcoin, this key is generated using cryptography of the type ECDSA, using the elliptic curve secp256k1. This is a special type of asymmetric cryptography, which we offers a high level of security.
Thanks to the use of this cryptographic system, an almost infinite number of private keys can be generated. In fact, almost any 256-bit number is a valid private key. That is, with this system we are able to produce 2 ^ 256 different key combinations. So many that at the current rate of creation it would take at least 4 trillion years to create them all. Their diversity and the difficulty of calculating them is precisely what makes this system so safe.
During the process of creating a purse of Bitcoin, the first thing to create is the private key. Next, the creation of the public key begins. Well, the latter is mathematically related to the private key. Once both are created, the public key is used to form the Bitcoin address.
This entire process follows fixed rules and it is impossible to reverse the process. We cannot derive the private key using neither the address nor the public key.
How do private keys work?
The operation of private keys is simple. This is just a random number, which applies to the cryptographic system formula. This formula can respond to curves known as the secp256k1, secp256r1 o Curve25519. Once this number is applied in the formula, the so-called private key is obtained. This key is used to generate the public key and create an asymmetric crypto system. That is, a system with two keys, the private and the public.
Thanks to this system, we can share with whoever likes the public key. This will not create any security or privacy problem. This is because there is no practical way to get the private key from which the public key was derived. A positive situation, because we can share it and receive encrypted messages from other people who have access to our public key. These messages can only be visible to the originator of the message and we who have the private key. Well, the only way to decipher the content is with that key.
Private keys in Bitcoin
A 256-bit private key like the ones generated in Bitcoin, generally has the following form:
A5373D44C6D87DC0FA6A6738334369F4553213303DA61F20BD67FC233AA37485
This form is explained by the following rules:
- A 256-bit private key is divided into a sequence of 64 characters.
- The character range respects the hexadecimal order, with a range that goes from AF to 0-9.
However, keys under this format are complex for users to handle. For this reason, for certain tasks in Bitcoin, an algorithm has been created that simplifies them, with the aim of keeping them safe, since they are the key to access our wallet. This system created by Bitcoin is called: import format Base 58.
This Base 58 import format is nothing more than a special algorithm that transforms our private key into a shorter and simpler cryptographic chain. For example, from our previously given private key, we get:
C7w8CPTv25oeXXFPz3nnXCPQw7KPaCXHZD9DYWQ66TCg
This notation is what we most commonly see in Bitcoin as a private key. This format is used, thanks to the fact that it incorporates a series of elements that help ensure that it is correct, something impossible with the original private key format. Additionally, it is easier to use and its implementation in software helps to improve the security levels of the wallets.
Private key use cases
Let's take an example of this case:
Example of how a private key works
Suppose that Juan wants to communicate with Maria securely. To do this, Juan creates a private key and from there derives a public key. Once both keys are created, Juan hands over the public key to Maria. This will allow Maria to write a message and send it to Juan encrypted. All this, with the assurance that no one but him will be able to see the message. This is thanks to the fact that only Juan has the private key, and only he can decrypt the encrypted messages with the public key that he has generated.
It is precisely this security scheme that allows the use of public and private keys to be so secure. And since private keys are the key that allows bitcoins to be spent, it is imperative to keep them safe. Private keys can be stored in computer files, but as they are simple numbers they can also be printed on paper. Many even recommend encrypting private keys in another system, to add another layer of security.
Use cases of this technology can be seen in the software PGP. This system created by Phil Zimmerman, allows you to use asymmetric cryptography to send messages securely. Another well-known and widely used variant is GPG developed by Werner koch, which uses the standard OpenPGP.
The same system is also used for SSL / TLS communications from secure Internet sites. Virtually everything on the Internet uses some type of asymmetric encryption, and this Academy is an example of this.