区块链入门

Introduction to Blockchains

Collections - - CONTENTS -

一、什么是区块链?

区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。所谓共识机制是区块链系统中实现不同节点之间建立信任、获取权益的数学算法。

简单地说,区块链就是一种分布式账本。在该账本中,交易数据被组织成一个一个的“区块”,然后按照区块的生成时序串联成一个链状结构,所以也就被人称为“区块链”。

I. What is a Blockchain?

A blockchain is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism and encryption algorithm. The so- called consensus mechanism is a mathematical algorithm to establish trust and gain stakes among different nodes in a blockchain system. Simply speaking, a blockchain is a kind of distributed ledger. In this ledger, transaction data is organized into "blocks" one by one and then concatenated into a chain structure according to the generation sequence of blocks, so it is also called a "blockchain".

传统记账方式

账本由一页一页的账单组成,每页账单中都记录了一条或多条交易信息。账本只有一份,由专人保管。

区块链的记账方式

对应于传统记账方式中的账单页,在区块链中我们将之称作“区块”。多个区块按照其生成顺序链接起来,就形成了我们常说的“区块链”。

和传统账本不同的是,区块链的账本被分布式存储在区块链网络中的所有节点中。 Traditional Bookkeeping Method The ledger consists of bills page by page with one or more pieces of transaction information recorded in each bill page. There is only one copy of the ledger, which will be kept by a special person. Bookkeeping Method of Blockchains Corresponding to the bill page in the traditional bookkeeping method, we call it a "block" in the blockchain. Multiple blocks are linked according to the generation sequence, forming what we often call a "blockchain". Unlike traditional ledgers, the blockchain ledgers are distributed among all nodes in the blockchain network.

II. Common Blockchain Terms

1. Digital Wallet "Digital Wallet" is essentially a container for managing user keys (including public and private keys). When users conduct on-chain transactions with others, they need to sign the transaction with their private key to prove the legitimacy of the transaction. In addition, the wallet address generated according to the public key is the entry for the user to accept other people's transaction information. 2. Mining The essence of "mining" is that when users maintain the blockchain system, they compete for the bookkeeping right of the ledger by some algorithm (i.e. packing the existing transaction data to generate a new blockchain to be added to the chain), and get a reward given by the system to the bookkeeper (the reward is usually based on the digital currency of the blockchain system). 3. POW/POS/DPOS/..... These are so-called consensus algorithms that are used to ensure data consistency among nodes maintained by multiple users. POW: Proof of work, the core idea of which is to calculate violently a random value (Who has stronger computing power and who speaks); POS: Proof of stake, the core idea of which is "who owns more shares and who speaks"; DPOS: Delegated proof of stake, the core idea of which is "who gets the most support and who speaks". 4. 51% Attack 51% attack is an act which means that when someone has mastered more than 50% of the computing power in the whole blockchain network, he can use the computing power to recalculate and package the identified blocks, making forks to be generated in the blockchain, so as to benefit from the middle. In July, 2014, Ghash, the largest Bitcoin mine at that time, had more than 51% of the computing power of the whole network. Fortunately, Ghash did not abuse its computing power to attack the Bitcoin network, and it soon released some of its computing power at the request of the Bitcoin community, lowering itself below the safety line. 5. Smart Contracts A smart contract is a piece of code running on a blockchain. Since the data (program code is also a kind of data) written into the blockchain cannot be tampered with, we can treat this piece of code as a contract. This code can be called to produce the agreed output behavior on the premise of meeting the appropriate requirements.

二、常见的区块链术语 1.数字钱包

“数字钱包”本质上是一个管理用户密钥(包含公钥和私钥)的容器。用户在和他人进行链上交易时,需要用自己的私钥对交易进行签名,从而证明该交易的合法性。另外,根据公钥生成的钱包地址是用户用来接受他人交易信息的入口。

2.挖矿

“挖矿”的本质是用户在维护区块链系统时,通过某种算法来争夺账本的记账权(即将已有的交易数据打包生成新的区块链加入链中),并且获得系统给予记账人的奖励(奖励通常都是依托于区块链系统的数字货币)。

3.POW/POS/DPOS/……

这些都是所谓的共识算法,它们被用于确保在多个用户维护的节点之间数据的一致性。

Pow:工作量证明(proof of work),核心思想就是暴力计算一个随机值(谁算力强谁说话);

Pos:权益证明(proof of stake),核心思想是“谁股份多谁说话”;

Dpos:委托权益证明(delegated proof of stake),核心思想是“谁获得的支持最多谁说话”。

4.51%攻击

51%攻击是指当有人掌握了整个区块链网络中50%以上算力,他就可以利用这些算力来重新计算打包已经确认过的区块,使得区块链产生分叉,从而在中间获益的一种行为。

2014年7月,当时最大的比特币矿池Ghash的算力超过了全网的51%,幸运的是Ghash并没有滥用自己的算力对比特币网络进行攻击,而且很快就在比特币社区的要求下释放了部分算力,把自己降到了安全线之下。

5.智能合约

智能合约是运行在区块链上的一段代码,由于写入到区块链中的数据(程序代码也是一种数据)不可被篡改,所以我们就可以把这段代码视为一个合约,在满足适当的前提下可以调用该代码产生约定好的输出行为。

三、区块链的特性 1.去中心化/多中心化

即在决定将交易数据写入由区块链技术所维护的分布式账本时,并不会存在一个中心化的仲裁者或记账人,来确定该由谁(某个节点)来把数据写入链中。所有的数据或交易信息都将被分布式存在整个链上。

2.记录不可逆

交易记录数据一旦被写入到区块链中,那么该记录永远不能被撤销或者销毁。这样做的原因是为了阻止“双花”即双重花费(Double spending)的出现。

记录在被写入区块链中,实际上不是立即生效的,必须等待一定数目的后续区块确定后才能被视为成功写入区块链中。 一种特殊的“销毁”方式:在记录被确认“生效”之前,用一个更长的分支来“覆盖”它。但此时,交易记录还是存在于区块链中,只不过被标注为“无效”而已。

3.不可篡改

所有交易数据在被写入区块链之后,就不能被后续的操作所篡改。或者换句话说,即便在后续有人对数据进行了篡改,也很容易被其他人识别出来。这就保证了区块链技术的真实可信。 也就是因为“不可篡改”这个特性,才不能将区块链定义为“一种分布式数据库”。 “不可篡改”这个特性是基于某类数学算法以及共识算法共同协作来保证的。 但是这个特性在理论上不是完全无懈可击的,传说中的“51%攻击”就可能破坏该特性。

4.去信任化

在传统交易场景中,交易双方在进行交易前,必须建立起某种直接或间接的信任关系,否则交易很难进行。

在区块链系统中,由于系统的运作及数据都是公开透明的,相互间不信任的节点可以基于这种公开透明性形成交易的信任基础,从而进行交易。 这种所谓的“去信任化”,其实就是把信任关系构建于区块链系统之上。

III. Characteristics of Blockchains

1. Deconcentration/multicentrization That is, when deciding to write transaction data into a distributed ledger maintained by blockchain technology, there will not be a centralized arbitrator or bookkeeper to determine who (a node) should write data into the chain. All data or transaction information will be distributed throughout the chain. 2. Record Irreversibility Once the transaction record data is written into the blockchain, the record can never be revoked or destroyed. The reason for this is to prevent "double spending". A record to be written into the blockchain is actually not immediately effective and must wait for a certain number of subsequent blocks to be determined before it can be considered to be successfully written into the blockchain. A special "destruction" method: use a longer branch to "overwrite" the record before it is confirmed to be "effective". However, at this time, the transaction record still exists in the blockchain, only marked as "invalid". 3. Non-tampering After all transaction data is written into the blockchain, it cannot be tampered with by subsequent operations. Or in other words, even if someone tampers with the data later, it can be easily identified by others. This ensures the authenticity and credibility of the blockchain technology. That is, because of the "non-tampering" characteristic, the blockchain cannot be defined as "a distributed database". The characteristic of "non - tampering" is guaranteed based on the cooperation of some kind of mathematical algorithm and consensus algorithm. But this characteristic is not completely impeccable in theory, and the legendary "51% attack" may destroy it. 4. De-trust In the traditional transaction scenario, both parties must establish some direct or indirect trust relationship before the transaction, otherwise it is difficult to conduct the transaction. In a blockchain system, because the operation and data of the system are open and transparent, nodes that do not trust each other can form a trust basis for transactions based on such openness and transparency, so as to conduct transactions. This so- called "de-trust" is actually building trust relationships on the blockchain system.

四、区块链的分类

根据参与者的不同,区块链可以被分为以下三类:

1.公有链

顾名思义,公有链是任何人都可以参与使用和维护的区块链系统。在公有链系统中,信息是完全公开的。

一般常见的区块链系统基本上都是公有链系统,如比特币、以太坊等。

2.私有链

和公有链不同的是,用户在使用和维护私有链系统时,需要预先获取到相应的访问控制权。私有链的拥有者可以对链中行为进行控制。

现在并没有被广为人知的私有链系统,主要还是金融机构对此类系统有着浓厚的兴趣。

3.联盟链

联盟链是介于公有链和私有链之间的一种区块链系统。联盟链针对特定的组织团队开放。

常见的联盟链系统有:超级账本。

IV. Types of Blockchains

Depending on the participants, blockchains can be divided into the following three types: 1. Public Blockchains As the name implies, a public blockchain is a blockchain system that anyone can participate in using and maintaining. In a public blockchain system, information is completely public. The common blockchain systems are basically public blockchain systems, such as Bitcoin, Ethereum, etc. 2. Private Blockchains Unlike the public chain, users need to obtain access control in advance when using and maintaining the private chain system. The owner of a private blockchain can control the behaviors in the chain. At present, there is no well-known private blockchain system, mainly financial institutions have a strong interest in such systems. 3. Consortium Blockchains A consortium blockchain is a blockchain system between the public blockchain and the private blockchain. Consortium blockchains are open to specific organizational teams. Common consortium blockchain systems are: Hyperledgers.

V. Possible Application Scenarios of Blockchains

In order to find a suitable blockchain application scenario, we must analyze it from the characteristics of the blockchain technology itself. Without introducing a third-party intermediary or arbitration organization (de-trust), a blockchain can provide such characteristics as decentralization, non-tampering, security a nd r eliability. T herefore, a ll a ctivities t hat d irectly o r i ndirectly d epend on third-party guarantee agencies can theoretically benefit from the blockchain technology. At the same time, the blockchain itself maintains a data record that continues to grow in chronological order and cannot be tampered with. When assets in the real or digital world can generate digital digests, the blockchain becomes the perfect carrier for the application of ownership confirmation, providing digital evidence including ownership and timestamps. Programmable smart contracts enable assets registered on the blockchain to obtain liquidity that is difficult to be provided in the real world, and ensure the transparency and non-tampering of contract rules. This provides the soil for the birth of more innovative economic activities in the blockchain, and provides a more efficient and safe flow channel for the value of social resources. 1. Financial Services The potential advantages of blockchains include reducing transaction costs and decreasing cross- organizational transaction risks. The blockchain application in this field is currently the most concerned, and many banks and financial transaction institutions around the world are the driving force. Some investment institutions are also applying the blockchain technology to reduce management costs and control risks. On the other hand, attention should be paid to possible problems and risks. For example, DAO (Decentralized Autonomous Organization was the largest crowdfunding event in history, and the management and release of funds was ensured based on the blockchain technology), such a crowdfunding experiment, reminds the applicator to handle it with caution at both the business and operational levels. 2. Traceability and Authentic Right The traceability management has a strong attraction in luxury goods, art and other industries. At present, the main technical problems in this field lie in the lack of reliable mapping between off-chain entities and on-chain digital digests, as well as the processing of transaction de-linking and the determination of source publishers. Authentic right management is of great help in combating infringement. By recording the ownership information on the blockchain, we can easily confirm whether the user has the ownership of a certain kind of stake and the effective time of the stake. At present, the technical problems in this field lie in the lack of reliable platform support and effective data integration management.

要找到合适的区块链应用场景,得从区块链技术本身的特性出发进行分析。

在不引入第三方中介或仲裁机构的前提下(去信任化),区块链可以提供诸如:去中心化、不可篡改、安全可靠等特性保证。因此,所有直接或者间接依赖于第三方担保机构的活动,理论上都可以从区块链技术中获益。

同时,区块链自身维护着一个按时间顺序持续增长、不可篡改的数据记录,当现实或数字世界中的资产可以生成数字摘要时,区块链便成为确权类应用的完美载体,提供包含所属权和时间戳的数字证据。

可编程的智能合约使得在区块链上登记的资产可以获得在现实世界中难以提供的流动性,并能够保证合约规则的透明和不可篡改。这就为区块链上诞生更多创新的经济活动提供了土壤,为社会资源价值提供更加高效且安全的流动渠道。

1.金融服务

区块链带来的潜在优势包括降低交易成本、减少跨组织交易风险等。该领域的区块链应用目前最受关注,全球不少银行和金融交易机构都是助力推动者。部分投资机构也在应用区块链技术降低管理成本和管控风险。从另一方面看,要注意可能引发的问题和风险。例如DAO (Decentralized Autonomous Organization是史上最大的一次众筹活动,基于区块链技术确保资金的管理和投放)这样的众筹实验,提醒应用者在业务和运营层面都要谨慎处理。

2.溯源及确权

溯源管理在奢侈品、艺术等行业有着极强的吸引力。目前该领域的主要技术问题在于缺乏可靠的链下实体到链上数字摘要之间的映射,以及交易的脱链环节处理,还有就是源头发布者的确定。

确权管理则对于打击侵权行为有着很大的帮助。通过记录在区块链上的权属信息,我们可以很容易地确认用户是否拥有对于某类权益的所有权,以及权益的有效时间等。目前该领域的技术问题在于缺乏可靠的平台支持以及有效的数据整合管理等。

挖矿

传统记账方式

区块链记账方式

Newspapers in Chinese (Simplified)

Newspapers from China

© PressReader. All rights reserved.