The concept of chain block is a very recent fire, walk into an office building elevator, hears someone talking about block chain, or Fried currency:) hope that through this article, can let you to block chain have a overall understanding of the concept of after understand the concept, the next article will spend about 300 lines of Python code, a block chain network.

Block and chain

A block is a block (or what?) One by one, these pieces are linked together like a chain called a blockchain (read on before you hit me).

This is some chain, chain value is more reflected in the lock downstairs small electric car, but let’s take a closer look at this chain is not a bit like that? ⛓

Clever! Your high school biology teacher is smiling at you! This is the legendary deoxyribonucleic acid (DNA), also a chain structure that carries genetic information. The “blocks” in a blockchain are like deoxyribonucleotides in DNA (I don’t know what I’m talking about), and the “chains” in a blockchain are like the chains of DNA.

The key to the difference in value between DNA and chains is that DNA carries a lot of genetic information, while chains carry nothing. For blockchain, carrying information is also an important feature (without carrying information, chain electric cars would not play a role).

When a blockchain carries accounting information, it becomes a particularly powerful thing — a ledger (we named it bitcoin after the post-00s).

Peer-to-Peer

For the sake of professionalism, we’ve dedicated the essay “Bitcoin: A Peer-to-peer Electronic Cash System. From the title of this paper, we can see that blockchain is based on peer-to-peer. Let’s see what peer-to-peer is.

Peer-to-peer, peer-to-peer, it’s a peer-to-peer network, see, I don’t know.

Each of these square heads is a Peer, and notice that the square heads have one thing in common, they all look the same (not only do they look the same, but each head is connected to the other). This is also the biggest characteristic of P2P network — decentralization. There is no central node in P2P network. All nodes are equal.

Consensus mechanism

You, your gay friend, Lao Wang, and a girl you both like, Ah Yuan (yes, round), form a three-node P2P network, according to which no one of you has the final say. On this day, ah yuan’s birthday, you and Lao Wang sent a big cake to Ah Yuan at the same time, so the question arises, which one will Ah Yuan eat first?

Since no one is in charge, and you can’t duel with Lao Wang (the computer is afraid to destroy mankind by doing so), the civilized way to decide is to consult. Since we are talking about it, we need to have rules, and these rules are called consensus mechanism.

Proof-of-work

There are many kinds of blockchain consensus mechanisms, and proof-of-work is one of them. Proof-of work is a bit like a match of arms. You and Lao Wang are very kind to Ah Yuan, and ah Yuan is also having a hard time deciding which one to eat first. So she invites two martial arts masters of equal strength, and asks you and Lao Wang to compete with the masters respectively. The one who wins the master will eat the cake first.

Just pinch these together

Knowing the concepts of POW, consensus mechanism, P2P, block and chain, we can put them all together and see what happens.

We assign each node in the P2P network to a chain, so that all the chains in the network are equal. Then we add a block with information to one of the chains, and the P2P network synchronizes this block to all the chains, that is, the information will be stored on all the nodes.

Condense the above paragraph into one sentence (which is more powerful) :

Blockchain is an intelligent peer-to-peer network that uses a distributed database to identify, disseminate and record information, also known as the Internet of value.

Do you know a thing or two about blockchain?

Focus on Python private dishes