区块链原理汇总

资讯 2024-07-12 阅读:28 评论:0
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

参考资料:https://www.jb51.net/blockchain/801891.html

References: https://www.jb51.net/blockchain/801891.html

1、前言

1, foreword

这几天在学习区块链相关知识,这里做下归纳和记录。

These days, the knowledge associated with the learning block chain is summarized and documented here.

2、什么是区块链

2 and what is a block chain

区块链的基本功能是记账,特点是不可篡改。所以其创建初衷就是搞一个不能篡改的记账本,所以区块链可以分拆成2部分,即区块和链。

The basic function of the block chain is bookkeeping, characterized by immutable features. So it was created to create a book of accounts that cannot be tampered with, so that the block chain can be broken into two parts, namely blocks and chains.

2.1 区块

2.1 Blocks

区块可以认为是电子记账薄中的一页,如下图所示是经典的一个区块,记录了2笔交易。

Blocks may be considered to be a page in the electronic book of accounts, as shown in the figure below, which is a classic block with two transactions recorded.

 

第一笔,Damian转出100BTC,George转入100BTC

First, Damian transferred 100 BTC and George transferred 100 BTC.

第二笔,Bernard转出200BTC,Gerald转入200BTC

Second, Bernard transferred 200 BTC, Gerald transferred 200 BTC.

这2笔交易的全部字符可以看做一个长字符串,将这个长字符串做哈希计算,假设得到的值是“X32”(实际情况会很长,这里是示意),这样我们就得到了这2笔交易记录的唯一“签名”。假设现在有人要修改这笔交易记录,必然会导致签名的变化,所以只要我记住了签名就能够知道交易记录是否被篡改,但我一个个签名去记录也很费事所以又引入了“链”。

All the characters of these two transactions can be seen as a long string, calculating the long string as a Hashi, assuming that the value is “X32” (which will be a long time, and this is an indication), so that we get the only “signature” of the two transaction records. Assuming that someone now wants to change the transaction record, it will inevitably lead to a change in the signature, so as long as I remember the signature, I can know whether the transaction record has been tampered with, but it is also very expensive for one of my signatures to record, so the chain has been introduced.

2.2 链

2.2 chains

假设我们在新的区块中又记录了2笔交易,在记账时我们将上一个区块的签名一起记录,由哈希运算的特点我们知道,若区块1中的任意字符被修改,则会得到一个非“X32”的新签名值,而原区块1的签名值我们是记录在区块2中的,这样我们就非常容易发现区块1的值是否被修改过。

Assuming that we recorded two more transactions in the new block, we recorded the signatures of the previous block together at the time of the bookkeeping, and that the characteristics of the Hashi operation were known that if any characters in block 1 were modified, a new signature value, not “X32”, would be obtained, while the original block 1 had been recorded in block 2, so that it would be very easy to find out whether the value of block 1 had been modified.

 

 

在计算区块2的签名时,我们以“交易记录+上一个区块签名”作为字符串做哈希运算可以得到一个新的签名值,假设是“9BZ”,同时将这个签名记录到下一个区块中。

In calculating the signature of block 2, we use the “transaction record plus the signature of the previous block” as a string to get a new signature, assuming a “9BZ” and recording this signature in the next block.

 

 依次类推便实现了一个“链”,这个链中任何一个区块的值都无法被篡改,因为任意的篡改都会导致当前区块计算出的签名值与下一个区块记录的签名值不一致,我们称为断链。如下图所示,对区块1的篡改就导致了区块1与区块2断链。

& nbsp; achieves a “chain” by analogy, where the value of any block cannot be tampered with, because arbitrary manipulation would cause the signature value calculated by the current block to be inconsistent with the signature value recorded by the next block, which we call a break. As shown in the figure below, the alteration of block 1 leads to a break-off of block 1 with block 2.

 

 3、区块链是如何完成记账的

& nbsp;3 How the block chain completes the bookkeeping

3.1 私钥、公钥与钱包

3.1 Private keys, public keys and wallets

一般的交易中我们需要用到“账户名、密码”比较严谨的还会用到“交易密码”,在虚拟货币交易时也是这样。要参与区块链首先你得有一个“私钥”,这个私钥其实就是一个32字节的随机数,像下面这样。

In normal transactions, we need to use “account names, passwords” more strictly than “transaction codes”, as in virtual currency transactions. In order to participate in block chains, you must first have a “private key”, which is a random 32-bit number, as follows.

“8F72F6B29E6E225A36B68DFE333C7CE5E55D83249D3D2CD6332671FA445C4DD3”

这个数是怎么来的呢?这完全看你了,你自己手写也行,摇骰子记录也行,但你自己编的很容易跟别人重复了,如果发生重复则别人就可以使用你的资产。所以一般是通过专门的随机数生成器来自动生成,这样的32字节随机数即使你生成到天荒地老很可能也难以重复出现两个一样的。一般各平台或客户端都配套有私钥生成器,大家不用操心这个。

It's entirely up to you, you can write your own hand, you can roll your dice, but you make it easy to repeat it with others, and you can use your assets if you do. So it's usually automatically generated through a dedicated random number generator, and it's probably hard to repeat two kinds of random 32 bytes, even if you grow old in the middle of nowhere. The platforms or clients are usually equipped with private key generators, and you don't have to worry about that.

公钥则是基于私钥的一系列运算(公开的算法)后得到的另一个字符串,钱包账户则是基于公钥再进行一次运算(公开算法)得到。总的来说你现在得到了3个有关联关系的字符串,大概长下面这样:

The public key is another string obtained after a series of calculations based on private keys (public algorithms), while the wallet account is obtained after another operation based on public keys (public algorithms). In general, you now have three strings associated with the connection, which are about the following:

私钥:8F72F6B29E6E225A36B68DFE333C7CE5E55D83249D3D2CD6332671FA445C4DD3

Private key: 8F72F6B29E6E225A36B68FE333C7CE5E55D83249D3D2CD6332671FA445C4DD3

公钥:04a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd5b8dec5235a0fa8722476c7709c02559e3aa73aa03918ba2d492eea75abea235

Public Keys: 04a34b99f22c790c4e36b2b2c3c3c3c35a36db06226e41fc692fc82b82b8b56ac1c540c5bd5b8dec5235a0fa8722476c7709c025559e3a73aa73a03918ba2d492eea75abea235

钱包:3E1yP8eO5Wkaib7DRPsfTN9Xlmu1CizfQg

Wallet: 3E1yP8eO5Wkaib7DRPsfTN9Xlmu1CizfQg

这里面最重要的是私钥,一定要保存好了,同时也需要保密,因为公钥和钱包都是基于私钥“通过公开算法”计算得来,也就是任何人掌握了你的私钥他都可以通过这个私钥来计算出公钥和钱包,从而控制你的虚拟资产。同时要注意的是,这三个字符串都是你本地生产的,链只做记录不负责相关的“开户”工作。

The most important of these are private keys, which must be preserved, and which need to be kept secret, because public keys and wallets are calculated on the basis of the private key “through open algorithms” whereby anyone who has your private key can use it to calculate the public key and wallet to control your virtual assets. It is also important to note that all three strings are locally produced and that the chain is recorded without the relevant “open account” work.

3.2 如何交易

3.2 How to trade

交易过程可以参考下图示意。

The course of the transaction may be illustrated by the figure below.

 

1)交易双方达成交易后,卖出方生产一条交易记录并指明自己的钱包和接收方钱包(前面讲过的一串字符),接着卖出方需要用自己的私钥对这个交易记录进行签名(就是做一次加密计算得到一串字符),并将签名结果放到交易记录的后面(就是把那一串字符附到后面)

1) Upon the conclusion of the transaction between the parties to the transaction, the seller produces a record of the transaction and identifies its wallet and the wallet of the recipient (a string of characters mentioned above), and the seller then needs to sign the record of the transaction with its own private key (i.e., an encrypt calculation resulting in a string of characters) and to place the result of the signature behind the record of the transaction (i.e. attach the string to the later).

2)卖方产出交易记录并签名后就将这个记录向全网广播,同时附上的还有自己的公钥(如何广播后面再讲)。

2) Once the seller produces the transaction record and signs it, the record is broadcast on the Internet, accompanied by its own public key (how to do so later).

3)链网络中的节点(就是矿工,后面讲)收到这个记录后会先存起来,每间隔10分钟有记账权力的节点会将收到的所有交易记录写到链中并向全网广播(为啥是10分钟、谁有权力记账后面讲)。

3) Nodes in the chain network (i.e. miners, later mentioned) will be saved upon receipt of the record, and all records of transactions received will be written into the chain and broadcast to the entire network (why 10 minutes, who has the authority to record the account) every 10 minutes.

4)不过在确认交易记录时,节点还需要对交易记录进行验证,比如用公钥检验下这个交易记录是不是真的由卖方发出的(如何检验后面说),同时还要查询下卖方是不是有这么多币可以交易。

(4) In confirming the record of the transaction, however, the node also needs to verify the record of the transaction, for example by testing the public key whether or not the record of the transaction was issued by the seller (how to say later), and also by asking whether the seller has so many coins to deal with.

5)网络中其他节点收到这个广播后会在本地记录下交易记录,这样就实现了一次全网的数据同步,同时也完成了交易的确认。

5) When the broadcast is received by other nodes of the network, the transaction is recorded locally, which allows for a web-wide data synchronization and also completes the confirmation of the transaction.

6)买卖双方这时候就能在链上查询到自己的交易记录了。

(6) The seller and buyer will then be able to trace their transaction records on the chain.

3.3 如何知道节点的地址

3.3 How to know the address of the node

交易时我们需要知道至少一个区块链网络中的节点地址,这样才能向网络提交数据。其实比特币源代码中是直接设置了一个“初始节点”的地址,默认是一个URL的域名,如果域名失效就直接访问IP,而这个初始节点地址是可以自己改的。总的来说当时搞这个的时候是有人在推动这个事情的,所以他们推出的客户端都写好了初始节点地址,也就是他们建设和维护的节点。如果你想自己来修改这个地址也可以的,比如你认识某个节点的维护人,你填上他的地址即可。当你连上某个节点后,它就会告诉你更多的节点地址,就这样口口相传维护了庞大的节点网络。

At the time of the transaction, we need to know the node address in at least one of the block chain networks in order to submit the data to the network. The Bitcoin source code actually has a direct “initial node” address, defaulting to an URL domain name, which can be accessed directly if the domain name lapses, and the initial node address can be changed by itself. In general, this was done when someone was driving the thing, so the client that they introduced wrote the initial node address, the node that they built and maintained. If you want to change the address yourself, for example, if you know the maintainer of a node, you can fill in his address. When you connect to a node, it will tell you more node addresses, so the mouth-to-mouth transmission maintains a huge node network.

4、节点(矿工)是如何发挥作用的

4, how do nodes (miners) work

在区块链网络中实际上是支持2种节点:全节点、轻节点。全节点就是存有所有的交易记录,一般矿工才会维护全节点,当然你也可以做雷锋。轻节点只存最新的交易记录,并根据你的需要去同步老的数据。显然轻节点就是一般的“客户端”,全节点则是矿工,那么矿工是如何在网络中发挥作用的呢?

In the block chain network, two nodes are actually supported: full nodes, light nodes. The whole node is where all the transactions are recorded, so that usually miners maintain the whole node, and, of course, you can do thunderbolts. Light nodes only keep up-to-date records of transactions and synchronize old data according to your needs. Clearly, light nodes are normal “clients” and full node are miners, so how do miners play a role in the network?

4.1 节点如何记账

4.1 How do nodes account for

前面说过区块链创建的初衷是“记账”,而记账的方式简单粗暴,就像前面描述的那样把一个个连续的“区块”存在本地,而且在收到其他节点同步过来的区块时也存起来,这样就构成了一个由节点组成的记账网络。网络中所有节点都有“全量数据”,说实话这种所谓分布式存储跟我们常说的分布式区别还蛮大的。

When it was said earlier that the block chain was created for the purpose of “accounting”, the way in which the account was kept was simple and rough, as described above, by keeping a continuous “block” locally, as well as when receiving blocks that were synchronized by other nodes, it constituted a network of accounts consisting of nodes. All nodes in the network have “full data”, and to be honest, this so-called distributional storage is quite different from the distribution that we often call it.

4.2 奖励机制与挖矿

4.2 Incentive mechanisms and mining

由于每个节点都会存全量数据,那么很快数据量就会变的很大,存储这样的数据是需要成本的,为何节点愿意存呢?因为有一个独特的奖励机制,即每10分钟,第一个获得了记账权的节点会获得50个比特币的奖励(最开始是50,每4年减半,后面说)。

Since every node contains full data, the amount of data will change very quickly, and it will cost to store such data. Why would the node be willing to do so? Because there is a unique incentive mechanism, that is, every 10 minutes, the first node to obtain rights to account will receive 50 bits of money (50 at the start, halved every 4 years, and later).

这么看网络中的所有节点都想来第一个记账对吧,那怎么来分配这个机会呢?区块链的发明者想到一个很有趣的方法,还记得前面我们讲的区块如何成链的吗,其实没讲全,在一个新的区块(Block3)被记录时,其实还有一个要求。

So all the nodes in the network want to be the first to record, right? So how do we allocate this opportunity? The inventors of the block chain came up with an interesting way of remembering how the blocks we've been talking about were chained, but not completely, and there was a demand when a new block (Block3) was recorded.

那就是在计算出Block2签名“9BZ”后,不是直接写到Block3中的,而是需要你随机生成一个数nonce,当这个nonce+9BZ(Block2的签名)形成的字符串经过哈希计算的结果符合下面特定要求才获得了写Block3的权力。

That is, when Block2's signature “9BZ” is calculated, it is not written directly in Block3, but you are required to create a random number of nónce, and the string formed by this nónce+9BZ (the signature of Block2) acquired the power to write Block3 only when Hashi calculated that the following particular requirements were met.

这个特定要求就是“哈希计算的结果要以不少于N个0为开头”,且这个N值是自动调节的(后面讲网络是如何调整N值),比如当N是10时,你哈希计算的结果必须要像下面这样:

This particular requirement is that “Hashi calculates no less than zero” and that the N value is automatically adjusted (and then how the network adjusts the N value), for example, when N is 10, you must calculate the result as follows:

“00000000006E225A36B68DFE333C7CE5E55D83249D3D2CD6332671FA445C4DD3”

这看上去就很难,因为哈希计算的结果是随机的,而且随机数的数量突破天际。你需要不停修改nonce的值然后做哈希运算,最后撞大运得到了一个10个0开头的字符串,恭喜你获得了记账的权利。当你成功记账后网络就会奖励你50个比特币,这个过程就是所谓的挖矿,所以我们才说节点的维护者都是矿工。

It seems difficult, because Hashi calculates randomly, and the number of random numbers goes beyond the sky. You need to keep changing the values of nonnece and then doing the Hashi calculations, and you get a 10-zero-start string, and you get the right to account. And the network rewards you with 50 bitcoins, a process that is called mining, so we say that nodes maintainers are miners.

前面提到过买卖达成交易后会由卖家产生一个交易记录向全网广播,所有节点都会收到,收到后先存在本地,当某个矿工得到了那个特定nonce后,他就会将收到的交易记录写到下一个区块中并向全网广播,其他节点收到广播后会做验证,验证通过后,所有节点再以最新的区块为基础寻找下一个nonce。

As mentioned earlier, once a transaction is concluded, the seller produces a record of the transaction that will be broadcast to the whole network, and all nodes will be received, which will then be available locally, and when a miner receives the particular nonce, he will write the record of the transaction that he will receive into the next block and broadcast it to the whole network, and when the other nodes receive the call, they will be validated and, after validation, all nodes will be searched for the next nonce on the basis of the most recent block.

4.3 为什么是10分钟

4.3 Why 10 minutes

10分钟只是个目标时间,我们知道全网的算力是动态的,节点的数量越多则算力越大,那么找到nonce的速度也就越快。为了实现10分钟记账一次这个目标,区块链采用调节0的数量来控制。前面讲过nonce+9BZ(Block2的签名)哈希计算的结果需要满足特定条件“哈希计算的结果要以不少于N个0为开头”。很明显这个N越小(0的数量越少)则难度越低,N越大(0的数量越多)难度越大,所以每次全网同步区块时还会评估当前全网的算力(就是看是不是算的太快了),如果感觉算力太多就会提高N的值,以此来控制记账时间间隔。

Ten minutes is a target time, and we know that the full network is dynamic, and the more the number of nodes is dynamic, the faster the nonce is found. In order to achieve the goal of a 10-minute bookkeeping, the block chain is controlled by a number of reconciliations of 0. The result of Hashi's calculation, as previously stated, is to meet certain conditions: “Hashi's calculation starts with no less than 0”. Clearly, the smaller the N (0) is less difficult, the larger the N (0) is more difficult, so every full web synchronization is to assess the current network's computing power (that is, to see if it's too fast), and if there is too much weight, then N's value is raised to control the time interval.

4.4 公钥检验原理

4.4 Public key test principle

前面我们说过“开户”其实就是你自己生成一个私钥,再基于私钥生成公钥和钱包。在你向矿工发送交易记录时,会有如下过程:

When you send a record of the transaction to the miners, there will be the following:

1)假设你的私钥是“QWER”、公钥是“ASDF”、钱包是“AAA”、对手钱包是“BBB”

1) Assuming your private key is QWER, the public key is ASDF, the wallet is AAA, and the counterpart wallet is BBB.

2)你本地产生交易记录,假设是 “AAA转出100,BBB转入100”

2) You locally generate transactional records, assuming that "AAA transfers out of 100, BBB transfers out of 100.

2)使用私钥对交易记录进行签名,其实就是做了一次加密运算(类似哈希那样将字符串转变为一串随机数),假设签名的结果是“SDADKJHKJGS”

2) Signing the transaction record using a private key, which in fact is an encrypted operation (which transforms a string into a random number, as Hashi has done), assuming that the signature results are "SDADKJHJGS"

3)将交易记录、签名、公钥发给矿工

3) Sending transaction records, signatures, public keys to miners

4)矿工得到的记录大概长这样:

4) Miners' records are about as long as this:

  AAA转出100,BBB转入100(交易记录);SDADKJHKJGS(签名);ASDF(公钥)

AAA transfers 100 and BBB transfers 100 (transaction records); SDADKJHKJGS (signature); ASDF (public key)

5)矿工使用你的公钥对签名进行解签(又是一顿字符操作),可以得到解签的结果比如说是“AAA转出100,BBB转入100”

5) Miners use your public key to de-sign a signature (and again a character operation) and can have the result, for example, "AAA transfers out of 100, BBB transfers out of 100."

6)矿工解签得到的结果与你发送的交易记录结果一致,那就证明了这个交易记录确实是你发的

6) The miner's release was consistent with the record of the transaction you sent, which proves that you did send the record of the transaction.

矿工为什么可以通过解签确认这个记录是你发的呢?

Why would a miner verify that you sent this record by unsigning it?

假设你现在的钱包账户是BBB,你想要伪造一个AAA转给BBB的记录,但是你没有AAA的私钥,假设你随便捏造了一个私钥“QWER-2”,并依据这个私钥产生了公钥“ASDF-2”。

Assuming that your current wallet account is BBB, you want to falsify a record that AAA has transferred to BBB, but you do not have an AAA private key, and that you create a private key, QWER-2, on the basis of this private key, the public key, ASDF-2.

使用捏造的私钥“QWER-2”对交易记录的签名结果是“SDADKJHKJGS-2”。

The result of the signature of the transaction record using the fabricated private key “Qwer-2” was “SDADKJHJGS-2”.

矿工使用公钥“ASDF-2”确实也可以对“SDADKJHKJGS-2”进行解签,解签的结果就是“AAA转出100,BBB转入100”。

It is true that miners can also design “SDADKJHJGS-2” using the public key “ASF-2”, which results in “AAA transfers out of 100 and BBB transfers out of 100.

但问题矿工使用公钥“ASDF-2”得到的钱包账号不可能是AAA,所以你的计划破产,这条交易记录被抛弃。

However, the wallet number obtained by the problem miners using the public key “ASF-2” could not be the AAA, so your plan went bankrupt and this transaction record was discarded.

4.5 矿工如何知道你有没有足够的币可以卖

4.5 How do miners know if you have enough money to sell ?

因为记账(挖矿)模式的特性,矿工处始终会存有最新最全的区块信息,所以他可以对以往的交易记录做一次全量查询来确认你是否有足够的币。其他收到新区块的节点也可以这样做,完成校验后才是真正对交易记录的确认。

Because of the characteristics of the billing (mining) model, the Miners always keep the most up-to-date block information, he can check all previous transactions to see if you have enough currency.

5、什么是6次确认

5, what's six confirmations

当你将交易记录发给矿工后,他先是存在本地(因为他还没有获得记账权),假设现在全网都收到了你提交的交易记录,都存在本地了。这时候某一个矿工A成功获得记账权(找到了那个10个0开头的字符串),他会将你的交易记录写入下一个区块,同时将找到的nonce和新区块信息向全网广播,其他矿工收到后会对nonce进行验证,验证OK就把这个新区块记录到本地存的链上,如果校验未通过会抛弃这个新区块,这个过程就是投票。一般来说我们认为这个过程应该是顺利的,但是保不齐有坏人,这就可能导致链的分叉。

When you send the record of the transaction to the miners, he first has a local presence (because he has not yet been given the right to account), assuming that now the whole network has received the record of the transaction that you have submitted, and there is a local presence. At that time, one miner, A, has succeeded in obtaining the right to account (the 10 zero-string string was found), he will write your record of the transaction into the next block, and he will broadcast the information on the nonne and the new block found to the entire network. When the other miners receive it, they will verify that the new block will be recorded on the local chain, and if the check does not pass, the process will be a vote. In general, we believe that the process should be smooth, but that there are bad people, which may lead to a break in the chain.

比如某个矿工B不承认你的结果,而他自己找到了一个新的结果,他也向全网广播,这样就可能一部分节点收到了A区块的,一部分节点收到了B区块的。这时候怎么办呢?啥也不办,大家继续埋头挖矿。但链确实是产生了2个分支,我们把有你的交易记录的链称为A分支,没有你交易记录的链称为B分支,全网中各有一部分节点支持A或B。

For example, a miner B did not recognize your results, and he himself found a new result, and he broadcast it to the whole Internet, so that some nodes received block A, and some nodes received block B. What do we do then? Nothing to do, everyone continues digging. But the chain does produce two branches, we call the chain with your transaction record " branch A ", the chain without your transaction record " branch B ", and there are parts of the whole network that support sections A or B.

假设现在B分支下某个矿工成功找到了新的nonce并向全网广播,由于B分支现在比A分支更长,这样全网都会以最长的链作为标准,也就是认可B分支抛弃A分支。

Assuming that a miner under branch B now succeeds in finding a new nence and broadcasting it to the Internet, as branch B is now longer than branch A, the whole network will be based on the longest chain, that is, the approval of branch B to abandon branch A.

那么结果就是你写下的交易记录也被抛弃了。所以默认需要进过6次确认才稳妥,所谓6次不是6个节点或全网进行6次重复的确认,而是链新增了6次新的区块,这样即使产生了链的分叉,你的交易记录被写入链中也基本是无法更改的了。相对应的,如果链新增的区块数比较少,你的交易记录是有可能被抛弃的。当然6这个数也不是绝对的,有时候3次确认也OK,看你自己了。

The result is that the transaction records you write are also discarded. So the default takes six confirmations, not six nodes or the whole network, six confirmations, but six new blocks in the chain, so that your transaction records are basically unalterable in the chain, even if a fork in the chain is created. Correspondingly, if the number of additional blocks in the chain is smaller, your transaction records are likely to be discarded. Of course, this number is not absolute, and sometimes three confirmations are OK, depending on you.

此外能够看出由于每10分钟产生一个新区块,产生6个新区块你的记录才能稳妥(60分钟),这速度着实是慢了点。

In addition, it can be seen that with the creation of a new block every 10 minutes, six new blocks will be created to keep your records secure (60 minutes), which is a bit slower.

6、手续费

6, fees

前面讲过矿工通过获得记账权来收获比特币,但我们又知道比特币的总数是2100W,而且生产的速度会越来越慢(后面讲为啥),那早晚有一天会被挖完到时候没有人挖矿,也没有人有动力来记账,整个区块链网络岂不就废了?

As mentioned earlier, miners get bitcoin by getting rights to account, but we also know that bitcoin's total is 2,100 W, and that production is going to be slower and slower. Sooner or later, when the digs are finished, no one digs the mine, no one has the incentive to record it, and the entire network of blocks is gone.

所以还有个补充机制,那就是手续费。获得记账权的矿工除了直接获得奖励外,还能收到写交易记录需求方提供的手续费,比如你需要卖币给某人,想要矿工们帮你记录下这个交易记录,你得付出一定的币。

So there's a supplementary mechanism, that's the fee. In addition to receiving a direct reward, the miners who get the rights to record the transaction will receive a fee from the demand side, for example, if you need to sell money to someone, if you want the miners to record the transaction for you, you have to pay a certain amount of money.

那这里又产生了一个知识点,其实一个区块的大小是1MB,大概能够记录2000-3000条交易记录,所以一个矿工奋力挖矿10分钟,撞大运获得了记账权,他只能记录2000多个交易记录。但全网的交易是比较活跃的,10分钟可能就有上万笔记录需求,这时候咋办?

So here's another point of knowledge: one block is about 2,000 or 3,000 transactions, so a miner digs hard for 10 minutes, gets rights to booking, and he can only record more than 2,000 transactions. But the whole network is active, and there may be tens of thousands of records in 10 minutes.

很简单,谁给的手续费多我就记录谁。所以又产生了一个问题,那就是排队,你给的手续费少了就得排队,没有手续费可能就排到天荒地老也没人给你记录。

It's simple, I'll record who pays the extra fees. So another problem that arises is that you'll have to line up if you don't pay the extra fees, and if you don't, you'll be old and no one will record you.

7、2100W与减半机制

7, 2100W and the halving mechanism

2100W这个总数是写在源代码内的,现在链中的节点那么多,想改大这个数几乎不可能(得所有节点同意,否则会产生分支链)。

The total of 2100W, which is written in the source code, now has so many nodes in the chain that it is almost impossible to expand it (with all nodes agreeing, otherwise the branch chain would be created).

另外前面提到成功获得记账权的矿工会被奖励50个币,但随着挖出的币越来越多,达到某个量后奖励会减半,因为大概每10分钟就挖出一次币,可以简单算出每4年奖励就减半这个机制。

In addition, the mining unions mentioned earlier that were successful in obtaining the right to account were rewarded with 50 coins, but as more and more of the coins were dug up, the reward would be halved after reaching a certain amount, since it would be approximately 10 minutes to dig up the currency and a simple four-year mechanism could be calculated to halve the reward.

所以奖励是50、25、12.5.。。。依次变小一直到几乎没有,也就是挖矿不再有收益了。这个最终时间也算出来了,就是 2140 前后。

So the reward is 50, 25, 12.5. It's small until there's almost nothing, which means there's no profit from digging. And this is the final time, and that's & nbsp; 2140 before and after.

不过到时矿工还是继续挖矿,不是还有手续费嘛。

By then, however, miners would continue to dig, and there would still be a fee.

8、区块大小1MB能改吗

8 and block size 1MB can be changed

可以改,但是得全网同意,如果有人改了有人没改,那就会导致链分叉,事实上任何对协议的修改都可能产生分叉。比较有名的就是BCH,当时就是为了对区块进行扩容,大部分人不同意,同意的人自己开了新的分叉就是BCH。

It can be changed, but it has to be agreed on the Internet that if someone changes it, it will lead to a chain fork, and in fact any modification of the agreement may result in a fork. The better known is the BCH, which was used to expand the block, most people disagree, and the person who agreed opened the new fork is the BCH.

9、比特币的最小分割单位

9, the smallest split in bitcoin

最小分割单位是1聪(就是中本聪的简称),1BTC=1亿聪,所以我们可以知道BTC的容量其实是2100万亿聪,这样看起来远没有2100万那么稀缺了。

The smallest division unit is one hearing, one BTC = 100 million, so we can see that BTC actually has a capacity of 21 trillion, so it doesn't look as scarce as 21 million.

10、总结

10, summary

总的来说,区块链是一个多中心的记账系统,我觉得多中心比分布式能更准确描述这个架构,因为每个节点都是全量存储的,所以每一个节点就是一个中心。

In general, the block chain is a multi-centric accounting system, and I think multi-centres describe the structure more accurately than distributed, because each node is stored in full, so each node is a centre.

使用了私钥、公钥、钱包来实现全流程的加密。

Use private keys, public keys, wallets to achieve full process encryption.

这个系统的记账频率是10分钟,为调节这个频率引入了nonce找特定数机制。

The recording frequency for this system is 10 minutes, and a noce-specific numerical mechanism has been introduced to reconcile this frequency.

为鼓励大家来参与记账,引入了记账后奖励比特币的机制。

To encourage participation in bookkeeping, mechanisms have been introduced to reward Bitcoin after bookkeeping.

为避免比特币无限量增加,引入了2100万总数机制。

In order to avoid an unlimited increase in bitcoin, a total of 21 million mechanisms have been introduced.

为避免几天就把币挖完了,引入了每4年奖励减半机制。

In order to avoid digging out the currency in a few days, a mechanism was introduced to halve the incentives every four years.

为避免2100万不够用,又引入了1亿聪等于1比特币的细分机制。

In order to avoid the underutilization of 21 million dollars, a further 100 million deaf equals 1 bitcoin was introduced.

 

美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明

分享:

扫一扫在手机阅读、分享本文

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 0.00003374个比特币等于多少人民币/美金

    0.00003374个比特币等于多少人民币/美金
    0.00003374比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00003374比特币等于2.2826 1222美元/16.5261124728人民币。比特币(BTC)美元(USDT)人民币(CNY)0.00003374克洛克-0/22216.5261124728比特币对人民币的最新汇率为:489807.72 CNY(1比特币=489807.72人民币)(1美元=7.24人民币)(0.00003374USDT=0.0002442776 CNY)。汇率更新于2024...
  • 134 USD toBTC Calculator -

    134                            USD                        toBTC                        Calculator -
    For the week (7 days) Date Day 134 USD to BTC Changes Changes % June...
  • 0.00006694个比特币等于多少人民币/美金

    0.00006694个比特币等于多少人民币/美金
    0.00006694比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00006694比特币等于4.53424784美元/32.5436 16人民币。比特币(BTC)美元(USDT)人民币(CNY)0.000066944.53424784【比特币密码】32.82795436 16比特币对人民币的最新汇率为:490408.64 CNY(1比特币=490408.64人民币)(1美元=7.24人民币)(0.00006694USDT=0.0004846456 CNY)汇率更新时...
  • 12年怎么购买比特币?比特币投资,轻松掌控

    12年怎么购买比特币?比特币投资,轻松掌控
    12年怎么购买比特币?买卖比特币可以通过以下交易所进行购买,分别是:欧易官网平台、ZG交易所、艾戴克斯交易所、C2CX交易软件、BaseFEX交易APP、波网交易平台、安银交易所、BitMart交易软件、紫牛币交所交易APP和澳网(AOMEX)交易平台等等十大平台下载,高效安全的数字货币交易平台。How do you buy bitcoins in 12 years? Bitcoins can be purchased through ten major platforms...
  • 0.00015693个比特币等于多少人民币/美金

    0.00015693个比特币等于多少人民币/美金
    0.000 15693比特币等于多少人民币?根据比特币对人民币的最新汇率,0.000 15693比特币等于10.6 1678529美元/76.86554996人民币。比特币(BTC)【比特币价格翻倍】美元(USDT)人民币(CNY)0.000/克洛克-0/5693【数字货币矿机】10.6 167852976.8655254996比特币对人民币的最新汇率为:489,807.72 CNY(1比特币= 489,807.72人民币)(1美元=7.24人民币)(0.00015693 U...
标签列表