Recreating Bitcoin 1:Start over with a Simple Web Transaction System

Prologue #

1-1.png

For great creation, recreating is worship.

Welcome to the world of Bitcoin !!!

WHAT is the book really about?
Position, concept position, concept position of Bitcoin.

WHY position?
Because the position is clear, understanding the natural occurrence.

HOW to position?
Find the WHY of the problem, give the solution, lead to the next problem, give the solution, and so on.

Vortex model
Inner ring: Problem/solution loop
Outer ring: Conceptual systems emerge naturally

Origin #

How many complex must a man understand, before he can create a simple

1999, Midway, café.

Satoshi Nakamoto appeared in the seat by the window, just like he always did.

Satoshi liked this seat, not because of the view outside, but because of the power socket.

o-CAFE-facebook.jpg

coding at cafe

Satoshi was a programmer. Recently he had been on vacation, coming here every day to write code. For him, the perfect day is just like this.

At that time, the world of Internet was at the beginning of its new life, with many things unnamed and much finger-pointing needed when describing something.

Satoshi was staring blankly with a coffee in his hand, when the cafe’s owner Bob asked, “Hi Satoshi! Haven’t seen you going about coding these couple of days. What are you thinking?”

“I’ve been wanting to do something new recently. My past work had been too normal. Right now, I’m on vacation. I have plenty of time, so I want to do something… something big!” said Satoshi.

“Something big! Ha! If you ask me, I’d tell you the biggest problem there is right now is Federal Reserve’s printing money all over the place,” interjected Alice, a regular at the cafe. “These selfish bastards are causing me to passively lose money every year. Getting these robbers and thieves is something big!”

“That sounds pretty anarchist to me! Not good. But it does give me the inspiration of creating a global digital cash system, with absolutely no extra increase in issue!” said Satoshi.

“Currency originates from value: no matter whether it was shells, gold, or any other thing that served as a currency in history. The first thing to becoming a currency was to have utility value. Then after a long period of public consensus, it will become a currency. The value of such system lies precisely in serving as an immutable ledger for people to use.” of course, this is a cognition that Satoshi only had after a long time.

“If you can make that happen, I will have my cafe be your first tester!” owner Bob shouted across the room.

“Good luck young man!” Alice waved his fist.

A warm current of emotion rose in Satoshi’s heart. He took out his notebook and started drawing. Bitcoin’s design just got started.

Starting with the Simplest Transaction System #

I’ll start with the simplest version and let Bob start using it. Then I will improve it as it goes. This should be a good idea!

And since it’s digital cash, we can call it ‘Bitcoin’.

The first version was made into a single-server web system. Satoshi bought a computer (the server), placed it in the cafe, connected it online, and bought a domain: www.bitcoin.org (note: at the end of the story, we will witness the domain being stolen by a scoundrel. Satoshi will have to use a new domain: www.bitcoinsv.com). Customers at the cafe could now use it through a browser! (see graph below)

图片 1.png

The Overall Design of Bitcoin

Although I’m creating a digital cash system, its essence is a transaction system. Transactions are the core of a market. Cash is only a number in the passing of transactions.

If based on the conventional approach of system design, a system can be separated into the program part and the data part

The key function of the program is to execute transactions.

The key function of the data is to store transactions.

For simplicity, regular files will be used for storage (see graph below).

图片 1.png

The Overall Design of Bitcoin

How to design the data part?

At least two files are needed:

1.user.txt, including username, password, and balance.

2.transaction.txt, including time, payer, payee, amount.
(see graph below)

图片 1.png

This type of design that requires independent storage of account information is what’s called “account model.”

What functions do the program part require?

If based on the conventional approach, we first need registering the user. But since users are all regulars at the cafe, we’ll do away with this step. I will manually register the account for anyone who wants to use Bitcoin, by adding a piece of information in the user.txt file.

I really want the cafe to start using it as soon as possible. Right, I must do it before Bob changes his mind.

And it must have the user registration function. Otherwise, someone named Carol could disguise as Alice to send payment to himself.

As for executing transactions, it only needs writing in the transaction and searching for the transaction. (see graph below)

图片 1.png

Designing the program part

Here it gets a bit tricky: every time Alice sends a payment to Bob, the program needs to find the balance of Alice in user.txt to make sure there’s sufficient balance.

If there is sufficient balance, it first needs to write the transaction information in the transaction.txt and then change the balances of Alice and Bob in user.txt.

Balance is of utmost importance in the construction of an account: it is the wealth someone has accumulated in their lifetime. It must be dealt very carefully.

A person’s wealth in the world all depends on this little number, oh! Poor little creature!

Satoshi spent an afternoon finishing up the first design of Bitcoin. He stretched out his arms and legs, turned to owner Bob and said, “It’s done! I’ll start coding tomorrow and you can start testing it this week!”

“This fast! You are heck of a genius!” Bob said, standing behind the coffee machine and fiddling with a drink in a cup. “Come, have a cup of my new coffee. This one is on me!”

“This is just a simple version, far from what I imagine ultimately,” Satoshi took the coffee and had a sip.

“Umm… what a nice feeling!”

Epilogue #

The method of writing this book is to create a reason for Satoshi to come up with a solution.

This reason might be a bug, or an abstract concept.

Anyway, there would be no solution without a reason.

Even if the reason totally originated from my imagination, it’d still create a context.

Next chapter :Recreating Bitcoin 2:First Version is Online!

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

 
3
Kudos
 
3
Kudos

Now read this

重新创造比特币

作者:何岩,由 recreating.org发行。 “I’m extremely happy to see people finally trying to understand bitcoin and thinking for themselves. Bitcoin SV is my original bitcoin protocol with a lot of the code bugs fixed. I enjoyed reading the story and... Continue →