A 3-step guide to quickly understand blockchain technology!

The blockchain has been popular from 2017 to 2018. Recently, more and more friends are asking "What is a blockchain?". Different people may have different opinions on this issue.

In Dr. Xiao Feng's latest speech, he explained what a blockchain is from the perspectives of its hierarchical decomposition, technological development process, and economic significance. (Click here to view Dr. Xiao's latest speech: http://www.ljzfin.com/node/8347.jspx?from=groupmessage&isappinstalled=0)

This article, translated from a foreign language blog, uses plain language to explain the three main components of the blockchain in three steps: the blockchain itself, the peer-to-peer network and the consensus mechanism, which will help us gradually understand the block The underlying technology of the chain. Combined with Dr. Xiao Feng's speech, you will have a deeper and more thorough understanding of blockchain technology from the level of mechanism, economy and technology.

This article can be easily understood even by non-technical persons. Now share it with you for your reference.

llThe following is translated from the blog post "The Quick, 3-Step Guide to Blockchain Technology" published by Thijs Maas on Hackernoon, which only represents the author's point of view and does not represent the position of Wanxiang Blockchain. The content is for reference only.

 

The first step  is to understand the blockchain technology itself

Simply put, blockchain is actually a way of building data. It is a ledger: a file that keeps accounting records.

This document is like a book that never ends.

Each page of the book has content and a page number at the bottom of the page. With the page number, you can immediately know where the page belongs to, for example, page 49 is between pages 48 and 50.

Like the pages of a book, each block is filled with content. Although blocks are not explicitly numbered, they have timestamps, which function exactly like page numbers, and are considered "numbers" for each block. A new block is always added after the block with the most recent timestamp. Thus, the chain is formed.

The cool thing about blockchain is that it uses encryption to ensure that when any information on the “pages” changes, we notice it immediately. This property makes the blockchain an excellent data structure for keeping and tracking valuable records.

In the Bitcoin blockchain, the block contains the transaction information of Bitcoin. For example, Zhang San sent this Bitcoin to Li Silai.

Since the Bitcoin blockchain records all transactions since the existence of Bitcoin, we can determine when Li Si owned the Bitcoin by examining the ledger. "Who owns something at a time" is what we call the "state" of the blockchain.

A transaction actually happens when it is recorded in a block and added to the chain. Therefore, when a block is added to the chain, the blockchain is updated. This means that if I want to verify that someone actually sent me a bitcoin, I have to be able to check the state of the blockchain. To be able to do this, the ledger must be publicly available. This is where peer-to-peer networking comes into play.

 

Step 2  Understand the role of peer-to-peer networks

It would be annoying if the blockchain was only stored on one computer, and that computer happened to be turned off. Because I can't verify whether the other party has transferred money to me anytime and anywhere. Therefore, the blockchain is distributed and stored on several computers in various regions of the world.

 

 

These computers, called "nodes," work together in a peer-to-peer network to ensure the security and state of the blockchain. Every node stores a full version of the blockchain, and every time a new block is added, every node also updates the blockchain. Using a peer-to-peer network has the following advantages:

☞I can use the blockchain to check the transaction status anytime, anywhere;

☞I don't have to rely on one party to know the latest status of the transaction;

☞When a hacker attack occurs, the other party must attack thousands of computers at the same time, not just one server;

☞There is no need to worry that the information in the blockchain will be deleted or tampered with, to achieve this, the information in all computers must be modified.

 

But the above does not mean that the blockchain is 100% secure. For example, how do I know that the information recorded in the blockchain is correct? How to verify whether a block contains invalid transactions? If there are different versions of the blockchain, how do I know which one is the real record?

The clever thing about blockchain is that these problems can be solved with a consensus mechanism.

 

The third step is to  understand the consensus mechanism

The magic of the consensus mechanism is that it allows all nodes in a peer-to-peer network to work together without having to know and trust each other.

A consensus mechanism is a simple set of rules: nodes in the network agree on by running the network software. These rules ensure that the blockchain network works as intended and stays in sync.

 

The consensus protocol specifies:

☞How to add a block to the chain

☞ When is a block considered valid?

☞ How to resolve truth conflicts

 

Add the block to the chain

Different blockchains have different ways of adding blocks.

The most famous consensus mechanism is the Bitcoin PoW mechanism (Proof of Work). The first rule of PoW is that, on average, every ten minutes, a block is added to the blockchain.

This process is called "mining" and the nodes that add new blocks are called "miners". Under the PoW mechanism, the system will generate a cryptographic puzzle, and miners use the computing power of the computer to solve the cryptographic puzzle in the system to add new blocks. The consensus mechanism states that a new block can only be added after the cryptographic puzzle has been successfully solved. Miners who successfully add new blocks are rewarded with new coins embedded in the system. Subsequently, all miners start mining the next block.

PoS (Proof of Stake) is also one of the common consensus mechanisms. This mechanism determines the right to bookkeeping by calculating your equity, including the amount of coins you hold and the time you hold the coins. Whoever has the largest stake will get the right to add new blocks.

 

block validity

When a miner solves the puzzle and "mines" a block, all nodes in the network check if the block is valid and add it to their respective copies of the blockchain.

Nodes first need to agree on the legitimacy of the block, and only then will the network achieve synchronization and update the state of the blockchain. Only new blocks that follow the rules set by the consensus mechanism will be accepted by nodes and added to the chain. Blocks that do not follow the rules will be rejected for addition.

Normally, only blocks that contain transaction information are valid. Taking the Bitcoin blockchain as an example, the rules of the protocol stipulate that you cannot send bitcoins if you have not received bitcoins from others or mined bitcoins. In other words, if the sender has received enough bitcoins to make a transaction, nodes will run software to check the state of the network by checking all transactions in the block.

Now, let's say I have received 1 bitcoin, which I later send to Zhang San, and then I try to send the same bitcoin to Li Si. As soon as my first transaction is added to the chain, all nodes update the blockchain to prove that I don't have that bitcoin now, and any block that contains the transaction information for me and Li Si will be rejected. The nodes’ software sees that the block is not following the rules, so they don’t add the block to the chain.

The rules also state that only transactions with the digital signature of the Bitcoin holder are valid transactions. Only the person who controls the wallet or address where the bitcoin is sent can sign the transaction. Therefore, only you can spend your bitcoins.

 

How to resolve truth conflicts

Occasionally, two miners will add valid blocks to the chain at the same time, with some nodes accepting a valid block from one miner and a portion accepting a valid block from another miner. The first block contains information about my transaction with Zhang San, and the second block contains information about my transaction with Li Si. Now, I suddenly have two blockchains in different states at the same time.

We call this situation a "fork". Does Zhang San or Li Si own the Bitcoin I sent? Which of the two chains is the 'real' blockchain?

Typically, all consensus protocols have a simple rule to solve this problem: the longest chain wins!

When a fork occurs, some miners will mine on this chain and others will mine on the other chain. Inevitably, there will be more miners on one chain than the other, so the chain with more miners will grow faster.

Miners on the other chain will migrate to the longer chain, and the forked chain will disappear. In this way, there is no damage to the main chain.

 

Because miners are economic actors acting in their self-interest. A miner who knows that the forked chain will die will not be interested in mining on the forked chain. All transactions on the forked chain will never happen on the main chain, which means that miners who mine on the forked chain will not be rewarded.

In the above situation, we call it a soft fork .

In a few cases, a forked chain may generate a significant amount of mining power. In this case, it may take a while to determine which chain is the main chain. Conventional wisdom says that it takes 6 blocks to actually confirm a transaction.

The translator added: This situation is called a hard fork , and the nodes working on the original chain cannot verify the blocks produced by the nodes on the forked chain, so two chains will be split. The two chains will run side by side.

 

The rule of "the longest chain wins", coupled with the objective requirement that adding a block requires huge computing power, makes the blockchain highly secure. The only way to attack the network is to go back to a block in the blockchain, fork the blockchain and start mining new blocks from there. However, to do this, the attacker would have to redo the work of all previous miners and try to catch up to the main chain. Without more computing power than the entire network of miners, an attack is basically impossible. This is also the reason why blockchains are not vulnerable to attacks.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325026444&siteId=291194637