Block chain learning: block chain acquaintance

Block chain acquaintance:

Block chain is to achieve a special kind of distributed database technology.

The main role is to store information block chain. Any information needs to be saved, you can write block chain, it can be read from the inside, so it's database.

 Secondly, anyone can set up the server, block chain to join the network as a node. World block chain, there's no central node, each node is equal, we have preserved the entire database. You can ask any one of the nodes, the write / read data, because all nodes will be the last synchronization, ensure consistent block chain.

 Distributed database is not a new invention, has long been on the market for such products. However, the block chain has a revolutionary features.

Block chain is not an administrator, it is completely free center. Other databases are an administrator, but not block chain. If someone wants to add a review of the block chain, can not achieve, because of its design goals is to prevent central to the authorities appeared .

 

What is the block:

A block chain of blocks ( Block) composition. Record blocks like database each time data is written, is to create a block.

Each block comprises two parts:

  • Header regions ( Head): Record feature value of the current block
  • Block body ( Body): Actual data

Header region contains the current value of the block number characteristic , generation time, the actual data (i.e., block body) hash, a hash block and so on.

  

Hash: "Hash" is arbitrary content computer can calculate the same value of a characteristic length.

Block chain hash function:

Block chain of hash length is 256, which means that, no matter what the content is original, the final will calculate a 256-bit binary number. And I can guarantee, as long as the original content is different, the corresponding hash must be different.

 

Why is called the block chain :

Blocks and hash is one to one, each block of hash are for "header area" calculation . That is, the various features of the bucket header, connected together in order to form a long string, then compute the hash of the string.

Hash = SHA256 (header regions)       where: the SHA256 hash algorithm block chain . This formula which contains only the header area, does not contain a block body  . Hash is uniquely determined by the header area.

  

Header area contains a lot of content, which current hash tank body, there is a block of hash. This means that if the contents of the current block body has changed, or a block of hash changed, will cause changes in the current block of hash. If someone changes a block, the block of hash had changed. In order to make the back of the block can connect to it (because the next block contains a hash on a block), which in turn must modify all blocks behind, otherwise get rid of the block is released from the block chain a. Due to reasons mentioned later, it is very time-consuming to calculate the hash, modify multiple blocks within a short time is almost impossible, unless someone has mastered the whole network more than 51% of computing power. It is through this linkage mechanism, the block chain to ensure the reliability of their data once written, can not be tampered with.   

They are attached to each block on a block, which is the origin of the "block chain" of the name.

 

Block chain applicable scenarios:

Block chain as a distributed database of neglect.

To ensure the reliability of the data, the block chain also has its own price. First, the efficiency, data is written to block chain, at least to wait ten minutes, all nodes synchronize data, you need more time; the second is to generate energy, the block needs to be meaningless to calculate countless miners, which is consuming energy.

Block chain has its own adaptation of the scene:

  • The absence of all members trust authorities
  • Data is written does not require the use of real-time
  • Mining revenue to make up the cost itself

As the above-mentioned conditions are not met, then the traditional database is the best solution.

 

Block chain development language of choice:

To do anything depends on:

  1. If you want to own the realization of a block chain platform , and that the choice of what language can be developed, such as: the Java, c / c ++, Python, nodejs, Go ...
  2. You want to be on the ground floor of the existing block chain platform, then look at what the mainstream development language platform yes. Such as Ethernet Square underlying protocol most popular version is the use of go language, then you can learn to go.
  3. To make application development based on existing block chain, then we should look at the constraints of the platform. For example mainstream development language on intelligent Ethernet Square contract is solidity, decentralized application development language is nodejs and html / javascript / css.

Guess you like

Origin www.cnblogs.com/chenzhijuan-324/p/11563944.html