What are cryptocurrency wallets, public keys, and private keys?

What are cryptocurrency wallets, public keys, and private keys?

Author | Cuo Pi
Produced by | Vernacular Blockchain (ID: hellobtc)

To judge whether a person really understands blockchain, you can first ask: "I transfer tokens to you, what is your wallet address?" This touchstone can easily distinguish many people. In the blockchain world, if you don't have your own wallet address, you are just a bystander.

To create a wallet, you need to get your own wallet address first. For example, this is a valid Bitcoin address:
1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm

Just like a bank account, with it, anyone can transfer money to you. In fact, anyone can generate their own wallet independently and without an Internet connection. How is this done?

01
Public and private keys

This involves a basic concept in cryptography: public key encryption technology.

In public key encryption technology, public keys and private keys appear in pairs. Things encrypted by public keys can be decrypted by private keys, and things encrypted by private keys can be decrypted by public keys. You can imagine the relationship between the two as the relationship between a locked box and a key. This feature is used for encryption and signing.

The encryption process is like putting the letter to be sent into a box, locking it, writing the address on it, and then sending it out. Both the sender and the recipient are relieved because no one else can open the box.

The signing process is similar to showing a key to others . Only you can open a locked box. If someone opens the box with the key you sent, then the contents of the box must be what you sent.

You hold the private key in your hand, which cannot be disclosed in any case; your wallet address is the converted public key known to the world. If the key information can be opened by the public key, it means that it was encrypted by someone who knows the private key. Therefore, once any transaction is encrypted with your private key, the recipient can decrypt it with your public key, which is considered to be an operation authorized by you.

02
Generation of wallet address

Several key information in the Bitcoin world are generated in this order: first generate a private key, then calculate the public key from the private key, and then calculate the wallet address from the public key through a series of hashes.

Private key → Public key → Wallet address

The above derivation order is one-way and the reverse is impossible. In other words, the public key cannot be obtained from the wallet address, and the private key cannot be obtained from the public key. The wallet address transformed from the Bitcoin public key can be imagined as a username, which can be known to the whole world; the private key can be imagined as a password, which only you know.

The private key is the beginning of everything. The private key is an arbitrary number greater than zero and less than 2 to the power of 256, such as the following private key:
000000000000000000000000000000001 (that is, the number 1)

It should be noted that the private key is not randomly generated, which is very risky!

Then, the private key is used to generate the corresponding public key through the elliptic curve function, such as the following:
0479BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8

After a series of hash encryptions, a Bitcoin address is finally formed, such as the following: 1EHNa6Q4Jz2uvNExL497mE43ikXhwF6kZm

The private key is like the "Open Sesame" in the story of "Alibaba and the Forty Thieves". Anyone in the world who knows the spell "Open Sesame" can find the cave in the mountain and open the door. Whether a person has an account depends on whether he knows the spell. The forty thieves can take away the treasure after knowing the spell, and Alibaba can also take away the treasure after knowing it . As for whether there is gold and silver treasure in the cave, that is another matter.

If you are reading this article, knowing the Bitcoin private key (number 1) in this article means that we have control over the "money" in this address.

In the world of Bitcoin, although it is impossible to know who is behind the address, all transactions in the history of this address are public and can be queried through the blockchain browser.

<<:  Munger: The current stock market is crazier than the Internet bubble. China is right to ban cryptocurrencies!

>>:  Cryptocurrency exchange Bitmart hacked, losing nearly $200 million

Recommend

Palmistry Analysis: Palmistry Analysis for Late Marriage

Palmistry Analysis: Palmistry Analysis for Late M...

Filecoin will release the Lotus v1.3.0 test version around tomorrow morning

According to BlockBeats, on December 17, Filecoin...

What does a fork in the lifeline mean?

There are many lines on our palms, the most impor...

A brief overview of Ethereum's major events in 2021

Source: ETH Chinese website Author: Coldsnap This...

Introduction to face shape

Is the face shape of the Chinese character "...

What are the signs of a man who is useless?

A man is the backbone of a family. If you love yo...

What does a forked marriage line mean?

In our palm lines, most people have three main li...