1.1白话讲解区块链
1.1 white words to explain the block chain
现在区块链特别火,可能大家都听说过区块链,听说过比特币,那到底什么是区块链?
Now that the block chain is particularly hot, maybe everyone's heard of the block chain, heard of the bitcoin, what the hell is the block chain?
前几天和一个朋友撸串,我给他安利区块链和比特币以及一些数字货币的知识,这个朋友也是一个技术人,他问了我一句:你说了半天区块链、数字货币,我是做技术的能听懂,但是别人就不一定了,所以除了这些技术名词以外,你能不能通俗地介绍一下什么是区块链。
A few days ago, I gave him the Anly block chain and bitcoin, as well as some knowledge of digital money, a friend who was also a technocrat, and he asked me, "You said half a day block chain, a digital currency, I'm a technologist who can understand it, but not necessarily others, so could you, in addition to these technical terms, describe in general terms what a block chain is.
当时一下就把我问住了,百度搜索出来的一个官方答案是:区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式 。看完这句话之后,相信大部分人还是不能完全理解。
One of the official answers from the 100-degree search was that the block chain was a new application model for computer technology such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, etc.
那么,我用大白话重新解释一下“什么是区块链”。区块链就是人人参与的、不需要中介的、带有奖励机制的一种记账方式。因为人人都有这个账本的备份,每笔账具有连续性,所以不会作假,公开透明。并且不会有一家独大的情况存在,因为需要大家达成共识后才会记这笔帐。
So, let me rephrase the phrase “what is a block chain.” The 举个例子来帮助理解。 Give me an example to help understand. 比如有一个村子,村民老孙找老李借一百块钱,但老李怕他赖账,于是就找来村长做公证,并记下这笔账。这个就叫中心化。但如果你不找村长,直接拿个喇叭在村里大喊“我老李借给老孙一百块钱!请大家记在账本里”,然后大家过来验证过确实有这么回事,于是记到了账本上,就叫去中心化。 For example, in one village, the village's grandson asked Li for a hundred dollars, but he was afraid that he would do so, so he called the mayor a notary and wrote down the account. This was called centralization. If you didn't go to the mayor, you took a horn and shouted in the village, “I lend my old Li 100 dollars to my grandson! Please put it in the ledger”, and then everyone came to check it out, so they took the ledger and called for it to be centralized. 以前村长德高望重,掌握全村的账本,大家都把钱存在他这里,这是过去大家对中心化的信任。现在,大家都担心村长会偷偷挪用大家的钱,怎么办呢?于是大家就给每个人都发了一本账本,任何人之间转账都通过大喇叭发布消息,收到消息后,每个人都在自家的账本上记下这笔交易,这就是去中心化。有了分布式账本,即使老张或老李家的账本丢了也没关系,因为老赵、老马等其他家都有账本。 In the past, the chief of the village had high regard for his books, and everyone had the money in his possession, which was the confidence of the people in centralization. Now, everyone was worried that the mayor would steal the money from everyone. So everyone sent out a copy of the account, and every one of the transfers went through the loudspeaker, and when they got it, everyone took the deal into their own account, which was to go to the centre. With the distribution book, even if the old one or the old Li's family were to lose it, it was okay because other families, such as Zhao and the old horse, had books. 后来,村民觉得每个人都记太麻烦了,可以每天轮流换人来记,谁来干这个活给谁一定的奖励。这样大家都抢着来记于是大家约定,谁摇骰子先摇到6了,就可以来记,但是记帐的格式有要求,后一笔帐的开头必须带上前一笔帐的一个标识,这样防止作假帐,并且记完帐要向大家公布出来,让大家能公开的查账。 Later, the villagers thought it was too difficult for everyone to keep track of each other every day, and who was given a certain reward for doing this job. So we all remembered that it was agreed that anyone who rocked the dice first could do so, but the form of the accounts was required, and the opening of the latter account had to be marked with the previous account, so as to prevent the falsification of accounts, and that the accounts should be made public so that they could be publicly checked. 这个村子自从采用了这种新的记账方式以后,每个人都很开心,不用担心假账、赖账的事情发生,记账还能拿到奖励,于是周围的村子也纷纷效仿这种方式。 Since the introduction of this new method of bookkeeping, everyone in the village has been happy not to worry about false accounts, bad debts and rewards, and the surrounding villages have followed suit. 其实区块链技术没有想象中的那么神秘,它的运行方式和运行原理就像例子中所说的村里的记账方式。我们通过这个例子,可以比较生动地理解区块链本身的运转模式。 In fact, block chain technology is not as mysterious as it might be, and it operates in a way that works and functions like the way the village accounts are recorded in the example. We can use this example to understand more vividly the mode of operation of the block chain itself. 2.2 比特币和区块链的关系
说到区块链就必然会提到比特币,从去年开始,比特币一路飙升,连带其它数字加密货币一起火爆起来,使得数字加密货币市场风头一度盖过股票、外汇、黄金等市场。那么比特币又是什么呢?区块链和比特币之间有什么关系呢?其实比特币就是世界上第一个使用区块链技术的应用。
When it comes to block chains, it is certain that bitcoins will be mentioned. Since last year, bitcoins have soared, along with other digitally encrypted currencies, that digitally encrypted money markets have once overtaken stocks, foreign exchange, gold, etc. What about bitcoins?
2008年的金融危机几乎席卷了整个世界,2008年年底,一个叫中本聪的人发表了一篇论文《比特币:一种点对点的电子现金系统》,他通过这篇论文阐述了一些观点以及对金融危机后的思考。这篇论文主要提出了一个系统设计:
The financial crisis of 2008 was almost all over the world, and at the end of 2008, a man named Nakamoto published a paper , Bitcoin: A Point-to-Point Electronic Cash System , in which he presented ideas and reflections on the aftermath of the financial crisis. The paper focused on the design of a system :
通过随机散列(hashing)对全部交易加上时间戳(timestamps),将它们合并入一个不断延伸的基于随机散列的工作量证明(proof-of-work)的链条作为交易记录,除非重新完成全部的工作量证明,形成的交易记录将不可更改。最长的链条不仅将作为被观察到的事件序列(sequence)的证明,而且被看做是来自CPU计算能力最大的池(pool)。只要大多数的CPU计算能力都没有打算合作起来对全网进行攻击,那么诚实的节点将会生成最长的、超过攻击者的链条。
By combining all transactions with a time stamp (timestamps) through random hashing, they are combined into an extended random hash-based chain of proof (proof-of-work) as a transaction record, which cannot be changed unless the full workload is re-completed. The longest chain will not only be a proof of the observed sequence of events, but will also be seen as the largest pool from CPU computing capacity (pol). As long as most CPU computing capacity is not intended to work together to attack the entire network, the honest nodes will generate the longest chain beyond the attackers.
(也就是说如果想要攻击,必须掌握超过半数以上也就是51%的节点的算力,就是我们常说的51%攻击,要做到是非常难的,攻击的成本远大于攻击带来的收益。)
(In other words, more than half of the nodes, or 51 per cent of the nodes, must be counted if an attack is to be carried out, which is what we often refer to as 51 per cent of the attacks, which are very difficult to achieve and the cost of the attack is far greater than the benefit of the attack.
这个系统本身需要的基础设施非常少。信息尽最大努力在全网传播即可,节点(nodes)可以随时离开和重新加入网络,并将最长的工作量证明链条作为在该节点离线期间发生的交易的证明。
The system itself requires very little infrastructure. The information can be disseminated as much as possible on the Internet, and nodes can leave and re-enter the network at any time, with the longest workload proof chain as proof of transactions that take place during the node's offline.
这个系统有一个非常完善的经营模型来确保系统的正常运转以及不受黑客攻击。
The system has a very good operating model to ensure that it functions properly and is free from hacking.
比特币的数据结构
Bitcoin data structure
从图上来看,一个区块是由区块头和区块体构成的,区块头中有前一个区块头的哈希值和梅克尔根,每个区块头中的梅克尔根关联了区块中众多的交易事务,而每个区块之间又是通过区块头的哈希值也就是它的散列值关联起来的。
From the graph, one block of 可以看出来这是很有意思的数据格式,它将连续不断发生的数据分成了一个个的数据块,在下载同步这些数据的时候可以并行地从各个节点来获得。不管数据先后,到达本地后再根据数据块的标识组装起来就行。另外,这是一种链式的结构,链式结构的最大特点是一环扣一环,很难从中破坏。 As can be seen, this is an interesting data format, which divides successively occurring data into one data block, which can be obtained in parallel when downloading them in sync. Regardless of the sequence of data, when they arrive locally, they can be assembled according to their identification. Moreover, it is a chain structure, the greatest feature of which is a chain structure with a single link, which is difficult to destroy. 简单介绍一下梅克尔树,如上图右下方树形的数据结构。比特币中的梅克尔树称为二叉梅克尔树,它是通过区块中的交易事务哈希值两两结对计算出的新的哈希值。交易事务哈希值两两结对后再进行一段递归循环,直到计算出最后一个根哈希值,这样的一棵树就是梅克尔树。 A brief introduction to the 为什么要用梅克尔树这样的数据结构来存储交易的事务数据呢?因为比特币系统是分布式的网络结构,当一个节点需要同步自己的区块链账本数据时,并没有一个明确的服务器来下载数据,而是通过与其他节点的通信来实现的。在下载区块数据的时候,难免会有某部分数据可能会发生损坏,所以对于一条条的交易事务就可以用梅克尔树这种形式来进行验证。 Why store transactional data with a data structure like the Merkel tree? Because the Bitcoin system is a distributed network structure, when a node needs to synchronize its block chain of account data, there is no clear server to download the data, but it is done by communicating with other nodes. When you download block data, it is inevitable that some part of the data may be damaged, so a line transaction can be validated in the form of a Merkel tree. 后来人们通过研究比特币的白皮书和它的源代码,提炼出一系列背后的思想及技术,并将提炼出来的结果称之为区块链。区块链技术不仅仅能实现数字货币,还能基于这个技术实现各种各样的应用。因此比特币是区块链技术的一种实践方式,区块链是比特币的技术基础,这就是比特币和区块链两者之间的关系。 By studying Bitcoin’s white paper and its source code, people developed a series of ideas and techniques behind it, and the result was described as a block chain. Block chain technology does not only enable digital money, but also enables a variety of applications. Bitcoin is therefore a practical way of doing block chain technology, which is the technical foundation of Bitcoin, which is the relationship between bitcoin and block chain. 现在的比特币是一个家族,包括BTC 、BCC、BTG等,还出现了类似于比特币的各种加密货币。 Now Bitcoin is a family, including BTC, BCC, BTG, etc., and there are various encrypted currencies similar to Bitcoin. 为什么现在有比特现金、比特黄金、莱特币这些币?这要从扩容说起:比特币本身的区块容量限定为1M,随着时间的推移,运行速度越来越慢,因为1M的容量是在是太小了,一个区块只能容纳有限的交易事务,网络中等待确认的交易会排很长的队伍,这时就需要进行扩容。 Why now there are bits of cash, bits of gold, and bitcoin? This begins with : Bitcoin’s own block capacity is limited to 1M, which, over time, is running at a slower rate, because one M’s capacity is too small, a block can accommodate only limited transactions, and transactions in the network that await confirmation are long queues, which require expansion. 所谓的区块链扩容主要是指增加区块容纳交易事务的能力,通常有两种做法:一是增加许可空间的大小,二是缩小交易数据的尺寸。 The so-called block-chain expansion refers primarily to the increased capacity of blocks to accommodate transactional services, usually by increasing the size of the licensed space and by reducing the size of the transaction data. 第一种做法符合一般思维,相当于我们的衣服越来越多,一个衣柜放不下,就多买了几个衣柜;第二种做法的意思是,比如还是之前的例子,衣服越来越多? The first approach is in line with general thinking and is equivalent to the growing number of our clothes, and the fact that one closet does not fit, buys a few more closets; the second approach means, for example, is there an increase in the number of clothes?
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论