Original Author: Jose Aguinaga
Translation & Proofreading: Min Min & A Jian, Ethereum Enthusiast
Private key is the most sensitive and important thing in the world of cryptocurrency. We recommend that all aspiring veteran users learn the origin, related reasoning and function of private keys. In this article, we'll explain where the private key comes from and how it relates to your cryptocurrency holdings.

At the end of the day , holding a cryptocurrency is holding a private key. In the real world, owning physical property usually means owning a deed or receipt with your name on it, but in the world of cryptocurrencies, owning an asset is owning information. In short, mastering the private key is equivalent to owning (the private key can control) cryptographic assets.

-In the cryptocurrency world, "what you know is what you get" is the absolute truth-
p>
All assets can be manipulated through transactions. In the real world, transactions usually require signature authorization. However, in the world of cryptocurrencies, all transactions must be authorized using the associated private key. The role of the private key is to cooperate with cryptographic algorithms to generate a digital signature for a transaction. A signed transaction means that the private key holder has granted others the authority to own the assets held by him. While anyone can generate a transaction related to your digital assets, only the person who holds the corresponding private key can sign the transaction.
While false signatures are a problem in the real world, the security of the cryptocurrency world is protected by its cryptographic nature. To date, no hacker has ever heard of successfully signing a transaction without a private key.

-There is a famous saying in the currency circle "without a private key, the currency is not yours", this is because the ability to sign transactions and transfer assets is completely It is tied to the private key. After getting a private key, no matter who it is, can transfer the assets corresponding to the private key-
From a practical point of view, a private key is a number (within a certain size range) that can be used to spend funds (this is why we The reason for keeping the private key safe). From a mathematical point of view, the private key is a randomly generated positive integer . The following is a more accurate description from a technical point of view:
The private key is a number obtained by a random number generator within a specific range of positive numbers. It has the characteristics of strong randomness in the sense of cryptography.
In most cases, computers use a pseudo-random number generator (PRNG) to generate these random positive integers (true random number generators are hard to find. These Generators usually require specialized hardware and use physical sources such as thermal noise in a circuit or the precise timing of a Geiger counter). PRNG is a cryptographically enhanced function that needs to input a value with sufficient entropy as a random seed.
Entropy is a complex concept, but its purpose is simple: to bring unpredictability to functions. By using a secure source of entropy, a PRNG can create pseudorandom numbers with a negligible probability of non-randomness (within a certain acceptable range).

-"/dev/urandom" in Linux system and "rand_s" in Microsoft Windows system are often used as the entropy source of PRNG to Generate secure random numbers. In the picture above, "range" is both the range in the mathematical concept and the byte size used by the computer to generate random numbers. (It can be seen from Tuke that the role of RPNG is to take out a value in a large range; and entropy ensures that this process is random enough)-
When creating an Ethereum or Bitcoin private key, the PRNG can take values from 1 to 2256 - 1 (imagine a 78-bit combination lock consisting of the numbers 0 to 9). Due to this large range, the probability of generating two identical private keys is negligibly low, which is why it is unlikely that other users will create a private key exactly like yours. Your private key is retrieved from a huge integer set - almost as many atoms as there are visible atoms in the entire universe.

-Bitcoin and Ethereum both adopt the range of 1 to 2256-1, under the public key generation algorithm of these two chains is feasible. For example, Ethereum uses elliptic curves (specifically SECP-256k1) to generate public keys. In the original yellow paper, Dr. Gavin Wood defined private keys as Component is a positive integer randomly selected in the range [1, secp256k1n − 1] (a byte array of length 32 in big-endian format). Consult the Yellow Book for all formal definitions. -
Since the private key must be kept secret, we also A mechanism is needed to mark the destination for billing. Therefore, all blockchains introduce the concept of an address (a unique string of numbers calculated from a private key). The address is where your cryptographic assets are stored and (if needed) can be shared with anyone so they can know your cryptographic asset balance.
Blockchain addresses are created with a public key to ensure that you are the owner of this address. Pushing back further, the public key is generated from the private key. This process is one-way, that is to say, you can calculate the account address through the private key, but you cannot calculate the private key backwards through the account address (even if you can't do it yourself).
The private key can extract the public key, and the public key can extract the blockchain address. However, the blockchain address cannot be used to deduce the public key, and the public key cannot be used to deduce the private key.
This one-way process is achieved through a cryptographic trapdoor function. A trapdoor function is a one-way function. An input value can only lead to a unique output value, but the original input value cannot be deduced from the output value. Different blockchain ecosystems employ different one-way functions. For example, the most popular blockchain systems use algebraic structures based on elliptic curves to generate public keys. Regardless of the characteristics of these algebraic structures, the result is always deterministic: there is a one-to-one correspondence between public keys and private keys, and the same private key can only generate the same public key forever.

- While popular blockchains like Bitcoin or Ethereum use the ECDSA algorithm, multiplying the private key by a fixed point on the elliptic curve secp256k1 , which yields the public key. Other blockchain projects are taking a similar approach. For example, Monero uses the EdDSA algorithm and the Curve25519 curve, and Polkadot and Substrate use the sr25519 algorithm and the Ed25519 curve. All of these blockchains generate public keys based on private keys in the range 1 to 2256-1. -
The blockchain address is also calculated with a one-way function, using the so-called Hash function. Both Bitcoin and Ethereum addresses are created using one or more cryptographically enhanced hash functions based on the public key, but different blockchains use different algorithms. Given how these hash functions work, you can absolutely trust that your public and private keys correspond to unique blockchain addresses.

-Ethereum account is the Keccak-256 hash of the public key, but only keeps the rightmost 20 bytes of the calculation result. Bitcoin private keys use SHA-256 and RIPEMD-160, Polkadot and ZCash use Blake2b. All these hash functions are anti-collision, so the possibility of two public keys generating the same account address is very low, and it is guaranteed that the only way to use the address to reverse the private key is brute force cracking with extremely low economic efficiency. We cannot guarantee that these hash functions will not be broken, but to date, no blockchain using a hash function has been proven to be broken. -
The security of cryptographic assets comes from The cryptography and mathematics behind private keys - as long as we keep our private keys safe. To date, no one has been able to find the private key corresponding to your blockchain address through brute force because of the energy consumed stores more energy than the sun. At Portis, we take careful steps to ensure that your private key is securely generated based on data only you know (for more information, please read our white paper).
In the next article, we will explore the popular blockchain ecosystem and the mathematics behind public key generation. We will provide some code examples so that you can calculate the key according to the process described by each blockchain, and use some code libraries to make the generation process easier. stay tuned!
(Unfinished)
Original link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia
