If you don’t live in a cave, YOU’ve probably heard of Bitcoin and Blockchain. After all, speculation on bitcoin is also a trend and one of the media’s favorite topics. At the time of writing, the price of bitcoin has been 17,500 yuan/piece today (OMG). Even people who have never thought of cryptocurrencies or understood how they work are talking about bitcoin. So today I will explain in plain English what blockchain really is.
Blockchain: Why do we need this complex thing?
“For every complex question, there is a clear, simple and wrong answer.” – HL Mencken
Unlike other articles on the web, INSTEAD of defining Blockchain, this article will explain what problems Blockchain solves.
Imagine that Joe is your best friend. He’s hanging out with his girlfriend in Bali (leaving you all alone), he’s halfway through the trip, he calls you to show his affection for you, and then he gets to the point — “I Joe wire money.” Even though you are holding a 30-meter broadsword in your hand, you still answer him, “I’ll hit you right away.”
Then you check your account balance to see if you have $10,000, since you’re very rich. Your account balance is zillions of zeros, so you send your pretty secretary to get $10,000 and call Joe. Your trade looks like this:
Note: We’re not talking about computers, just to make things easier.
Then you can call Joe and tell him you’ve sent the money. The next thing he’s gonna do is go to the bank and withdraw your $10,000.
What just happened? You and Joe both trust the bank to manage your money. There is no actual money involved. All that is needed is an entry in the register. Or, more accurately, an entry in the register that neither you nor Joe controls or owns.
That’s the problem with the current system.
To build trust between us, we need to rely on a third party.
For years, we relied on these banks and other third parties to trust each other. “What’s wrong with trusting third parties?” you may ask.
The problem is that there are only so many banks, in fact, too few. If hackers really wanted to attack banks and cause social chaos, all they had to do was corrupt one person, or one organization. There has been a lot of news about money in the bank disappearing.
- What if the registry that records transactions gets burned?
- What if your secretary mistakenly wrote 15,000 instead of 10,000?
- What if your secretary has other agendas?
For years, we’ve been putting all our eggs in one basket and putting them in someone else’s place.
Transfer money without a bank?
Is there a way we can maintain the register ourselves, rather than someone else doing it for us?
Ok, now tell me how Blockchain works.
“It might make sense just to get some Bitcoin in case It catches on. If enough people think the same way, That becomes a self-fulfilling prophecy. “– Satoshi Nakamoto in 2009
At least three
1. Start with an empty folder
2. When a transaction occurs
When the transaction takes place, the 10 people who have agreed in advance will record it in their own folders.
For example, #2 wants to transfer 100 yuan to #9, so #2 also needs to tell the other 8 people, “I’m going to transfer 100 yuan to 9, please write it down on your file, thank you.”
So, the other eight people go back to check if there is enough money in #2’s account balance to transfer to #9. If so, the trade is executed and all of them record the transaction information on their files.
Over time, more of those 10 will need to trade. When each of them made a transaction, they told the other nine, and the transaction information was recorded on each person’s page. At this time, the current page in the folder will be full, so we need to turn over a new page and continue to record new transaction information.
3. Trading continues to grow
As time goes on, everyone in this network will have more demands for transactions. When they want to make a deal, they tell the rest of the group, and the rest of the group hears about it and makes a note on their page.
This step will continue until everyone has exhausted the blank space on the previous page.
At this point, seal the page in a folder, turn to a new page, and start from Step 2.
4. Before turning the page
Each time we turn to a new page, we use the previously agreed key to encapsulate and protect the full page of information (the technical term is “mining”). After encapsulation, no one can modify the previous information. We protect our own records and security.
So the interesting thing is, how do we seal these pages?
Before we learn how to seal a page, we should understand how it works. As a prerequisite, you should be aware of these…
Magic machine
Imagine sending pre-recorded transactions to this machine (the technical term for this is a Hash Function), and it spits out a bunch of characters that no one understands.
Suppose we send the number “4” to this machine, and you see that it translates “dcbea.”
So how does this machine translate “4” into this string? No one knows. More importantly, it is an irreversible process. You type “dcbea” back into the machine, and it doesn’t translate “4” anymore. But every time you type 4, it translates the same string.
Let’s try a different number, ’26’.
This time it prints ’94c8e’! So this string can also contain numbers.
Now let me ask you a question: If I want a character that starts with three zeros, what should I type on the left? Such as ab 000, 00098000 fa.
You already know that this machine cannot deduce what the correct input is for a given output. Then the only choice left to you is… Try all the numbers in the universe. Well, it sounds simple, right? With any luck, after tens of thousands of tries you’ll have the answer…
Knock, knock, knock, knock, knock, knock, knock
It is very difficult to calculate the input of the output. But at the same time, it is always easy to verify if the predicted input produces the desired output. Remember, the machine will spit out the same word every time.
If I were to give you a number, say 72533, and ask you the question, “Will this number, when put into the machine, produce a word starting with three leading zeros?
All you have to do is put the numbers into the machine and see what comes out.
The most important feature of this machine is – “Given an output, it is very difficult to calculate the input, but given the input and output, it is easy to verify whether the input is an output.
So how does this machine seal a page?
We will use this magic machine to create a stamp for our page. We’ll start with fictional situations.
As described earlier, we will also have a raw numeric message, such as “20893”, which you can put in a box. Suppose we get a character compiled to the beginning of “000” on the right. At the same time, there is an encapsulation box on the left side, now you can say, what kind of encapsulation character, to get “000…” ?
You can only try all the character combinations, and with luck, after tens of thousands of times, you finally get the right character, assuming it is “21191”, then we have the conclusion :(encapsulate “21191” + original information “20893” =42084) into the machine will get the qualified character.
In this case, the number 21191 is proof of work 20893. Suppose a page has the number 20893 written on it. To encapsulate the page (no one can change the content anymore), we’ll put a “21191” badge at the top of the page. Once the wrapper number is stamped on the page, the page is wrapped.
If anyone wants to verify that a page has been changed, all they have to do is add the content of the page using a sealed code and feed it to the magic machine. If the machine emits a word with three leading zeros, the description remains the same. If the word that comes out doesn’t meet our requirements, we can discard the page because its content is leaked and serves no purpose.
We will use a similar sealing mechanism to seal all our pages and eventually arrange them in our respective folders.
Finally, seal our page
To encapsulate the page containing the network transaction, we need to find a number that, when appended to the transaction list and sent to the machine, we get a word starting with three leading zeros on the right.
Note: “words that start with three zeros” is just my example of how the Hash Function works. In fact, the real story is more complicated than that.
Once the number has been calculated in the machine, the page will be sealed. If someone tries to change the content of a page, the seal code will allow anyone to verify the integrity of the page.
Going back to the original 10 agreed users on our network, since each of them kept track of everyone’s transactions, they should have used up a page at the same time. At the same time, everyone will start calculating the encapsulation code at the same time, because the recorded information is the same, the resulting encapsulation code should be the same, and when someone computes the encapsulation code first, he will share it with the rest of the network.
If the encapsulation does not apply to a person’s recorded information, such as #7, the person in the network may have recorded the wrong information, or he may have tampered with the source data.
At this point, the person who made the mistake, if he or she continues to deal with the world, can only correct his or her record of errors or cheats by using the universally accepted encapsulation code. Otherwise, he will be removed from the system. When the whole world uses this kind of transaction, the elimination of the system deprives a person of the ability to use money.
The seal code agreed by the majority will become a reliable seal code
Why, you might ask, should anyone waste their time and energy calculating the calculated codes if they are shared with everyone on the network (10 of them)?
That’s a good question. The wisdom of human beings is infinite, so a new reward mechanism has been introduced here — bitcoin. In Blockingchain’s app, users receive rewards every time they contribute, complete tasks such as calculating a package code. Assuming that user #5 is the first to calculate the correct encapsulation code and share it with everyone, he will be rewarded with one Bitcoin, which will not reduce the savings of others in the network.
That’s why bitcoin exists. This is the first currency to be processed on Blockchain, which stands for distributed register. In return, people get bitcoins to keep up their online efforts.
When enough people own Bitcoins, their value will grow, making others want them; Make bitcoin grow further; Make more people want bitcoin; To further increase their value; And so on.
Payback makes everyone want to contribute to the network
When everyone had put the full page in the folder, they pulled out a new blank page and repeated the process.
Treat a single page as a transaction block and the folder as a page chain (block), thus transforming it to Blockchain.
This is how Blockchain works
.
Except for one small thing I haven’t told you.
Imagine that you already have five pages in your folder, all sealed with a seal code. What if I went back to page two and modified a deal to get a little advantage for myself? A sealed code would allow anyone to detect inconsistencies in the transaction, right? What if I continue to compute a new password for the changed transaction and tag the page with that tag?
To prevent someone from going back and changing a page (block) and the seal number, there is a slight twist to the calculation of the seal number.
Protects the modification of the seal code
In fact, the blockchain requires three conditions to calculate the encoding and decoding:
Source Info + Current Page Code + Previous Page Code
With this little trick, we can make sure that each page depends on the previous one. Therefore, if someone changes the history page, they will also change the entire content and all subsequent seal codes.
If you want to cheat, you’ll need to change the encapsulation and decoding of all your past records, and the blockchain will show that you’ve single-handedly calculated a strange branch. And one person will never be as fast as the rest of the network working together. So those very short branches must be a cheating chain.
What if six people start cheating?
One person’s computing speed can’t catch up to nine people’s computing speed, so the question is, what if six people in the network agree to cheat together? It’s called the 51 percent Attack.
If that were to happen, blockchain wouldn’t work. The only weakness of blockchain is that it is built on the assumption that most people in society are honest and trustworthy. After we understand the advantages of a technology, we should also understand its conditions and weaknesses.
So here, all things about Blockchain I have introduced, I believe you must understand here, is not very cool !!!!
via hackernoon.com