Recreating Bitcoin

Page 2


Recreating Bitcoin 6:Version 0.0.2 is Online!

Prologue

Satoshi worked with Gilfoyle to complete the design of Bitcoin v0.0.2.

Important changes include:

1.Adding digital signature

2.Public key replacing username

3.Adding signature to the transaction model

4.Deleting the account model

The new update has made transacting ever freer!

Creating a Private Key

Midway, inside the cafe. After a week of developing and testing, Bitcoin v0.0.2 was launched.

Satoshi went to Bob, “Hi Bob. Bitcoin has just updated to its latest version! If new customers want to join, they no longer need to register with me. They can create account themselves (that is, create address).”

“Fantastic! Anyone fancy a cup of coffee? And try out the new system!” Bob announced to the whole store.

“I’ll have a go. I was just about to get a cappuccino as well,” Alice came around the counter.

Alice took out his phone and entered bitcoin.org on the browser. A...

Continue reading →


Recreating Bitcoin 7:UTXO

Prologue

The second version of Bitcoin has been launched and was running without issues.

Important changes included:

  1. Adding digital signature

  2. Replacing usernames with public keys

  3. Adding the digital signature to the transaction model

  4. Deleting the account model

This chapter talks about how to redefine transactions.

Transactions are the core of economic theories. Transactions are everything.

Transactions carry not only the motivation of each individual, but also the mottle of the whole world. Understanding the concept of transactions determines how high Bitcoin can reach. How to understand transactions reis determined by how to define transactions.

The Bug

After the launch of the new version, everything seemed to be running normally.

However, where there is human design there are bugs.

One day, Alice found Satoshi and told him that her balance returned to zero and suspected...

Continue reading →


Recreating Bitcoin 8:System Refactoring Based on UTXO

Refactoring Transaction Model

In his head, Satoshi runs a simulation of UTXO’s design: “there should be no major flaws in the design now, so we can go into the design of the trading model.“

Gilfoyle said: "the UTXO is really elegant and the transaction model will change a lot.”

The new transaction model comprises four parts:

  1. TXID: Hash Value of the transaction (as to what Hash is, there will be detailed explanations later. For now, it can be understood as: any data as a parameter entered into the hash function will produce a unique fixed-length character string. That is, Hash = FuncHash(m))

  2. IN: all the UTXO referenced by the current transaction.

  3. OUT: all the UTXO generated by the current transaction.

  4. ScriptSIG: the signature script of the current transaction – digital signature (encrypted) + sender’s public key (unencrypted)

For a more detailed look into these terms:

TXID: the...

Continue reading →


Recreating Bitcoin 9:Everything is Transaction

Epilogue

This chapter will explain the reason to design transaction as a function equivalent.

And, what is the essence of a function?

Transaction Designed as a Standard Function Equivalent

In the café, softened chatter mixed with smell of coffee.

Gilfoyle was holding his coffee, looking out of the window.

Satoshi was also holding his coffee and looking out of the window.

Both were enjoying an inner feeling of satisfaction and fulfillment.

They were satisfied with the UTXO design: both understood that they created a world-class design.

Gilfoyle turned his head and looked at Satoshi, “You’ve got ambition?”

Satoshi looked back, dumbfounded, “What do you mean?”

Gilfoyle said, “What I’m saying is, do you want to make Bitcoin wilder?”

Satoshi said, “Of course. I’m not even afraid of breaking it. Untamed in what way? I’m a liberal.”

“What’re you thinking?” Satoshi asked.

“I want...

Continue reading →


Recreating Bitcoin 10:Transaction Script

Epilogue

Gilfoyle had this ambitious thought of making Bitcoin a general world computer.

Satoshi and Gilfoyle had a general idea for its design.

Now it was time for implementation.

Transaction Data Model

“How do we functionalize transactions?” Satoshi asked.

Gilfoyle gave his idea for implementation.

The current transaction model included:

  1. IN: references two UXTO on her own address
  2. OUT: creates two new UXTO, one for Bob and the other for change left to Alice
  3. TXID: generates the Hash Value of current address.
  4. ScriptSig: Alice’s digital signature + Alice’s public key

Server’s Verification Logic

The server-side computing resources focused on if the ScriptSig was valid with the following steps:

  1. Calculate the Hash Value of the current transaction data
  2. Decrypt digital signature to get the TXID
  3. Verify if the results from step 1 and 2 are the same. If they are the same...

Continue reading →


Recreating Bitcoin 11:Swarm System (Part I)

Epilogue

The first half of this book revolves around the evolution of transaction.

From this chapter, we delve into peer-to-peer network architecture.

The Bitcoin system will evolve towards a living organism.

Finding a Direction

Midway, café.

Satoshi and Gilfoyle completed the transaction script mechanism according to the design. Bitcoin was now in the next stage of its evolution.

Then Satoshi started thinking about how to make complex living organism out of Bitcoin’s current capabilities.

Satoshi said, “I want to grow Bitcoin into an independent living system, self-sufficient and not relying on my daily maintenance.”

Gilfoyle said, “That’s a fantastic idea!”

“But it absolutely makes sense after some thought. If Bitcoin wants to become a world-class general computer, it must have global trust. If the system relies on one person for maintenance, this trust won’t happen. Bitcoin...

Continue reading →


Recreating Bitcoin 12:Swarm System (Part II)

Epilogue

Satoshi and Gilfoyle clarified Bitcoin’s goal. That is, a swarm system.
So how could a computer system evolve from a clock system into a complex system?

A Swarm System Cannot be Designed

In the café, Gilfoyle was drinking coffee.

Satoshi walked in with a holding a pile of books in his arms.

He put down the books and said to Gilfoyle, “I just found these books on life science in the library. They should give us a good sense of the life system Bitcoin is going for.”

Gilfoyle said, “This is not a bad idea. We look for inspirations from natural design, just like from mantis we invented sickles, from echolocation of the bats we invented radar, and from dragonflies we invented planes.”

With that, they picked up the book and began leafing through it as if the detective were searching for clues at the crime scene.

Through these days of research, Satoshi and Gilfoyle were more...

Continue reading →


Recreating Bitcoin 13:P2P Network

Epilogue

Satoshi found inspirations on Bitcoin from evolutionary processes in nature. Next step would be implementing these inspirations.

The evolution of an organism starts with single-cellular ones to multicellular ones, and then organs emerge, ending with the formation of the brain.

Satoshi started designing the basis of Bitcoin’s existence (the inner circle of the vortex model) — that is, the peer-to-peer accounting network.

The definition of Bitcoin could thus be a peer-to-peer digital cash system.
Of course, Bitcoin’s definition in future could change. It could be a peer-to-peer general computer, a peer-to-peer super-intelligence or the root of the world: METANET.

Anyway, back to where we are: implementation of the accounting network.

Starting with Two Nodes

“The server Bitcoin has right now is one single node,” Satoshi said.

“Like a single-cell organism?” asked...

Continue reading →


Recreating Bitcoin 14:Synchronizing Transactions

Epilogue

In the last chapter, Satoshi and Gilfoyle complete the simplest P2P network but have not achieved the synchronization of the ledger across network. The first step to solve the problem is to synchronize the transactions.

Unsynchronized Ledger

In the café, Satoshi told Bob that Bitcoin would be undergoing an update and the system would not be accessible for use for a few days.

“That sounds like a big update you guys are doing this time. I saw you moving in a new server and cranking code,” Bob said.

“Yes,” Satoshi responded. “Bitcoin now is going through a transformative change right now. By the way, if you have some machines in your place, move them here if you can. The network needs more nodes to join.”

“That’s no problem. I’ve got one at home,” said Bob. “But do I get anything from running a node?”

“As to benefits…” Satoshi hesitated. “Temporarily not anything specific...

Continue reading →


Recreating Bitcoin 15:Synchronizing Ledger

Epilogue

The previous chapter described the synchronization of transactions, but we also need to consider the synchronization of the ledger.

The transaction memory pool represents the present of the system. The account model represented the system’s past.

Three Nodes

At the café, Bob brought over the computer to Satoshi. Satoshi took over the computer in his arms and thanked him.

Now there are three computers on the table. Due to the lack of space on the table, the third machine is stacked on top of the other two. It looks like a pyramid.

Satoshi said to Gilfoyle, “The existing two nodes are already providing the ledger service. Now let’s connect the third node to the network.”

“Yeah, but I feel that there’s going to a high probability that errors will occur. Let’s test it first and see,” said Gilfoyle.

Satoshi set up the IP for Node 3, deployed the code and restarted the...

Continue reading →