Una private key or private key, is a secret key generated by the process of asymmetric cryptography. This key is the one that allows the total 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 provides 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 Bitcoin, the first thing to create is the private key. After creating it, the creation of the public key begins. Putting this last one, it is mathematically related to the private key. Once both keys have been created, the public key It is used to create the Bitcoin address. All this process following fixed rules. However, the reverse process is impossible to perform. We cannot derive the private key using either the address or 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:
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, the keys under this format are complex to handle for users. That is why, for various tasks in Bitcoin, an algorithm has been created to simplify them. This with the aim of putting them in good safeguards, because do not forget that 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:
This notation is the one 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 to ensure that it is correct, something impossible with the original private key format. Additionally, it is easier to handle and its implementation in software helps to improve the security levels of the wallets.