What is the blockchain - Web3.0 Ethereum combat (1)


Written at the front:
Many readers may think that concepts such as blockchain, web3.0, and metaverse are all scams. Xiao Wang agrees with this point of view very much. But when the so-called "scam" has real results that can change people's daily life and cognition, and is accepted by the public, the "scam" becomes "real".




foreword

If you want to learn Ethereum, you must first understand the concepts of Web3.0, Bitcoin, and blockchain. There are already many related introductions on the Internet, so I won’t go into details here. Xiao Wang directly quotes the ready-made links here. Everyone needs to know the relevant knowledge first.

Web3.0

Comic Analysis of Blockchain Blockchain

bitcoin


This issue mainly introduces the relevant knowledge of the blockchain, so that everyone has some understanding of the term blockchain, which is convenient for later learning of Ethereum.


1. What is blockchain?

Blockchain is a data set, data is packaged into blocks, and a chain structure is formed between blocks. (Bitcoin is an implementation of blockchain technology, or an instance of blockchain) It can be said that blockchain is a distributed ledger that allows participants to exchange data in the network and prevents data from being corrupted. Be tampered with, thus gaining everyone's approval.


1. The structure of blockchain

The blockchain is composed of blocks one by one , and multiple blocks are connected in series to form a chain-like data structure, which is called a blockchain.


(1) block

A block consists of a block header and a block body .

Block header: contains block number (unique id), block hash value, block creation time, parent block hash, Nonce (will be mentioned later), etc.

Block body: contains transaction information, account information, etc.


blockchain structure



(2) Chain structure

Each block will calculate a hash value based on its own overall data, and the next block will contain the hash value of the current block. (Of course, all the data in the current block also includes the hash value of the previous block, which has a little recursive meaning in it.) In this way, it is only necessary to calculate the hash to confirm whether the block has been tampered with. A block is packaged to form a chain structure of the blockchain.


2. Common Proof Mechanisms


Since the blockchain is a distributed ledger, how can the ledgers of each node reach a consensus? Therefore, a proof mechanism is introduced


1. Workload Proof Mechanism (PoW)

The proof-of-work mechanism (PoW) believes that most people are credible, and everyone should be allowed to verify the ledger and increase the difficulty of tampering.


The PoW mechanism increases the difficulty of creating a block. Since the hash value needs to be calculated when the block is created, the PoW mechanism requires a certain condition to be met when creating a block, such as: the first 6 digits of the hash value are required to be "0" ( In the end, the first few digits are 0, and the difficulty changes).


Therefore, the "Nonce" in the block header mentioned above plays a role, and it increments from 0 until the Hash value that meets the conditions is calculated.


For verification, it is only necessary to substitute the qualified Nonce value into the calculated hash value.
For the tamperer, not only the data of the block has been tampered with, but also the Nonce of the subsequent block needs to be recalculated (because the hash data of the tampered block will affect Links to subsequent blocks) This workload is huge.


2. Proof of Stake (PoS)


The proof-of-stake mechanism determines the probability of an account obtaining bookkeeping rights by evaluating the time and number of tokens held. Compared with PoW, PoS will not cause too much waste of resources, and people with more tokens are more inclined not to modify the ledger.


3. Application of blockchain

Here is a reference to Zhihu’s introduction to blockchain applications.
Blockchain applications


Summarize

This issue briefly introduces the relevant knowledge about the blockchain, the data structure of the blockchain, the method of maintaining the stability of the blockchain, and its application. Understanding blockchain-related concepts is the first step in learning Ethereum.


Blockchain is a very broad concept, just like the concepts of "digital twin" and "metaverse". It doesn't have a lot of technical details, just like a "class" in the program. When we understand the basic concept of this "class", we can easily carry out instantiation development (such as developing DApp, writing smart contracts)

Guess you like

Origin blog.csdn.net/weixin_44630289/article/details/124100974