Getting Started | Usage and Principles of Wallet, Public and Private Keys for Cryptographic Currency

Author | Wrong skin

Produced | vernacular blockchain

To determine whether a person really understands the blockchain, you can ask: "I am going to Token to you, what is your wallet address?" This touchstone can easily distinguish many people. In the blockchain world, not having your own wallet address is a bystander.

To create a wallet, you need to get your own wallet address first. For example, this is a legal 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 networking. How is this done?


Public and private keys

This involves a basic concept of cryptography : public key cryptography.

In public key encryption technology, the public key and the private key appear in pairs, the public key encryption can be unlocked by the private key, and the private key encryption can be solved by the public key. The relationship between the two can be imagined as a relationship between a locked box and a key. This feature is used for encryption and signing.

The process of encryption is like putting a letter to be sent into a box, locking it up and writing the address, and then sending it out. Both the sender and the recipient are at ease because others cannot open the box.

The process of signing is similar to the process of presenting the key to the outside world . The box that is locked can only be opened. If someone opens the box with the key you sent, the thing in the box must be yours.

You have a private key in your hand that you can't reveal in any way; your wallet address is a well-known converted public key. The key information can be opened by the public key, which means that the person who knows the private key is encrypted. Therefore, once any transaction is encrypted with your private key, the recipient can decrypt it with your public key, which is considered to be your authorized operation.


Wallet address generation

Several key pieces of information in the Bitcoin world are generated in this order: the private key is calculated by the private key, and the public key is calculated by the private key, and then the public key is used to calculate the wallet address through a series of hashes.

Private Key → Public Key → Wallet Address

The above derivation order is one-way, and the reverse is impossible. That is to say, the public key cannot be obtained from the wallet address, and the private key cannot be obtained from the public key. The wallet address of Bitcoin's public key is imaginable as a user name, which is known all over the world; the private key can be imagined as a password, which only knows itself.

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

It should be noted that it is not a randomly generated private key, the risk is very big!

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

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

The private key is like the opening of the sesame in the story of Alibaba and the Forty Thieves. Anyone in the world who knows the spell "Open the door with sesame" can find the cave in the mountain and open the door. Whether a person has an account, only to see if he knows the spell. Forty thieves can take away the baby after knowing the spell. Alibaba can also take it after knowing it. As for whether there is gold or silver treasure in the cave, it is another thing.

You who read this article know the bitcoin private key (ie number 1) in the example of this article, which 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 this address history are public and can be queried through the blockchain browser.


『Declaration : This series of content is only for the introduction of blockchain science, and does not constitute any investment advice or advice. If there are any errors or omissions, please leave a message. You are not allowed to reprint this article by any third party without the authorization of the "Baihua Blockchain" sourced from this article.