What is the principle of blockchain? How to develop a blockchain program

introduce

Blockchain can be understood as a distributed database that reads and stores data. Features: Durability, Robustness, Transparency, Not Destruction.

At this time, some students will ask: "Teacher, others say that the blockchain is a distributed ledger, and there is a reward mechanism. You can get rewards through mining, why is it different?" The limitations are consistent with Bitcoin, but Bitcoin was in the era of blockchain 1.0, with digital currency as the main application, which can be understood as a distributed ledger, where a block is generated every ten minutes and then some Bitcoins are rewarded. But this is only one of the blockchain applications, and there is no reward mechanism in the blockchain 3.0 super ledger, not only accounting, but also storing pictures, videos, texts, etc., so the blockchain is understood as distribution database is more accurate.

Another student asked: "Blockchain 1.0 is Bitcoin, 3.0 is Hyperledger, what is 2.0?" Good question, very serious, just like this, driving learning through questions, blockchain 2.0 is a smart contract , is also more mainstream now, such as raising a pet some time ago, it is a smart contract, and basically speaking of blockchain programs at present, it refers to smart contracts. These will be covered in subsequent columns. Let's take a look at the characteristics of the blockchain.

 

 

Durability:

Bitcoin has been running for 9 years, and there are no major problems, and it runs automatically. Everyone can see the source code. As long as there are nodes, it can continue to run, even if there is an earthquake or a volcanic eruption. It will affect, there is no cost of cloud server, no operation and maintenance, and can last for a long time.

 

Robustness:

It's easier to understand with the familiar word "decentralized", but what is its essence? You can think about it. For example, inflation in Zimbabwe leads to devaluation of the currency. The reason is that the Zimbabwe government over-issues currency. Because the government can control the issuance of currency, it can be understood as a currency center. In this case, the stability of the currency is controlled by the government. Here, decentralization is to remove the currency center, and no single individual can affect the entire market.

 

Transparency:

It is recommended that you go to the Bitcoin official website: https://bitcoin.org/zh_CN/choose-your-wallet , download a wallet and see all the data, from the birth of Bitcoin to the present, the following picture is Satoshi Nakamoto in the first The information written in the genesis block,

EThe Times 03/Jan/2009 Chancellor on b rink of second b ailout for banks. Okay, it's transparent enough that anyone can view it.

 

 

Not destructive:

This can be understood as non-tampering, because each block contains two hash values, one is the hash value of the previous block, and the other is the hash value of the current block, as long as any content in the hash value is changed , the Hash value will change. For example, there are 100 blocks now, and someone changes the 53rd block, then the blocks from 54 to 100 will also change, that is to say, the owner of the block from 54 to 100 needs to make changes. , and must obtain the consent of more than 50% of the block owners, everyone will synchronize the information you changed.

 

 

How to develop a blockchain program:

The blockchain program we are talking about now basically refers to smart contracts. The development language is solidity. Smart contracts can be understood as deploying applications written in solidity on the blockchain. As for the development language of solidity, it is also easy to learn. of:

  1. variable type, definition, use
  2. Function definition, passing parameters, returning parameters
  3. Process control
  4. cycle
  5. initialization, constructor
  6. The life cycle
  7. class definition, inheritance

Solidity needs to be compiled. If you understand these basics, you can start writing the first smart contract. Other features will be learned naturally during the practice process.

 

 

Summarize:

Introduces the properties of blockchain: durability, robustness, transparency, invulnerability

The development language of smart contracts: solidity

Three Era of Blockchain: Bitcoin 1.0, Ethereum 2.0, Hyperledger 3.0

In the Internet age, everyone may be 996, working from 9 am to 9 pm, 6 days a week.

The blockchain era is 8247, working from 8 am to 24 pm, 7 days a week.

 

 

 

 

 

 

Guess you like

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