上一期,我们用比较简单的例子,告诉大家:区块链就是用一种人人都记账的方式,组成一个互不认识但又相互信任的新体系。链接:上一期 请直白的告诉我,区块链是怎么工作的?
In the last issue, we tell you with a simpler example: the block chain is a new system of mutual trust and mutual trust in a way that everybody keeps accounts with. Link: In the last issue, please tell me how the block chain works.
这一期,我们研究一下,到底是什么方法能鼓励大家一起参与记账,让这个体系能自给自足、稳定运行的。
At this stage, we look at the ways in which we can encourage all of us to participate in the bookkeeping process so that the system can be self-sufficient and operate in a stable manner.
首先我们先认识一个神奇的东西——黑盒
First, let's get to know a magical thing -- the black box.
想象一个神奇的盒子,如果你从往盒子里塞一个的苹果进去,它可能会吐出一个汉堡包。
Imagine a magic box, and if you put an apple in it, it might throw out a hamburger.
小知识: 这个神奇的盒子被称为“哈希方程”,但非专业人士又怎么好理解“哈希”这个词。所以,今天,我们就叫他“黑盒”。
Little knowledge: & nbsp; , a magic box called the Hashi equation, but how unprofessionals understand the word Hashi. So today we call him the Black Box.
黑盒(又叫做 哈希方程)
Black Box.
假设:我们从左边塞了个数字 4 进去,我们会发现,它在右边吐出了下列字串:‘dcbea’。
Assumption: we put a number 4 from the left, and we go in, and we find that it spits out the following string on the right: 'dcbea'.
数字 4 是在怎么转化成这串字符的?没有人知道。而且,这个过程是不可逆的。得到了这串字符 ‘dcbea’,也不可能搞清楚这黑盒从左边塞进去过什么。但是,任何时候,你输入数字4给这个黑盒,它都总是会吐出同样的字符:‘dcbea’。
Number 4 is how to translate into this string? No one knows. And this process is irreversible. It's not possible to figure out what the black box has been plugged into from the left. But, at any time, you enter the number 4 into the black box, and it's always spitting out the same character: 'dcbea'.
hash(4)=dcbea
来试试发送一个别的数字进去,比如:26怎么样?
Let's try sending a different number in, for example: 26?
hash(26)=94c8e
这次我们得到了 ‘94c8e’,看来字符同样可以包含数字。有意思吧!
We got '94c8e' this time, and it looks like the characters can also contain numbers. Interesting!
假如我现在问你如下问题:
What if I ask you the following question now:
“你能不能告诉我,要想在黑盒右边得到以三个0开头的一串字符(比如000ab),我该从左边放什么东西进去呢?”
"Can you tell me, in order to get a string of three zeros on the right side of the box (e.g., 000ab), what should I put in the left side?"
这个黑盒有个属性:我们无法从右边的结果,直接猜出来从左边放了什么进去。那我们应该怎么回答前面那个问题?
This black box has a property: we can't figure out what's in the left from the right. So how do we answer that question?
看一段岳云鹏的相声视频:
Look at a video of the euphoria:
是的,最直接的方法,就是一个数字一个数字的放进黑盒去尝试,直到我们得到我们想要的结果。
Yes, the most direct way is to put a number in the black box and try it until we get what we want.
经过几千上万次尝试之后,最终会得到符合要求的输入值72533。
After tens of thousands of attempts, the required input value of 72533 was eventually obtained.
结论:靠给定的输出结果来猜测输入值是极其困难的,但给定输入值来推测输出结果又是非常容易的,只要把东西放入黑盒就能立马得出相应的输出结果,并且放入同一个数字,黑盒都会吐出同一的结果。
Conclusion: It is extremely difficult to guess the input values from the given output, but it is very easy to extrapolate the output from the given input, so that the output results can be produced immediately by placing things in the black box and in the same number, and the black box spits out the same result.
如果我给你一个数字72533,然后问你:“这个数字,输入这个黑盒之后,是否会产生一个以三个 0 开头的字符串结果?”要得出答案难不难?是的,一点都不难。要做的就是把这个数字放进去,然后查看在右边能得到什么,就这么简单。
If I give you a number 72533, then I ask you, "Does this number, when you enter this black box, produce a string result that starts with three zeros?" It's not hard to come up with an answer? Yes, it's not hard. All you have to do is put it in and see what you can get on the right, that's all.
所以黑盒最重要的属性就是——给定一个输出值,要算出输入值是极端困难的。但是,给定输入值和输出值,要检验该输入是否会得到该输出,却是非常容易的。
So the most important attribute of the black box is that it is extremely difficult to give an output value to calculate the input value. But it is very easy to check whether the input will get the output.
接下来,我们将使用这台魔法黑盒为记账的文件夹产生一把密码锁。
Next, we'll use this magic black box to create a password lock for the folders on the books.
想象一个场景:我给你一个数字20893。然后我问你:“你能不能找出一个数字,加上装在第一个数字20893以后,一起放进黑盒,最终会给我们一个以三个 0 开头的字符?”
Imagine a scene: I give you a number 20893. Then I ask you, "Can you find a number and put it in the black box after the first number 20893, and eventually give us a character that starts with three zeros?"
这跟我们在之前看到的很相似,而我们已经知道,算出这样一个数字的唯一方法就是穷举每一个可能的数字。
This is very similar to what we have seen before, and we already know that the only way to calculate such a number is to enumerate every possible number.
又通过N多次尝试之后,我们会偶然发现一个数字,比如21191,加上20893以后(比如:21191 20893=42084)输入黑盒,将产生一串符合我们要求的字符。
After several attempts at N, we occasionally find a number, such as 21191, plus a black box after 20893 (e.g. 21191, 20893 = 42084), which produces a set of characters that meet our requirements.
在这个例子中,数字 21191 就成了数字 20893 的密码锁。假设现在有一张纸,数字 20893 写在上面。为了封印这页纸(比如:使得没有人能更改这页纸上的内容),我们将锁一个带有标签 ‘21191’ 的密码锁锁在上面,一旦密码锁数字(比如:21191)被锁在纸上,这页纸就被封印了。
In this example, the number 21191 becomes the password lock of the number 20893. Assuming that there is now a piece of paper, the number 20893 is written on it. In order to seal the page (for example, so that no one can change the contents of the page), we lock a password lock with the label `21191'on it, and once the number of the password lock (for example: 2191) is locked on the paper, the page is sealed.
小知识:密码锁数字又被称为“工作量证明”,意思是,这一数字证明了为了计算出它来已经付出的努力。简单来说,这也就是我们平时经常听说的“挖矿”的原理之一。
Little knowledge: password lock numbers are also referred to as “ workload proofs”, meaning that they demonstrate the effort that has been made to calculate it. In short, this is one of the principles of “mining” that we often hear.
其实,在比特币等靠工作量证明来实现“挖矿”的区块链项目中,每个矿机就是扮演着一个人,他拿着纸和笔,在给定某个结果(比如上文中的00078)的前提下,去尝试到底放进去哪个数字到黑盒能得到00078这个结果。谁先算出21191这个正确答案,谁就是获胜者,谁就可以拿到这个密码锁去封印这个文件夹的权利,并获得一定的奖励。
In fact, in projects such as Bitcoin, which rely on workload proof to achieve the “mining” chain, each miner plays the role of a person who, with paper and a pen, tries to put a number into a black box to achieve the result of 00078, subject to a given result (i.e. 00078 above). Whoever calculates the correct answer first, who is the winner, will be given the right to lock the folder and receive a certain reward.
并且,如果任何人想验证这页纸是否已经被替换了,他需要做的不过是将这页纸上的内容,与密码锁数字加在一起并输入那个黑盒;如果黑盒给出了一串三个 0 开头的字符,那么内容就没有被改变。如果出现的字符不能满足我们的要求,我们就可以丢掉这页纸了,因为它的内容已经有了水分,没有任何用处了。
And, if anyone wants to verify that the page has been replaced, all he has to do is add the contents to the password lock and enter the black box; if the black box gives a set of three 0-start characters, the content is not changed. If the characters appear that do not meet our requirements, we can drop the page because its contents are already hydrated and useless.
原文: WTF is The Blockchain
Original text: & nbsp; WTF is The Blockchain
作者: Mohit Mamoria
Author: & nbsp; Mohit Mamoria
http://www.btb8.com/rookie/1907/60853.html
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论