当前位置:主页 > 贷款 > 正文

贝尔链BaerChain:What is the decentralization of blockchain ?

来源:未知作者:XH012018-12-29 13:23:30


区块链技术最显著的特征之一便是去中心化,今天的技术分析文我们就来讲讲去中心化究竟是如何做到的,这其中主要涉及到两项技术:“分布式账本”和“加密算法”。

Preface:

One of the most striking features of blockchain technology is decentralization. Today's technical analysis is about how decentralization is done. This involves two technologies: “Distributed Ledgers”and "Encryption Algorithm".

1

分布式账本

(Distributed Ledger)

分布式账本,又称共享账本,是一种跨越地理范围、在多处同步进行相同信息记录的“去中心化数据库系统”。区块链实际上是分布式账本的其中一种应用。

Distributed ledger, also known as shared ledger, is a "decentralized database system" that synchronizes the same information records across multiple geographic locations. The blockchain is actually one of the applications of distributed ledgers.

分布式账本既可以记录网络参与者之间的交易,比如数据或资产的交换,也可以复制共识,将数据共享并同步到多个网站、国家或机构。分布式账本最大的特点就是:没有中心管理员或集中数据存储。网络中的每一个参与者都根据一致性原则来协商和制约账本记录的更新。分布式账本中的每一条记录,都有一个时间戳和唯一的密码签名,这使得账本成为网络中所有交易的可审计历史记录。

为什么需要分布式记账呢?我们举一个例子来理解。

Distributed ledgers can record transactions among network participants, such as the exchange of data or assets, as well as copying consensus, sharing and synchronizing data to multiple websites, countries, or institutions. The biggest feature of distributed ledgers is that there is no central administrator or centralized data storage. Each participant in the network negotiates and restricts the updating of the book records based on the principle of consistency. Each record in the distributed ledger has a time stamp and a unique cryptographic signature, which makes the ledger an auditable history of all transactions in the network.

Why do we need distributed accounting? Here is an example.

在白云村,张三向李四借了1000块钱,他们分别在各自的账本上记下来。这时候,如果张三悄悄跑到李四家,偷了李四的账本,然后反悔。李四空口无凭,恐怕很难把钱要回来。

In Baiyun Village, Zhang San borrowed 1,000 yuan from Li Si, and they wrote down their respective books. However, if Zhang San quietly stole Li Si’s account book and then repented, it would be difficult for Li Si to get the money back.

为了防止这种情况出现,大家想出了一个新的记账规则。每次有人向别人借钱时,都在村里的喇叭里广播,然后每家人都帮忙记录这次借钱记录:张三问李四借,全村人记;小五问小蒙借,全村人记;长贵问谢大脚借,全村人记……这样一来,不管哪两个人有债务往来,都有全村人作证;要是谁要赖账,必须挨家挨户去偷全村每家人的账本,难度太大了。

这就是分布式账本的好处。而传统的银行、支付宝、腾讯云等数据库,黑客攻击的时候只需攻击一个中心化数据库,相对来说不安全。

In order to prevent this from happening, everyone came up with a new accounting rule. Every time someone borrows money from someone else, they broadcast in the village's trumpet, and then every family helps to record the borrowing record: Zhang San borrowed from Li Si, Xiaowu borrowed from Xiaomeng, Xiaowu borrowed from Xiaomeng... the whole village wrote it down. In this way, no matter which two people have debts, all the villagers will testify; if anyone wants to deny the account, they must go door to door to steal every family in the village, which is too difficult.

This is the benefit of distributed ledgers. Traditional banks, such as Alipay, Tencent Cloud and other databases, can be attacked simply by a centralized database, which is relatively insecure.

分布式账本可以用于存储、记录和交易所有类型的资产,潜在的应用领域十分广泛。例如,跨境电子支付是通过代理行模式,实现银行与银行之间的资金转移。一般涉及多重费用,且报文通信处理和结算时间较长,成本则会转嫁给终端用户。分布式账本技术的某些特性,例如跨时空共享账本的能力,可以减少跨境支付中所依赖的中介机构的数量,从而降低成本,并提高成本结构的透明度。

Distributed ledgers can be used to store, record, and trade all types of assets, with a wide range of potential applications. For example, cross-border electronic payments are through proxy lines that enable the transfer of funds between banks and banks. Generally, multiple charges are involved, and the message communication processing and settlement time is long, and the cost is passed on to the end user. Certain features of distributed ledger technology, such as the ability to share books across time and space, can reduce the number of intermediaries that are dependent on cross-border payments, thereby reducing costs and increasing the transparency of the cost structure.

现在流行的P2P下载实际上也是分布式账本的一种应用。也就是说,你下载的内容并不是存储在某一个中心化的云上,而是分别存储在很多个人终端上,你是从很多这种终端上下载的;同时你下载好的内容也在被别人下载。这就解决了拥堵的问题,所以P2P下载的速度很快。

近几年流行的P2P借贷,其实也是分布式账本的一种应用。但由于挂羊头卖狗肉、技术不成熟、缺乏监管、鱼龙混杂等等原因,产生了很多负面新闻,大家需要防范。

The popular P2P download is actually an application of distributed ledger. In other words, the content you download is not stored on a centralized cloud, but stored on many personal terminals. At the same time, the content you are downloading is also being downloaded by others. This solves the problem of congestion, so P2P downloads are fast.

The popular P2P loan in recent years is actually another application of distributed ledgers. However, due to the fact that the technology is not mature, the supervision is lacking, and some other issues, a lot of negative news has occurred, leading people to guarding against it.

分布式账本技术需要和区块链的其他底层技术,比如加密算法、共识机制等结合,才能发挥最大效能的作用。

Distributed ledger technology needs to combine with other underlying technologies of the blockchain, such as encryption algorithms and consensus mechanisms, in order to maximize the effectiveness.

2

加密算法

(Cryptography)

加密算法可以保证数据的隐私、安全及可溯。加密算法可分为对称加密算法和非对称加密算法。区块链技术没有用到对称加密,这里就讲非对称加密。

Encryption algorithms guarantee data privacy, security and traceability. The encryption algorithm can be divided into a symmetric encryption algorithm and an asymmetric encryption algorithm. Blockchain technology does not use symmetric encryption, here is asymmetric encryption.

非对称加密有两个重要的概念:公钥、私钥。公钥和私钥都是一长串无规律的字符串,可以用来加密和解密。在非对称加密算法中,每一个私钥必然对应一个公钥。即,公钥来加密的话,只能用对应的私钥来解密;私钥用来加密的话,只能用公钥来解密。

Asymmetric encryption has two important concepts: public key and private key. Both public and private keys are long strings of irregular strings that can be used for encryption and decryption. In an asymmetric encryption algorithm, each private key necessarily corresponds to a public key. That is, if the public key is encrypted, it can only be decrypted with the corresponding private key; if the private key is used for encryption, it can only be decrypted with the public key.

00000048849nhfiuhwte7ny438v7rnq498ct4c89m4cj2

我们可以通过一个例子来理解。We can understand by an example.

 

如上图:贝勒爷(我们假定故事主人公是贝勒爷)想给女朋友发一条消息:我喜欢你。但是他不想这个情书的内容被人看到。于是,贝勒爷用女朋友发给他的公钥0(公钥是可以发给别人用来加密和解密的)给【我喜欢你】这四个字加密。加密之后,这四个字就变成一串无规律的乱码【乱码0】,别人不知道里面的内容。但是,贝勒爷的女朋友可以用自己与【公钥0】对应的【私钥0】来解密,就能看到里面的内容了。

As shown above: Baylor wants to send a message to his girlfriend: I like you. But he does not want the content of this love letter to be seen. So, Baylor uses the public key 0 sent by his girlfriend (the public key can be sent to others for encryption and decryption) to encrypt the three words [I like you]. After encryption, these words become a series of irregular garbled characters [garbled 0], others do not know the contents. However, Baylor's girlfriend can use the [Private Key 0] corresponding to [Public Key 0] to decrypt it eventually see the contents inside.

但是这里还有一个问题。他女朋友不能百分百肯定,这条信息是贝勒爷发给她的。因为谁都可以发【我喜欢你】这几个字。

But there is still a problem here. His girlfriend can't be 100% sure, this message was sent to her by Baylor. Because anyone can send the words [I like you].

解决方案如下图所示。The solution is shown below.

 

贝勒爷先用女朋友的【公钥B】给【我喜欢你】四个字加密,变成【乱码1】,然后用自己的【私钥A】给【乱码1】加密,就变成【乱码2】,发给他女朋友。他女朋友收到后,就用贝勒爷发给她的【公钥A】解密【乱码2】,得到【乱码1】;然后,他女朋友再用自己的【私钥B】解密【乱码1】,就可以看到【我喜欢你】四个字了。

Baylor firstly uses the girlfriend's [public key B] to encrypt[I like you], which becomes [garbled 1], and then use his own [private key A] to encrypt [garbled 1], which becomes [ Garbled 2], sent to his girlfriend. After his girlfriend receives it, she uses [Public Key A] sent by Baylor to decrypt [garbled 2] and gets [garbled 1], then uses her [Private Key B] to decrypt [garbled 1] , finally she can see the words [I like you].

在上面的过程中,因为他女朋友要用到贝勒爷发给她的【公钥A】,如果解密成功,就表明是贝勒爷用的只有他自己持有的【私钥A】给信息加的密,那么,就能证明这条信息是贝勒爷发给她的。贝勒爷用【私钥A】加密【乱码1】的过程,就是我们常说的“数字签名”。如果他女朋友用贝勒爷发给她的【公钥A】打不开信息,就表明这条信息不是贝勒爷发给她的,她就能断定,是有别人想冒充贝勒爷。同时,双重加密的过程保证了信息不被泄露露。

In the above process, if the decryption is successful, it means that it is Baylor who encrypted the message by his own [Private Key A] and this message was sent to her by Baylor, because his girlfriend had to use [Public Key A] sent by Baylor . Baylor's process of encrypting [garbled code 1] with [Private Key A] is what we often call "digital signature." If his girlfriend can't open the message with [Public Key A] by Baylor, it means that this message was not sent to her by Baylor. She can conclude that someone wants to pretend to be Baylor. At the same time, the process of double encryption ensures that information is not leaked.

以上整个流程就是区块链技术中,对交易信息的加密解密过程。

The whole process above is the encryption and decryption process of transaction information in the blockchain technology.

3

 以上几种技术的结合,就实现了区块链技术的去中心化:分布式账本确保信息不被单方面篡改;共识机制解决记账权的问题,同时保证数据难以被篡改;加密算法既能保证信息的隐私,又能保证信息的安全;智能合约保证约定动作自动执行。

The combination of the above technologies realizes the decentralization of the blockchain technology: the distributed ledger ensures that the information is not unilaterally falsified; the consensus mechanism solves the problem of the accounting rights, and at the same time ensures that the data is difficult to be tampered with; the encryption algorithm guarantees the privacy of the information and ensures the security of the information; the smart contract guarantees that the action is automatically executed.

责任编辑: 杨希


[责任编辑:XH01]