节点
21 条名言。中文为本站译文,每条附日期与原文链接。
节点始终将最长链视为正确的链,并持续在其上扩展工作。如果两个节点同时广播了下一个区块的不同版本,一些节点可能先收到其中一个。在这种情况下,它们先在收到的第一个区块上工作,但把另一个分支保存下来,以防它后来变长。当下一个工作量证明被找到、其中一个分支变长时,僵局就会打破;那些在另一分支上工作的节点随后就会切换到更长的那条。
英文原文
Nodes always consider the longest chain to be the correct one and will keep working on extending it. If two nodes broadcast different versions of the next block simultaneously, some nodes may receive one or the other first. In that case, they work on the first one they received, but save the other branch in case it becomes longer. The tie will be broken when the next proof-of-work is found and one branch becomes longer; the nodes that were working on the other branch will then switch to the longer one.
网络以其无结构的简单性而健壮。节点无需太多协调,同时并行工作。它们不需要被识别,因为消息不发往任何特定地点,只需尽力送达即可。节点可以随意离开并重新加入网络,接受工作量证明链作为它们离线期间所发生之事的证明。它们用 CPU 算力投票:通过在有效区块上继续扩展工作来表达对其的接受,通过拒绝在无效区块上工作来拒绝它们。所有必要的规则和激励都可以通过这种共识机制来执行。
英文原文
The network is robust in its unstructured simplicity. Nodes work all at once with little coordination. They do not need to be identified, since messages are not routed to any particular place and only need to be delivered on a best effort basis. Nodes can leave and rejoin the network at will, accepting the proof-of-work chain as proof of what happened while they were gone. They vote with their CPU power, expressing their acceptance of valid blocks by working on extending them and rejecting invalid blocks by refusing to work on them. Any needed rules and incentives can be enforced with this consensus mechanism.
无需运行完整的网络节点也能验证支付。用户只需保留最长工作量证明链的区块头副本——通过向网络节点查询,直到确信自己拥有最长链——并获取将交易与其所处区块的时间戳关联起来的默克尔分支。他无法亲自核验交易,但通过把它锚定在链上的某个位置,他可以看到已有网络节点接受了它,而之后追加的区块则进一步证实了网络的接受。
因此,只要诚实节点控制着网络,这种验证就是可靠的;但如果网络被攻击者压倒,风险就更大。虽然网络节点可以亲自验证交易,但简化的方法可能被攻击者伪造的交易所欺骗——只要攻击者能持续压制网络。一种防范策略是:当网络节点检测到无效区块时发出警报,促使用户的软件下载完整区块和被警示的交易,以确认不一致。经常收款的商户可能仍希望运行自己的节点,以获得更独立的安全性和更快的验证。
英文原文
It is possible to verify payments without running a full network node. A user only needs to keep a copy of the block headers of the longest proof-of-work chain, which he can get by querying network nodes until he's convinced he has the longest chain, and obtain the Merkle branch linking the transaction to the block it's timestamped in. He can't check the transaction for himself, but by linking it to a place in the chain, he can see that a network node has accepted it, and blocks added after it further confirm the network has accepted it.
As such, the verification is reliable as long as honest nodes control the network, but is more vulnerable if the network is overpowered by an attacker. While network nodes can verify transactions for themselves, the simplified method can be fooled by an attacker's fabricated transactions for as long as the attacker can continue to overpower the network. One strategy to protect against this would be to accept alerts from network nodes when they detect an invalid block, prompting the user's software to download the full block and alerted transactions to confirm the inconsistency. Businesses that receive frequent payments will probably still want to run their own nodes for more independent security and quicker verification.
运行网络的步骤如下:
1. 新交易被广播到所有节点。
2. 每个节点把新交易收集进一个区块。
3. 每个节点为其区块寻找一个困难的工作量证明。
4. 当某个节点找到工作量证明,就把区块广播到所有节点。
5. 只有当区块中的所有交易都有效且尚未被花费,节点才接受该区块。
6. 节点通过在该链上创建下一个区块来表达对其的接受,使用已接受区块的哈希作为前一哈希。
英文原文
The steps to run the network are as follows:
1. New transactions are broadcast to all nodes.
2. Each node collects new transactions into a block.
3. Each node works on finding a difficult proof-of-work for its block.
4. When a node finds a proof-of-work, it broadcasts the block to all nodes.
5. Nodes accept the block only if all transactions in it are valid and not already spent.
6. Nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash.
我们需要一种让收款方知道先前的所有者没有签署过更早的交易的方法。对我们而言,最早的交易才是算数的那一笔,所以我们不关心后来的双重支付企图。确认一笔交易不存在的唯一方式,是知晓所有交易。在基于铸币机构的模型中,铸币机构知晓所有交易并决定哪一笔先到。为了在没有可信第三方的情况下实现这一点,交易必须公开宣布,而且我们需要一套系统,让参与者就接收到的交易顺序的唯一历史达成一致。收款方需要证明:在每笔交易发生时,多数节点都同意它是第一个收到的。
英文原文
We need a way for the payee to know that the previous owners did not sign any earlier transactions. For our purposes, the earliest transaction is the one that counts, so we don't care about later attempts to double-spend. The only way to confirm the absence of a transaction is to be aware of all transactions. In the mint based model, the mint was aware of all transactions and decided which arrived first. To accomplish this without a trusted party, transactions must be publicly announced, and we need a system for participants to agree on a single history of the order in which they were received. The payee needs proof that at the time of each transaction, the majority of nodes agreed it was the first received.
起初,大多数用户都会运行网络节点,但当网络增长超过一定规模后,这件事会越来越多地留给拥有服务器机房和专用硬件的专家。服务器机房只需要在网络上有一个节点,机房内的其余局域网设备都连接到这个节点。
英文原文
At first, most users would run network nodes, but as the network grows beyond a certain point, it would be left more and more to specialists with server farms of specialized hardware. A server farm would only need to have one node on the network and the rest of the LAN connects with that one node.
只有想创造新币的人才需要运行网络节点。
英文原文
Only people trying to create new coins would need to run network nodes.
当节点收到一个区块,会对照区块中以往交易检查其中每一笔交易的签名。区块只能包含依赖于以往区块(或同一区块)中有效交易的那些交易。交易 C 可以依赖同一区块中的交易 B,而 B 依赖更早区块中的交易 A。
英文原文
When a node receives a block, it checks the signatures of every transaction in it against previous transactions in blocks. Blocks can only contain transactions that depend on valid transactions in previous blocks or the same block. Transaction C could depend on transaction B in the same block and B depends on transaction A in an earlier block.
没错,节点会把交易保留在自己的工作集中,直到它们被收进区块。如果一笔交易到达了 90% 的节点,那么每当一个新区块被找到,它就有 90% 的概率被收进其中。
英文原文
Right, nodes keep transactions in their working set until they get into a block. If a transaction reaches 90% of nodes, then each time a new block is found, it has a 90% chance of being in it.
必须严格规定:最长链始终被视为有效链。在场的节点可能记得某个分支先出现、后来被另一分支取代,但它们无法让不在场的人信服这一点。我们不能让节点出现派系分化:一部分人固执地认准自己先看到的分支,另一部分人先看到另一个分支,还有后来加入、从未见证过当时情形的人。CPU 算力的工作量证明投票必须拥有最终话语权。要让所有人保持一致,唯一的办法就是认定最长链始终是有效的链,无论发生什么。
英文原文
It is strictly necessary that the longest chain is always considered the valid one. Nodes that were present may remember that one branch was there first and got replaced by another, but there would be no way for them to convince those who were not present of this. We can't have subfactions of nodes that cling to one branch that they think was first, others that saw another branch first, and others that joined later and never saw what happened. The CPU power proof-of-work vote must have the final say. The only way for everyone to stay on the same page is to believe that the longest chain is always the valid one, no matter what.
交易会迅速在全网传播,所以如果同一笔交易有两个版本在接近同一时间被报告,先出发的那个会在率先到达更多节点方面占据巨大优势。节点只会接受自己先看到的那个,拒绝后来到达的第二个版本,因此更早的交易会有多得多的节点努力把它收进下一个工作量证明。实际上,每个节点都通过把它先看到的交易纳入自己的工作量证明工作,为自己的观点投票。如果两笔交易确实在同一时间到来、平分秋色,那就是一场抛硬币:看哪个先进入工作量证明,就由它决定哪个有效。
英文原文
A transaction will quickly propagate throughout the network, so if two versions of the same transaction were reported at close to the same time, the one with the head start would have a big advantage in reaching many more nodes first. Nodes will only accept the first one they see, refusing the second one to arrive, so the earlier transaction would have many more nodes working on incorporating it into the next proof-of-work. In effect, each node votes for its viewpoint of which transaction it saw first by including it in its proof-of-work effort. If the transactions did come at exactly the same time and there was an even split, it's a toss up based on which gets into a proof-of-work first, and that decides which is valid.
当某个节点找到工作量证明,新区块就会在全网传播,每个人都把它加到链上,开始在它之后工作下一个区块。那些手里拿着另一笔交易的节点会停止尝试把它收进区块,因为按照被接受的链,它现在已经无效。
英文原文
When a node finds a proof-of-work, the new block is propagated throughout the network and everyone adds it to the chain and starts working on the next block after it. Any nodes that had the other transaction will stop trying to include it in a block, since it's now invalid according to the accepted chain.
有了我最近发布的那套基于交易费的激励系统,节点就有动力把收到的所有付费交易都收进区块。
英文原文
With the transaction fee based incentive system I recently posted, nodes would have an incentive to include all the paying transactions they receive.
广播大概率会非常可靠。如今 TCP 传输极少丢包,而且广播协议带有重试机制,一段时间后可以从其他节点获取数据。如果实践中广播比预期更慢,可能就得延长区块之间的目标时间,避免浪费算力。我们希望区块通常在远小于其生成时间的时间内传播完毕,否则节点会把太多时间花在过时的区块上。
英文原文
Broadcasts will probably be almost completely reliable. TCP transmissions are rarely ever dropped these days, and the broadcast protocol has a retry mechanism to get the data from other nodes after a while. If broadcasts turn out to be slower in practice than expected, the target time between blocks may have to be increased to avoid wasting resources. We want blocks to usually propagate in much less time than it takes to generate them, otherwise nodes would spend too much time working on obsolete blocks.
如果你能保持一个接受入站连接的节点运行,那真是给网络帮了大忙。防火墙上需要打开 8333 端口以接收入站连接。
英文原文
If you can keep a node running that accepts incoming connections, you'll really be helping the network a lot. Port 8333 on your firewall needs to be open to receive incoming connections.
如果你对付手续费感到心疼,随时可以反过来自己运行一个节点,也许某天你也能大赚一笔 0.44 的手续费。
英文原文
If you're sad about paying the fee, you could always turn the tables and run a node yourself and maybe someday rake in a 0.44 fee yourself.
设计方案勾勒了一种不需要完整区块链的轻量客户端。在设计 PDF 里它叫"简化支付验证"(Simplified Payment Verification)。轻量客户端可以发送和接收交易,只是不能生成区块。它不需要信任某个节点来验证支付,自己就能验证。
轻量客户端还没实现,但计划在需要的时候实现。目前大家都还是运行完整的网络节点。
英文原文
The design outlines a lightweight client that does not need the full block chain. In the design PDF it's called Simplified Payment Verification. The lightweight client can send and receive transactions, it just can't generate blocks. It does not need to trust a node to verify payments, it can still verify them itself.
The lightweight client is not implemented yet, but the plan is to implement it when it's needed. For now, everyone just runs a full network node.
在达到均衡规模时,许多节点会是服务器机房——一两个网络节点通过局域网为机房内其余设备提供服务。
英文原文
At equilibrium size, many nodes will be server farms with one or two network nodes that feed the rest of the farm over a LAN.
我预计节点总数永远不会超过 10 万,可能更少。它会达到一个均衡:再多节点加入就不划算了。其余的将是轻量客户端,可能达到数百万。
英文原文
I anticipate there will never be more than 100K nodes, probably less. It will reach an equilibrium where it's not worth it for more nodes to join in. The rest will be lightweight clients, which could be millions.
当前每个用户都是一个网络节点的系统,并非为大规模场景设计的配置。这就像每个 Usenet 用户都运行自己的 NNTP 服务器一样。设计支持让用户就做用户。运行节点的负担越重,节点就会越少。那少数节点将是大型服务器机房,其余的则是只做交易、不生成区块的客户端节点。
英文原文
The current system where every user is a network node is not the intended configuration for large scale. That would be like every Usenet user runs their own NNTP server. The design supports letting users just be users. The more burden it is to run a node, the fewer nodes there will be. Those few nodes will be big server farms. The rest will be client nodes that only do transactions and don't generate.
另一个办法是减少每个区块允许的免费交易数量,超过之后就必须收交易费。节点每个区块只收这么多 KB 的免费交易,之后就要求至少 0.01 的交易费。这个阈值大概应该比现在更低一些。我认为阈值永远不该是 0——至少应该永远允许一些免费交易。
英文原文
Another option is to reduce the number of free transactions allowed per block before transaction fees are required. Nodes only take so many KB of free transactions per block before they start requiring at least 0.01 transaction fee. The threshold should probably be lower than it currently is. I don't think the threshold should ever be 0. We should always allow at least some free transactions.
