任何事物的发展都有其客观原因,区块链也不例外;简单来说,任何技术的发展都是为解决问题产生的:当前存在什么问题?如何解决该问题?----其实这句话是我硕士生导师天天都要说的,这句话就是研究算法的套路,哈哈!
There are objective reasons for the development of anything, and the chain of blocks is no exception; in short, any technological development is made to solve the problem: what is the problem at hand? How is it solved? - This is what my master's teacher says every day. This is the way to study algorithms.
? ? 现在我们要看看中本聪这个大神为什么要创造比特币?采用什么技术实现了比特币系统?中文版比特币白皮书请见下面链接:
♪ Now let's see why Nakamoto created Bitcoin? What technology has made the bitcoin system possible? The Chinese version of the Bitcoin White Paper can be found in the following link:
? ? 英文版见以下链接:
♪ The English version can be found on the following links:
? Bitcoin: A Peer-to-Peer Electronic Cash System
? 基于信用的模式”(trust based model)交易存在以下问题:
♪ Trust based model (trust based model) transactions have the following problems:
a.?无法实现完全不可逆的交易,因为金融机构总是不可避免地会出面协调争端;
(a) Unable to achieve a completely irreversible transaction, since financial institutions will always be involved in coordinating disputes;
b.?中介的存在,会增加交易的成本,并且限制了实际可行的最小交易规模;
b.? The existence of an intermediary increases the cost of the transaction and limits the minimum scale of the transaction that is practicable;
c. 现在中交易需要建立信任,信任建立机制需要成本。
c. Medium-term transactions now require confidence-building, and confidence-building mechanisms cost.
? ? 如何解决:
♪ How to solve:
“所以,我们非常需要这样一种电子支付系统,它基于密码学原理而不基于信用,使得任何达成一致的双方,能够直接进行支付,从而不需要第三方中介的参与。”
“Therefore, we are in great need of an electronic payment system that, based on cryptography and not on credit /b >, enables any party to an agreement to make payments directly and thus does not require the involvement of third-party intermediaries.”
? ? 个人认为这是区块链技术(支持比特币系统)最有价值的地方:基于信任成本高,基于密码学原理使得建立信任的成本趋近于0。
♪ Individuals see this as the most valuable part of block chain technology (support to the Bitcoin system): confidence-building costs are close to zero based on the high cost of trust, based on the cryptography .
? ? 下面进一步分析中本聪采用哪些技术来设计比特币系统的。
♪ What techniques were used to design the bitcoin system in Benji's further analysis below.
? ? 个人认为这个概念中文版表述得不太准确,英文版原文为:
♪ Personally, the concept is not accurately expressed in Chinese, the English version of which reads as follows:
“We define an electronic coin as a chain of digital signatures. Each owner transfers the coin to the?next by digitally signing a hash of the previous transaction and the public key of the next owner?and adding these to the end of the coin. A payee can verify the signatures to verify the chain of?ownership.”
如上所示,假设Owner1 转账一定数量BTC给Owner2,Owner1把上一笔自己的UTXO和Owner2的public key执行hash,然后用Owner1的private key 进行签名;Owner2可以使用Owner1的public key验证这笔交易是由Owner1发起的,也就是“A payee can verify the signatures to verify the chain of?ownership”。交易验证过程会在后续的文章中详细阐述。
As indicated above, assuming that Owner1 transfers a certain amount of BTC to Owner2, Owner1 performs the hash of its previous UTXO and Owner2 public key and then signs it with the private key of Owner1; Owner2 can verify that the transaction was initiated by Owner1, which is described in a subsequent article.
? ? 同时基于区块链的比特币系统也能解决“双花”问题。设计A同时一笔UTXO转账给B和C,即
♪ A bitcoin system based on block chains also solves the problem of double flower. Design A also transfers a UTXO to B and C, i.e.
? ? TX1: A->B
? ? TX2: A->C
? ? 设计网络中的某个节点先接受都TX1,随后接受到TX2,发现TX2与TX1是同一笔UTXO,节点就会丢弃A->C,从而解决了“双花”问题。
♪ A node in the design network first accepts TX1, then accepts TX2, finds that TX2 and TX1 are the same UTXO, and the node discards A-> C, thus resolving the "double flower" problem.
? ? 在区块链系统中,由于激励机制每个节点都会争夺记录账本的权利,争夺的过程就是挖矿的过程。过程如下:
In the block chain system, because each node of the incentive mechanism competes for the right to record the books, the process is the mining process. The process is as follows:
旷工搜索一个随机数,经过某种运算(如SHA256)使结果满足某种特性,如运算结果的前N位为0。当某个旷工发现这个随机数时将向网络广播,其他节点确认后就获得了记账权,即产生了一个新的区块。
A random number is searched for, and the result is met by some operation (e.g. SHA256) such that the first N position of the result is zero. When a random number is discovered by an absentee, a new block is created by obtaining rights to account when the other nodes are confirmed.
? ? 共识算法的本质是通过算法确认某个节点花费大量算力得出随机数nonce;共识算法应该具有如下特征:
♪ The essence of a consensus algorithm is that a random number of nónce is derived by an algorithm that recognizes that a node costs a lot of money; the consensus algorithm should have the following characteristics:
? ? a. 已知output的特征很难推算出input,只能通过无数穷举才能获得;
♪ a. Known output features are difficult to extrapolate input and can only be acquired through a myriad of resources;
? ? b. 知道input很容易算出output,进而确认output是否符合某些特征。
♪ b. Know that input is easy to calculate output and then confirm if output meets certain characteristics.
? ? POW严重浪费CPU资源,进而推动其他共识算法的产生(如POS,DPOS),以后文章中会详细阐述共识算法。
♪ PoW severely wasted CPU resources, thereby contributing to the generation of other consensus algorithms (e.g. POS, DOS), which will be elaborated in subsequent articles.
? ? 网络部分白皮书讲得简单明了,不再啰嗦,简单列出如下:
♪ The web part of the White Paper is simple enough to be silent and simply list as follows:
运行该网络的步骤如下:
The following steps have been taken to run the network:
? ? a. 新的交易向全网进行广播;
♪ a. New transactions are broadcast on the Internet;
? ? b. 每一个节点都将收到的交易信息纳入一个区块中;
b. The transaction information received at each node is incorporated into a block;
? ? c. 每个节点都尝试在自己的区块中找到一个具有足够难度的工作量证明;
c. Each node tries to find a sufficiently difficult workload certificate in its own block;
? ? d. 当一个节点找到了一个工作量证明,它就向全网进行广播;
d. When a node finds a proof of workload, it broadcasts to the entire network;
? ? e. 当且仅当包含在该区块中的所有交易都是有效的且之前未存在过的,其他节点才认同该区块的有效性;
♪ e. Other nodes recognize the validity of the block only when and only when all transactions included in the block are valid and have not existed before;
? ? f. 其他节点表示他们接受该区块,而表示接受的方法,则是在跟随该区块的末尾,制造新的区块以延长该链条,而将被接受区块的随机散列值视为先于新区快的随机散列值。
♪ f. Other nodes indicate that they accept the block, and the way to do so is by following the end of the block to create a new block to extend the chain and treating the random hash value of the received block as a random hash value faster than that of the new zone.
节点始终都将最长的链条视为正确的链条,并持续工作和延长它。如果有两个节点同时广播不同版本的新区块,那么其他节点在接收到该区块的时间上将存在先后差别。当此情形,他们将在率先收到的区块基础上进行工作,但也会保留另外一个链条,以防后者变成最长的链条。该僵局(tie)的打破要等到下一个工作量证明被发现,而其中的一条链条被证实为是较长的一条,那么在另一条分支链条上工作的节点将转换阵营,开始在较长的链条上工作。
Nodes always see the longest chain as the correct chain and continue to work and extend it. If two nodes broadcast different versions of the new block simultaneously, the other nodes will differ in the time they receive the block. In this case, they will work on the basis of the block they first received, but they will also retain another chain to prevent the latter from becoming the longest chain. The break-up of the impasse (tie) will wait until the next workload proves that it is discovered, and one of the chains is proved to be a longer one, then the nodes working on the other branch chain will shift and start working on the longer chain.
所谓“新的交易要广播”,实际上不需要抵达全部的节点。只要交易信息能够抵达足够多的节点,那么他们将很快被整合进一个区块中。而区块的广播对被丢弃的信息是具有容错能力的。如果一个节点没有收到某特定区块,那么该节点将会发现自己缺失了某个区块,也就可以提出自己下载该区块的请求。
The so-called “new deal is to be broadcast” does not actually need to reach all the nodes. As long as the transaction information reaches a sufficient number of nodes, they will soon be integrated into a block.
? ? 激励机制就是旷工挖矿算出符合规则的随机数,产生新的区块,以获得比特币奖励。
♪ Incentives are that truancy is calculated as a random number in accordance with the rules, creating new blocks in order to get a bitcoin reward.
? ? 个人认为这是比特币系统诸多创新点之一:
Personally, this is one of the many innovations of the Bitcoin system:
? ? a. 可以吸引大量节点功能维护公共账本,提高数据的可靠性;
♪ a. Could attract a large number of nodes to maintain public books and improve the reliability of data;
? ? b. 减少黑客的攻击;因为破坏比特币系统也会伤害自己的利益。
♪ b. Reduce hacker attacks; because destroying the Bitcoin system also harms its own interests.
“如果最近的交易已经被纳入了足够多的区块之中,那么就可以丢弃该交易之前的数据,以回收硬盘空间。为了同时确保不损害区块的随机散列值,交易信息被随机散列时,被构建成一种Merkle树(Merkle tree)[7]?的形态,使得只有根(root)被纳入了区块的随机散列值。通过将该树(tree)的分支拔除(stubbing)的方法,老区块就能被压缩。” ----引用来自于白皮书
“If a recent transaction has been incorporated into a sufficient number of blocks, then the pre-trading data can be discarded in order to recover the hard disk space. To ensure that the random hash value of the block is not compromised, the transaction information is constructed into a random haste ?
? ? 很明显,这种方案极大地减小了节点存储区块链的磁盘空间。
Clearly, this option significantly reduces the disk space of the node-storage block chain.
“在不运行完整网络节点的情况下,也能够对支付进行检验。一个用户需要保留最长的工作量证明链条的区块头的拷贝,它可以不断向网络发起询问,直到它确信自己拥有最长的链条,并能够通过merkle的分支通向它被加上时间戳并纳入区块的那次交易。节点想要自行检验该交易的有效性原本是不可能的,但通过追溯到链条的某个位置,它就能看到某个节点曾经接受过它,并且于其后追加的区块也进一步证明全网曾经接受了它。”
“In the absence of a complete network node, payment can also be tested. A user needs to keep a copy of the longest chain of workload proof blocks, which can be asked continuously to the network until it is convinced that it has the longest chain and is able to move through the Merkel branch to the transaction where it was time-stamped and incorporated. Node wants to check the validity of the transaction itself, but by going back to a point in the chain, it can see that a particular node has accepted it, and the subsequent addition of blocks further demonstrates that the whole network has accepted it.”
? ? ----SPV机制,引用自白皮书
♪ - SPV Mechanism, quoted from White Paper
? 这里有个疑问点“但通过追溯到链条的某个位置,它就能看到某个节点曾经接受过它”,节点如何通过区块链区块header信息追溯到交易的?
? there's a question here: "But by going back to a place in the chain, it can see that a node has accepted it." How does the node go back to the deal through the header information?
? ? 比特币的每个交易可包含多个输入和多个输出(当然也可能是单输入单输出),每个输入可以是小额UTXO,输出最多包含两个:一个是支付,一个是找零。这种价值的分割和组合可以提高交易的效率。
♪ Each transaction in Bitcoin can contain multiple inputs and multiple outputs (and, of course, a single input list output), and each input can be small UTXO, with a maximum of two outputs: one for payment and one for zero. The split and combination of this value can improve the efficiency of the transaction.
a. 白皮书第3部分“Timestamp Server”是什么机制?与区块头中的时间戳有何联系?
What is the mechanism of Part 3 of the White Paper, “Timestamp Server”, and what is the connection to the time stamp in the block?
b. SPV机制中,节点可以只保存最长有效链,如果验证某个交易的有效性,如何确认该交易在区块中的Merkle的分支路径?在本地区块头中搜索?还是在网络其他节点中获得?
b. In the SPV mechanism, nodes can save only the maximum effective chain, and if the validity of a transaction is verified, how can the branch path of the transaction in Merkle in the block be confirmed?
? ? 以上即是个人对比特币白皮书的理解,由于能力有限,如有错误欢迎大家指出! 希望和大家一起进步。
The above is the understanding of the individual White Paper of Bitcoin, which, due to its limited capacity, would welcome you to point out if there is a mistake!
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论