Recreating Bitcoin 17:Network Flexibility

Epilogue #

In the last chapter, we introduced the technical concepts of block chain and block reward.

This chapter focuses on the connection mechanism to make the network more flexible.

The Problem

In the café, Satoshi and Gilfoyle deployed the new code.

Block rewards is another world-class design that was previously UTXO. It cleverly enables the Bitcoin system to simultaneously implement the incentive mechanism of node accounting and the minting and issuing mechanism of currency.

“With block reward, the network will have more nodes joining in, and based on the network design, between all the nodes, there would be a star network,” Satoshi said (see graph below).

图片 1.png

Star network

Satoshi continued: “Star network is not the type of network I want. It is too fragile, what I want is a mesh network.” (see graph below)

图片 1.png

Mesh network

“The reason it has become a star network was that we locked in the IP addresses in the code as a temporary solution,” Satoshi said. “The new nodes will only connect to the three old nodes (Node1, Node2 and Node3). Such networks are fragile. Because those three nodes are equivalent to a message relay station carrying the whole network. When the network load is too high, if those three nodes die, the whole system will crash.“

“How do we build a mesh network? You can’t add an IP to your code every time when you add a new node. The list of IP addresses will become a single point in the system. That is, the system will rely on the person maintaining the IP list.” Gilfoyle asked.

“Of course not,” says Satoshi. “we now have to come up with a new solution, ideally without human intervention. Nodes can be automatically connected to each other. Form a mesh network. And when the network is partially damaged, it can repair itself.”

“It looks like the Bitcoin network is an intelligent organism that can grow and recover on its own,” said Gilfoyle.

“Yes, yes,” Satoshi said. “it’s the feeling of a biological system that makes the whole network look as if it were alive, with a strong vitality.”

Is the work of the model-making-its-own-model a sacrament or a blasphemy?
—— “Out of Control” by Kevin Kelly

Vitality #

In a sense, Satoshi was not creating so much of a living system, he is searching for the essence of vitality.

Vitality is not something that is created, vitality is the protagonist, and creation is only a cloak for the expression of vitality itself. And the human role is the conduit between vitality and creation.

Satoshi is a conduit right now. One is attached to the body of the system, the other is looking for the soul of the system.

What is the essence of vitality? How can we touch BEING itself?

Vitality Lies in Improvisation #

Vitality is improvisation, improvisation is freedom, and freedom is randomly.

Improvisation, on the micro scale, is random selection.

The Earth is an improvisation of the universe, life is an improvisation of the Earth, and human is an improvisation of life.

The essence of the inexplicable force of the nature is randomness. Quantum physics tell us that God plays with a dice.

Life originates from randomness, a sustainable sort of randomness.
Randomness is partial unevenness in probability.

High probability and low probability give rise to a pulling force, as in the pulling force between ice and water. Entropy arises out of this kind of force.

Because of this pulling force, the randomness has a direction.

The force and the randomness complement each other. One is a necessity for the other.

Without the pulling force there is no shape. Without the randomness life is formless.

The loosening and the tightening of this force creates a rhythm, which gives rise to evolution.

Life is given birth by this force to the world, once born, the midwife is no longer needed.

Once life begins, entropy never stops. Life then seemingly becomes a snake that feeds on its own tail.

图片 1.png

[W]ild life resembles that strange loop of the Uroborus biting its tail, consuming itself. But in truth, wild life is the far stranger loop of a snake releasing itself from its own grip, unmouthing an ever fattening tail tapering up to an ever increasingly larger mouth, birthing an ever larger tail, filling the universe with its strangeness.
—— “Out of Control” by Kevin Kelly

How does a person live to vitality?

The answer is to be him/herself.

To be him/herself, not to live towards a goal.

That is to say, he has the freedom to choose freely, and this freedom is the source of vitality.

This mode of freedom, we call it improvisation.

How to Let the System be Itself #

Satoshi said, “We will instill the improvisational soul into the system!”

“What does that even mean?” asked Gilfoyle.

“Abstractly, the way to give improvisational properties to a system is to give a few simple principles and give up your control,” Satoshi said.

“The essence is to make as few fundamental principles as possible, and they must be very simple. Simplicity gives room for evolution and mutation on the microscale,” he continued. “At the same time, these fundamental principles make sure that the direction of evolution doesn’t get out of shape so that the system moves towards one direction in general.”

“Okay. So what are these bottom-line principles?” asked Gilfoyle.

“I’ve thought about this a lot,” said Satoshi. “They are random connection and information sharing. They allow for the emergence of mesh network and self-repairing ability.”

So what happens when these two principles were added to the nodes?

Network Discovery #

A new node is launched. We call it: Little Boy.

Little Boy opened his eyes and saw nothing but darkness, feeling as if he’s floating around in the universe all alone.

He heard an outcry from within himself saying “find your own kind and connect to them!”

He realized that there are members of his own kind in the universe and he must find them.

He extended his reach and searched around in darkness, expecting something to get his hands on. Finding nothing, he extended his reach further and explored deeper.

This behavior of the Little Boy is what’s called network discovery. The reach of the Little Boy is Client Socket, which sends network requests to an 8332 port of the Server Socket of a random IP address and waits for response. Most likely the Little Boy receives nothing, either because the IP does not exist, or it does not belong to a Bitcoin node even if it does exist. Once Little Boy detects no response, he selects the next IP and repeats the act.

Over and over, until he finds a Bitcoin full node.

Days pass, Little Boy had made tens of thousands of attempts, and right about when it was about to give up, it found one of his own kind. Its IP was 138.68.248.103, which happened to be the address of Bob’s machine.

The first handshake #

Little Boy immediately sent about the request for his first handshake (version),

“I am Little Boy.

My software version is 0.0.5 (version: 0.0.5).

The local time is 1552978426 (nTime: 1552978426).

My IP is 211.13.32.104 (addrMe: 211.13.32.104).

From where I am, your IP is 138.68.248.103 (addrYou: 138.68.248.103).
My block height is 0 (BestHeight: 0).”

Then it waited for the node for a response.

Node 3 finds out about the new IP request and notices that a new node named Little Boy has requested for a connection. It immediately returns (verack): “granted.”
Then, Node 3 sent a handshake request (version) to Little Boy:
“My software version is 0.0.5 (version: 0.0.5).
The local time is 1552978426 (nTime: 1552978426).
My IP is 138.68.248.103 (addrMe: 138.68.248.103).
From where I am, your IP is 211.13.32.104 (addrYou: 211.13.32.104).
My block height is 221 (BestHeight: 221).”
When Little Boy received the connection success message from Node 3, it granted connection to Node 3 as well.
This way, through Node 3, Little Boy finally joined the accounting network (see graph below).

图片 1.png

First “handshake” between the new node and Node 3

Propagation and Discovery of Addresses #

However, only connecting to Node 3 makes Little Boy vulnerable to one-point failure. More connections are needed.

Little Boy sent Node 3 the second around of requests (addr), “My address is: 211.13.32.104, please introduce me to your other connected nodes and ask them to connect with me.”

In addition, Little Boy sent another request (getaddr), “Please share the IP addresses of your other connected nodes. I’ll connect with them on my end.”

Node 3 received the two requests from Little Boy and shared the information with it. It also broadcasted the address information of Little Boy to its other connections.

Soon, Little Boy had connections with other nodes. A mesh network is created.

This method could help new nodes to find connections with other nodes. By repeating the addr and the getaddr requests above to other nodes, new connections can be established (see graph below).

图片 1.png

The propagation and discovery of addresses

Propagation of data #

As explained previously, besides IP addresses, block data are also shared among nodes for synchronization purposes. One thing to point out here is that except for synchronizing the latest block, requests can be made to synchronize data from a specific block height.

For example, if the latest block height is 220 and the block height of Little Boy is 217, synchronization start from the height of 217 for Little Boy (see graph below).

图片 1.png

Block synchronization through peer nodes

Network Flexibility #

At the moment, Little Boy had three neighboring nodes: Node 3, Node 4, and Node 5.

Initially, Little Boy wanted to connect to mode nodes but found out that as the connections increased in number its network pressure grew too. Ultimately, it only chose its best three nodes to stay connected.

Little Boy was concerned about the reliability of its neighbors, so every now and then, it used getaddr and addr to discover new nodes and stored the IP addresses of these new nodes for future use in case of a loss of connection.
How does the little boy monitor whether his neighbor is lost? It turned out that the little boy had a timer. If he found a neighbor who had not been moving, he would send a message every 30 minutes to maintain the connection. If a neighbor doesn’t communicate over a connection for more than 90 minutes, the little boy thinks the neighbor is lost and immediately looks for a new node to replace the lost neighbor.

In such a wonderful country, every node has the same improvisational freedom:

Who do you want to connect to? Up to you!
How many neighbors to connect? Up to you!
Want to change neighbors? Up to you!
On or Off? Up to you!

The network looks like a swarm of self-aware bees, dynamically adjusting itself at all times, to the point where it can stretch itself without central control.

The Bitcoin system is starting to shine.

When a node is disconnected, the data automatically selects another path so that the entire network is not affected. And because there are new nodes coming in, or new connections between old nodes, the network looks like it is self-healing.
—— “Out of Control” by Kevin Kelly

Epilogue #

Bitcoin had evolved into a new connection mechanism. The accounting network presents a very simple idea of intelligence.

We had not yet created a verification and reward/punishment mechanism based on the assumption that all nodes are benevolent. But malicious acts necessarily happen as long as there is room for profit.

Next chapter will show how nodes commit malicious acts.

In addition, the discovery process in this chapter has some centralized solutions other than the crawler tool, such as locking in some DNS seeds in the code, but for concision purposes they are not covered.

Next chapter :Recreating Bitcoin 18:Proof of Work (Part I)

CONTENTS #

Recreating Bitcoin:A Fictional Story of Why Bitcoin was Designed This Way

Part one : Transactions
Recreating Bitcoin 1:Start over with a Simple Web Transaction System
Recreating Bitcoin 2:First Version is Online!
Recreating Bitcoin 3:Getting Rid of the Account Model
Recreating Bitcoin 4:Digital Signature
Recreating Bitcoin 5:Public Key and Private Key
Recreating Bitcoin 6:Version 0.0.2 is Online!
Recreating Bitcoin 7:UTXO
Recreating Bitcoin 8:System Refactoring Based on UTXO
Recreating Bitcoin 9:Everything is Transaction
Recreating Bitcoin 10:Transaction Script

Part Two : Swarm System
Recreating Bitcoin 11:Swarm System (Part I)
Recreating Bitcoin 12:Swarm System (Part II)
Recreating Bitcoin 13:P2P Network
Recreating Bitcoin 14:Synchronizing Transactions
Recreating Bitcoin 15:Synchronizing Ledger
Recreating Bitcoin 16:Block chain
Recreating Bitcoin 17:Network Flexibility
Recreating Bitcoin 18:Proof of Work (Part I)
Recreating Bitcoin 19:Proof of Work (Part II)
Recreating Bitcoin 20:The Reorganization and Division of
Forking

Complete book selling at Amazon( > US > UK > CA > JP > DE > FR > ES > IT) #

amazon.png

BSV Donate:
1Djc4TdVBi8urzmSXKHwg8cpEAYKcRQxgY

©2019 - Recreating.org all rights reserved

 
0
Kudos
 
0
Kudos

Now read this

重新创造比特币6:第二个版本上线啦

作者:何岩,由 recreating.org发行。 0.前言 # 中本聪和Gilfoyle一起合作,完成了Bitcoin0.0.2版本的设计工作。 重要的改变包括: 1.加入数字签名。 2.公钥替代用户名。 3.将签名加入交易模型。 4.删除了账号模型。 新版本,让交易变得更自由! 1.创建私钥 # 中途镇,咖啡馆,经过一周的开发和测试,Bitcoin0.0.2版本上线了。 中本聪找到Bob:“Hi,老板,Bitcoin的新版本上线啦!再有新客户想加入,... Continue →