current position:Home>Look at what blockchain is. Don't be cheated again

Look at what blockchain is. Don't be cheated again

2022-02-01 02:17:10 Rayjun

What is blockchain ? Many people are confused , Because no technology has ever been so controversial , Gather wealth 、 A scam 、 New technology and other topics .

But actually , This is a kind of over packaging . I saw a piece before , It's perfect to describe this situation :” They say blockchain won't lie , But they will cheat people with blockchain “. Many people are cheated because they don't understand blockchain . But blockchain is not complicated at all , Both technically and conceptually .

This article will discuss the details of blockchain operation from the perspective of popular science . Mainly bitcoin network , We will also talk about the alliance chain later . There are many new terms in the blockchain , I will try my best to make it easier to understand .

1. What is blockchain

Blockchain is born out of bitcoin , Used to store transaction data generated in bitcoin , Blockchain has two characteristics :

  • After the data is written to the block, it It is difficult to ( Note that there , It's hard , It's not that I can't ) Be tampered with , It is often called tamper proof
  • De centralization , No one can really control the whole system

1.1 The structure of the blockchain

Blockchain technology itself is not complicated , People who have learned programming are very clear about the data structure of linked list , To some extent, blockchain is actually such a linked list .

https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/4b565411aa9a45878300d121a11673ef~tplv-k3u1fbpfcp-zoom-1.image

Blockchain is composed of such blocks , What needs to be noted here is , The direction of the arrow cannot be reversed , All new blocks point to the previous block , Then some data is stored in each block .

How are these blocks connected ?

This comes to a very important part of the blockchain , hash function . This is a concept in mathematics or computer . It is characterized by , It can do specific operations on a piece of data , Output a fixed length string , This string is called the hash value , But you can't ( It is difficult to ) Calculate what the input is from the output , But you can quickly verify that the hash value is correct according to the input .

h = hash("I got 100 bitcoins") //16df768dash
 Copy code 

And for hash functions , As long as the incoming data is a little different , The resulting hash values will be very different .

For hash functions , You just need to know what it can do . The hash function will also be used when mining .

The block uses this feature , Calculate the hash value of the block in front of it , And put the hash value into its own block . That is, each block records the hash value of its previous block . And connected in this way . If the data of any block in the chain is tampered with , The hash value of this block will change , Then other blocks after this block cannot be connected to this block .

This is really a hair and a whole body , This is also the technical implementation of the tamper proof feature of blockchain .

1.2 Blockchain network

However, the blockchain we discuss everyday is actually a blockchain network .

The blockchain network is decentralized , That is often referred to as distributed . Bitcoin network can be said to be the most thoroughly decentralized software system . This network is completely open , Anyone can download a bitcoin software to access the network , Become a node in the network .

In the blockchain network , Each network node will maintain the chain structure above . Nodes synchronize data with each other , As like as two peas, the data that each node maintains is identical. .

https://p3-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/fc05ec16309f4d2381e23c5d595d6add~tplv-k3u1fbpfcp-zoom-1.image

Anyone can access the bitcoin network , Synchronize all blockchain data to their own local . let me put it another way , Bitcoin network is open and transparent to everyone .

When accessing the block network , We need to generate our own accounts . The account is actually a bunch of public-private key pairs generated by asymmetric encryption . among , Public keys can be exposed , The public key is converted into an address . This address is what we usually call the wallet address .

In blockchain , The word wallet also appears very frequently . But this wallet is completely different from the wallet we usually know . Unlike Alipay or any bank. APP.

A wallet is actually composed of an address and a public-private key , When you master the private key, you master the wallet .

1.3 How are blocks generated

The block contains transactions . Trading in the bitcoin network is simple , It's actually a transfer , You transfer your bitcoin to any address is a transaction .

However, the number of blocks that can be included in each block is limited . Therefore, the number of transactions that can be packaged at one time is also limited . At this time, it is up to the miners to decide which transactions to package into the block . People who are just beginning to understand blockchain must have heard of miners . The word is easily confused , But it's appropriate .

Miners will start competing here Bookkeeping right . Bookkeeping right is the right to package the next block . If you get the bookkeeping right , You can get the bitcoin reward after the block is generated . This is also the reason why a large number of miners join the bitcoin network . The process of competing for this bookkeeping right is also known as the consensus process .

So how to compete for bookkeeping right ? In fact, it's to do the problem . Who finds the answer first , The bookkeeping right is given to whoever .

The hash function mentioned above works . This is the problem , Find a string , Make its hash value 0x00000.......

here 0 The number of can be adjusted , In bitcoin networks Difficulty adjustment It's actually adjusting 0 The number of . As we said above, it is very difficult to deduce the original data according to the hash value , It can basically be equivalent to being unable to complete . So the only way is Brute force .

Is to try different strings , Until you find a qualified answer . After finding the answer , This node will synchronize the results to other nodes , According to the characteristics of hash function , Other nodes can easily verify whether this answer is correct . This process is also called PoW(Proof of Work) Consensus mechanism ,Pow It is a distributed consensus algorithm .

In the process of generating new blocks , A lot of computation is required , And as bitcoin becomes more and more valuable , Then more and more miners will join , It will make the problem more and more difficult . The amount of calculation required is increasing . More and more electricity is consumed , This is also the most criticized place of bitcoin .

Distributed consistency algorithms also Paxos/Raft/PBFT wait , Why must we use PoW So what about the energy consuming algorithm ? because Paxos/ Raft And other algorithms have strict requirements for the environment :

  • First, it needs Leader The election , This is not possible in blockchain Networks
  • And it assumes that all nodes are trusted , But in fact , In an open network , No node is trusted
  • There are many nodes in the blockchain network , These algorithms cannot handle such a large network

This is how the blockchain network on the public chain is formed . In an untrusted network environment , By hashing and PoW The consensus algorithm builds a trusted blockchain .

2. What's the difference between the alliance chain

And besides bitcoin 、 Ethereum is outside these public chains , There is also a network of alliance chains , This kind of network has access threshold , All blockchain applications in China are based on alliance chain .

The biggest difference between alliance chain and public chain is that its network is access system , You can't join until you get permission , Therefore, all nodes in the alliance chain are trusted , And the number of nodes will be controlled within a certain range , External nodes cannot join at will .

In such a network environment , Nature doesn't need PoW This algorithm , The conventional distributed consistency algorithm can be used , Even some alliances do not need consensus algorithm directly .

Currency cannot appear in the alliance chain for the time being , This actually cuts off the most important part of the blockchain network . The reason why the public chain can work , The key is that the internal has formed a complete economic system , When can the alliance chain make up this part . Then the spring of the alliance chain will come .

3. Is blockchain technology valuable

After bitcoin became popular , Someone extracted a part from it , It's called blockchain . Then someone took this , Then say to everyone , this , The future . But actually , Blockchain is just a technology , And there is nothing revolutionary about this technology itself , The technology used in blockchain has existed long ago . It combines some existing technologies , Got a new concept .

Take bitcoin , Blockchain is just the data structure it uses to store transactions . It is important that the consensus of many people is gathered in the bitcoin network , This is the real value of bitcoin , That is to say, the data of bitcoin itself has no value , Those who recognize the value of these data have long recognized the value of bitcoin .

Blockchain technology itself has no value , Why do you study so much 、 All kinds of coins that copy bitcoin can't catch up with bitcoin , This is because the most valuable bitcoin is not the blockchain , But consensus .

The low cost of building a blockchain network . Use your own laptop , A blockchain network can be built in an hour , For blockchain , It doesn't matter what chain you use , What matters is how many people in this chain admit .

But this is not to say that blockchain technology is worthless . Blockchain is not ( almost ) Tamperability makes this structure naturally suitable as a carrier of value storage . Our current mobile Internet makes the cost of information transmission almost zero . But there are still big problems in the transmission of value . Blockchain is expected to solve this problem .

4. Summary

Blockchain technology itself is neutral , Various scams have brought bad reputation to the blockchain . But like all new things , It's always rough at the beginning . Blockchain technology is still developing , There are also many scenarios where blockchain is expected to be used to solve problems . Rising in twists and turns , Blockchain still has a long way to go .

writing / Rayjun

copyright notice
author[Rayjun],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202010217086826.html

Random recommended