作者:Jerry Qi
翻译&编辑:Olivia
来源:btcwires
Source: btcwires
当我还是一个七年级的学生时,我就已经被加密货币的世界吸引住了。起初,我觉得这简直就是一个免费的货币生成器,只要我让我的笔记本电脑像风火轮一样呼呼地运行Crypto-mining软件,它就会给我免费的加密货币。
When I was a seventh-grade student, I was attracted to the world of encrypted money. At first, I thought it was a free money generator, and as long as I had my laptop running Crypto-mining like a windmill, it would give me free encrypted money.
最后,我的笔记本电脑确实产生了加密货币,然而,只有非常非常少的加密货币。
Finally, my laptop did produce encrypted currency, but only very, very few.
我用我的笔记本电脑做的事情,本质上是 "加密挖矿"。
What I do with my laptop is essentially "encrypted mining."
"挖矿"
"mining"
你可能听说过加密货币比特币,也听说过一个叫 "挖矿 "的名词与这类加密货币有关。
You may have heard of the encrypt currency bitcoin and of a term called " mining " relating to this type of encrypt currency.
加密货币挖矿,简单来说,就是矿工或个人使用设备从事支持区块链网络的 "工作",以获得加密货币奖励的过程。
Encrypted currency mining, in short, is the process by which miners or individuals use equipment to "work" in support of block chain networks in order to obtain an encrypted monetary incentive.
Onenote上的小型P2P网络草图
Draft image of the small P2P network on Onenote
区块链:它是一种网络分布式记录或分布式账本,记录那些人们在网络上的行为。因此,对于加密货币的区块链网络来说,区块链的功能将是记录网络上个人的交易。
Block chain: It is a web-distributed record or distributed account book that records the behaviour of people on the network. Thus, for a block-chain network of encrypted currencies, the block-chain function will be to record the transactions of individuals on the network.
在这篇文章中,我将以比特币为例,解读挖矿背后的意义。
In this article, I will use Bitcoin as an example to read the meaning behind mining.
回到矿工的 "工作 "这个话题。为了让矿工获得比特币的奖励,矿工要做的简单 "工作 "就是对比特币区块链上的交易进行验证。
Back to the subject of " work " for miners. In order for miners to get a bitcoin reward, the simple " job " for miners is to verify transactions in the bitcoin block chain.
在验证时,挖矿者将执行一系列检查,以确保分配的交易是合法的,并且交易参与者不会支付相同数量的加密货币两次。例如,当Joe给Brandon发送了12个比特币,而Brandon试图给Tony发送7个比特币和Max 8个比特币,这将被认为是一笔欺诈交易,因为7+8>12。我刚才给出的情况是 "双花问题 "的一个例子:Brandon试图两次消费同一个比特币。
At the time of validation, diggers will carry out a series of checks to ensure that the assigned transaction is legal and that the participants will not pay the same amount of encrypted currency twice. For example, when Joe sent Brandon 12 bitcoins, Brandon tried to send Tony seven bitcoins and Max eight bitcoins, which would be considered a fraudulent transaction because 7+8>12. I just gave an example of the " double flower problem " : Brandon tried to consume the same bitcoins twice.
在矿工已经验证了0-4兆字节之间的比特币交易(大约1500-3000笔交易),相当于一个区块的近似最大大小。他们已经完成了比较容易的一半工作,以获得比特币奖励。然而,在验证之前的任务是最复杂的,使矿工有资格验证交易。
The miners have verified a bitcoin transaction between 0-4 megabytes (approximately 1,500-3,000 transactions), which is the approximate largest size of a block. They have already completed half of the easier work to get a bitcoin reward. However, the most complex task before certification is to qualify miners to validate the transaction.
挖矿业的运气部分
通过率先解决一个字符串序列的计算,也就是所谓的创建工作证明(Proof of Work)。创建工作证明(Proof of Work)是矿工们最需要计算力的过程。(下面我将在后面的章节中解释为什么叫工作证明(Proof of Work))
By taking the lead in solving the calculation of a string series, the so-called Proof of Work. Creating the Proof of Work is the process in which miners most need to calculate. (I will explain in the next chapter why Proof of Work)
为了理解工作证明(Proof of Work)算法,你必须先熟悉区块链中的 "哈希 "一词。
In order to understand the Proof of Work algorithm, you must first become familiar with the word " Hashi " in the block chain.
网络检测区块链中区块的篡改的方式是通过其哈希值 ; 由区块中的信息定义的数字和字符组成的长字符串。通过把数据通过哈希函数,比如比特币使用的SHA-256使用,就会产生一个针对该特定输入的序列。意思是说,如果输入数据哪怕改变一个字符,输出的哈希值就会完全改变。另外,哈希是一个可加密但不可解密的结果,因此,它不能用来获取原始数据,只能作为验证哈希的输入数据是否相同的一种方式。创建工作证明(Proof of Work)需要矿工运行哈希算法来 "猜测 "问题的合适答案。对于比特币区块链网络来说,矿工必须率先创建一个符合一定要求的哈希值,这个哈希值被称为 "目标哈希"。
The network detects the manipulation of blocks in the block chain by means of their Hashi value; The long string consisting of numbers and characters defined by the information in the block. By using the data through the Hashi function, such as the SHA-256 used in Bitcoin, a sequence is created for that particular input. It means that if the input data changes even a character, the exporting Hashi value will change completely. Moreover, Hashi is an encrypted but undecrable result, so it cannot be used to obtain the original data, but only as a way to verify whether Hashi's input data is the same.
猜测目标哈希的必要信息就存在于新区块的区块头中。包含:区块版本号,时间戳,前一个区块的哈希值,以及目标哈希值。
The necessary information to guess the target Hash is found in the head of the new block. Includes: block version numbers, time stampes, Hash values of the previous block, and target Hash values.
onenote上的猜测过程草图
A sketch of the speculation on onenote.
目标哈希的答案是由前一个区块的哈希值、现区块交易数据,加上0-4,294,967,296的整数(简称nonce),然后放入哈希算法中生成的。
The answer to the target Hash was derived from the Hashi value of the previous block, current block transactions data, plus an integer of 0-4,294,967,296 (nonce) and then placed in the Hashi algorithm.
如果答案符合目标哈希的要求,该区块就会被添加到区块链中。最先验证交易并找出添加到该区块哈希中的那个nonce的矿工,就会得到比特币的奖励。否则,他们就会不断尝试寻找有效的目标值。
If the answer meets the requirements of target Hash, the block is added to the block chain. The first to verify the transaction and find the nonce miner added to the block is rewarded with bitcoin. Otherwise, they keep trying to find a valid target value.
由于哈希算法的随机性,我们需要做大量的随机猜测来确定满足目标哈希的数值。
Because of the randomness of the Hashi algorithm, we need to do a lot of random speculation to determine the number of Hashi that meets the target.
来源:Investopedia
Source: Investopedia
尽管自己想找到nonce已经相当困难,并且在同一个网络上还有≥百万的其他个体与你竞争,使得一个设备获得比特币奖励的几率类似于中彩票的几率。因此,你可以通过提高处理能力或使用多台设备来获得更快的Hash Rate(单位包括:KH/s、MH/s、GH/s等)。
Although it is already difficult for yourself to find nance and there are millions of other individuals on the same network who compete with you, making a device a bitcoin reward similar to a medium lottery. So you can get a faster Hash Rate by improving processing capacity or using multiple devices (KH/s, MH/s, GH/s, etc.).
Hash-rate一词可以解释为一个或一组设备计算数字和验证交易速度有多快的量(是计算能力的衡量标准)。
The term Hash-rate may be interpreted as a measure of the ability of a device or group of equipment to calculate the number and verify the speed of the transaction.
共识机制
Consensus Mechanism
像比特币区块链这样去中心化P2P的网络,没有中心主要人物,只能根据不同的共识机制进行决策。共识机制在交易验证的同时,也奠定了挖矿的目的。
The centralization of the P2P network, like the Bitcoin block chain, without a central figure, can only be decided on the basis of different consensus mechanisms.
来源:维基百科
Source: Wikipedia.
共识机制有很多形式,但它们都是为了同一个目标:"核实并确保记录的真实性和完整性"(来源:Tech in Asia)。目前主要有三种机制:工作证明(Proof of Work)、权益证明和权力证明。在本文中,我将重点介绍共识的工作证明(Proof of Work)方法。
Consensus mechanisms take many forms, but they all serve the same purpose: "Verifying and ensuring the authenticity and integrity of records" (source: Tech in Asia). There are currently three main mechanisms: Proof of Work, Propriority and proof of authority. In this paper, I will focus on Proof of World.
说到挖矿,这总结了工作证明(Proof of Work)模式的工作原理:个人首先要创建一个工作证明(Proof of Work),然后他们验证比特币交易以确保区块链中的记录是真实的。然而,在验证交易之前先让我们深入了解一下工作证明(Proof of Work)的目的。
When it comes to mining, this sums up the working principles of the Proof of Work model: individuals first have to create a Proof of Work, and then they verify the bitcoin transaction to ensure that the record in the block chain is true. But before verifying the transaction, let us look into the purpose of Proof of Work.
工作证明(Proof of Work)的历史和目的
The history and purpose of Proof of Work
这种工作证明(Proof of Work)的想法在1993年就已经出现,由Cynthia Dward和Moni Naor在一篇论文(On Memory-Bound Functions For Fighting Spam)上提出,文中解释了阻止垃圾邮件的不同方法。这篇论文的重点是通过计算能力来发送电子邮件的想法。
The idea of Proof of Work emerged in 1993 and was put forward by Cynthia Dward and Moni Naor in a paper on On Memory-Bound Operations For Fighting Spam, explaining the different ways to stop spam. The paper focused on the idea of sending e-mails through computing power.
例如,如果你想通过电子邮件给我发送一条信息,那么你必须证明你仅仅为了给我发送这条信息就花费了比如说30秒的计算能力。由于现代计算机的速度很快,在这种情况下,垃圾信息/邮件/交易就成了一个大问题。但是,通过给每个操作设置一个 "工价",就可以大大减少垃圾信息。
For example, if you want to send me a message by e-mail, then you have to prove that it takes 30 seconds to simply send me this message. Because of the speed of modern computers, spam/mail/trading is a big problem in this case. But by setting a "work price" for each operation, it can significantly reduce spam information.
在onenote上验证勤劳的门钥匙例子
An example of a hard-working key on onenote.
简而言之,"prover "向 "vercker "证明他们在一定的时间间隔内投入了一定的计算能力。随着时代的发展,比特币的创造者 "中本聪 "修改了让比特币矿工生成数据片段的想法,这是比较困难的部分。而网络上的其他人要验证它是否真的满足目标哈希值就很容易了,因为他们只需要把需要的数据通过SHA-256算法。
In short, "prover" proves to "vercer" that they have invested a certain amount of computing capacity at a certain time. As the times have evolved, "Bone in Bitcoin" modified the idea of allowing bitcoin miners to generate data fragments, which is the more difficult part. Others on the network can easily verify whether it really meets the target Hashi value, because they simply need to pass the data they need through the SHA-256 algorithm.
通过这种工作证明(Proof of Work)系统,就能够保证区块链等系统的安全性并建立一个验证共识,因为真正验证区块的将是一个投入了巨大计算能力的设备。这就给了网络一个保持公平和诚信的经济理由。
Through the Proof of Work system, it is possible to ensure the security of systems such as block chains and to build a consensus for certification, because the true validation of blocks will be a device that invests in great computing capacity. This gives the network an economic justification for maintaining fairness and integrity.
如何做到这一点呢?
How do you do that?
举例来说,如果发生了欺诈交易并被批准,用户就会变得 "犹豫不决"转而使用其他加密货并且降低价格。从经济上来说,矿工,也就是做比特币 "生产 "的人,会因为价格下跌而不开心。而与此同时,只有控制矿工才有足够的计算能力来触发欺诈性验证。所以,矿工们的工作动机就会转向保护交易,以确保币价不跌。
For example, if a fraudulent transaction takes place and is approved, the user becomes " hesitant" to use other encrypted goods and lowers prices. Economically, miners, that is, those who produce bitcoin, are unhappy by falling prices.
工作证明(Proof of Work)机制的劣势
Weakness of the Proof of Work Mechanism
虽然工作证明(Proof of Work)被用于一些最大的加密货币(比特币、以太坊等)上,但这并不意味着其是最高效、最安全的系统。
Although Proof of Work is used in some of the largest encrypted currencies (bitcoin, Etheria, etc.), this does not mean that it is the most efficient and secure system.
来源:BBC
Source: BBC.
消耗功率工作证明(Proof of Work)的过程需要耗费大量工作,因为计算机只是通过粗暴的方式用所有的可能性来猜测正确答案。这一方式浪费大量的电力和资源。从更大的范围来看,想象一下,全世界所有的矿工都在试图 "挖矿 "以获得比特币的奖励同时浪费着资源,如果他们不先猜出nonce甚至对网络没有贡献。
Proof of Work is a process that takes a lot of work, because computers only use all the possibilities to guess the right answer in a rough way. This way wastes a lot of power and resources. On a larger scale, imagine that all miners around the world are trying to " dig " to waste resources while getting a bitcoin reward, if they don't first guess that nance even contributes to the network.
违背了去中心化的理念
runs counter to the idea of decentralizing
由于挖矿需要耗费大量的电费,矿工们建立了中央矿场,控制了大部分的区块验证。这几乎让P2P去中心化的想法变得毫无用处因为这意味着只有控制矿工才会同意攻击网络。电力成本也促使矿商聚集在电力成本较低、利润较高的地方,以便开展挖矿活动。集中决策权。
Because mining costs a lot of electricity, miners have established a central mine, controlling most of the block certification. This makes the idea of centralizing P2P almost useless because it means that only control miners can agree to attack the network. The cost of electricity also encourages miners to concentrate in areas where electricity costs are lower and profits higher, so that mining activities can take place.
工作证明(Proof of Work)的替代方案
Alternative to Proof of Work
如上所述,还有其他共识机制能够取代PoW。例如:Proof of Stake、Proof of Authority和Proof of Capacity。Proof of Stake通过验证者钱包里的货币数量来确定交易验证者。假如你想象一群人买彩票。买彩票最多的人将有更大的中奖机会。
As noted above, there are other consensus mechanisms that can replace the PoW. For example, Proof of Jake, Proof of Authority, and Proof of Capacity. Proof of Stark, using the amount of money in the checker's wallet to determine the amount of money to be traded. If you imagine a group of people buying lottery tickets, those who buy the lottery most will have a bigger chance of winning.
这与股权证明类似,如果你的钱包里有最多的加密货币,你将有最大的机会成为验证者并获得奖励。权限证明通过个人的 "可信度 "来确定交易验证者。
This is similar to the certificate of equity, and if you have the largest amount of encrypted money in your wallet, you will have the greatest opportunity to be a certifier and be rewarded.
想象一下,一群人选择几个最值得信任、信誉最好的人去验证交易的有效性。能力证明通过个人对网络内存空间的贡献来确定验证者。这种机制允许网络上的贡献节点共享内存空间,所以贡献的设备拥有的内存越多,它成为验证者和获得奖励的可能性就越大。上述这些方法所需要的计算量大大减少,在交易的验证中可以更加省电。
Imagine a group of people choosing the most trusted and credible people to verify the validity of a transaction. The ability to prove that a person can identify a certified person by contributing to a network memory space. Such a mechanism allows contribution nodes on the network to share memory space, so the more there is in the equipment contributed, the more likely it is that it will be a certifier and a reward.
总结
- 挖矿行为是验证和生成工作证明(Proof of Work)的过程。
- 生成工作证明(Proof of Work)允许矿工验证交易。
- 生成工作证明(Proof of Work)是一个数字猜测和强迫的过程。
- 工作证明浪费电(Proof of Work wastes electricity),除了工作证明(Proof of Work),还有其他方式,如利害关系证明(Proof of Stake)、能力证明(Proof of Capacity)、权力证明(Proof of Authority)
本文链接:https://www.8btc.com/media/673818
https://www.8btc.com/media/673818
转载请注明文章出处返回搜狐,查看更多
Please note the source of the article
责任编辑:
注册有任何问题请添加 微信:MVIP619 拉你进入群
打开微信扫一扫
添加客服
进入交流群
发表评论